Links
Home
Oracle DBA Forum
Frequent Oracle Errors
TNS:could not resolve the connect identifier specified
Backtrace message unwound by exceptions
invalid identifier
PL/SQL compilation error
internal error
missing expression
table or view does not exist
end-of-file on communication channel
TNS:listener unknown in connect descriptor
insufficient privileges
PL/SQL: numeric or value error string
TNS:protocol adapter error
ORACLE not available
target host or object does not exist
invalid number
unable to allocate string bytes of shared memory
resource busy and acquire with NOWAIT specified
error occurred at recursive SQL level string
ORACLE initialization or shutdown in progress
archiver error. Connect internal only, until freed
snapshot too old
unable to extend temp segment by string in tablespace
Credential retrieval failed
missing or invalid option
invalid username/password; logon denied
unable to create INITIAL extent for segment
out of process memory when trying to allocate string bytes
shared memory realm does not exist
cannot insert NULL
TNS:unable to connect to destination
remote database not found'>ora-02019
exception encountered: core dump
inconsistent datatypes
no data found
TNS:operation timed out
PL/SQL: could not find program
existing state of packages has been discarded
maximum number of processes exceeded
error signaled in parallel query server
ORACLE instance terminated. Disconnection forced
TNS:packet writer failure
see ORA-12699
missing right parenthesis
name is already used by an existing object
cannot identify/lock data file
invalid file operation
quoted string not properly terminated
Smells like oracle bug?

Smells like oracle bug?

2006-07-13       - By Gints Plivna

Reply:     1     2     3     4     5     6     7     8     9     10     >>  

Short description - different results for the same selects with or
without rather innocent hints. Actually I found it on other tables in
our system, but at least I can reproduce a testcase.

Same results was on 9.2.0.4 and 9.2.0.7. Unfortunately haven't other
bases handy to check this. Probably someone can check whether I'm
unique in this Oracle world or not?


Connected to:
Oracle9i Enterprise Edition Release 9.2.0.7.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.7.0 - Production

SQL> create table blahh (id1 number, id2 number);

Table created.

SQL> create index idx1 on blahh (id1);

Index created.

SQL> create index idx2 on blahh (id2);

Index created.

SQL> insert into blahh values (1, null);

1 row created.

SQL> commit;

Commit complete.

SQL> exec dbms_stats.gather_table_stats(user, 'blahh', cascade=>true)

PL/SQL procedure successfully completed.

SQL> set autotrace on
SQL> select 'x' from dual where exists (
 2    select 'z' from blahh where
 3    (id1 = 1 and id2 is null) or (id1 is null and id2 = 1))
 4  /

'
-
x


Execution Plan
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -----
  0      SELECT STATEMENT Optimizer=FIRST_ROWS (Cost=2 Card=1)
  1    0   FILTER
  2    1     TABLE ACCESS (FULL) OF 'DUAL' (Cost=2 Card=1)
  3    1     TABLE ACCESS (FULL) OF 'BLAHH' (Cost=2 Card=1 Bytes=3)


SQL> select 'x' from dual where exists (
 2    select /*+ index_ffs (blahh idx1 idx2) */ 'z' from blahh where
 3    (id1 = 1 and id2 is null) or (id1 is null and id2 = 1))
 4  /

no rows selected


Execution Plan
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -----
  0      SELECT STATEMENT Optimizer=FIRST_ROWS (Cost=2 Card=1)
  1    0   FILTER
  2    1     TABLE ACCESS (FULL) OF 'DUAL' (Cost=2 Card=1)
  3    1     TABLE ACCESS (BY INDEX ROWID) OF 'BLAHH' (Cost=1 Card=1
         Bytes=3)

  4    3       INDEX (FULL SCAN) OF 'IDX2' (NON-UNIQUE)


Trace file also shows the same plans, so autotrace isn't lying this
time. Actually in production the plans were different and here they
looked as follows:

SQL> select 'x' from dual where exists (
 2  SELECT 'z'
 3    FROM <tablename>
 4  WHERE (Radp_Rrpr_Id = 10000003254  AND Radp_Rrpr_Id1 IS NULL) OR
 5  (Radp_Rrpr_Id IS NULL AND Radp_Rrpr_Id1 = 10000003254))
 6  /

no rows selected

Elapsed: 00:00:00.03

Execution Plan
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -----
  0      SELECT STATEMENT Optimizer=CHOOSE (Cost=2 Card=82)
  1    0   FILTER
  2    1     TABLE ACCESS (FULL) OF 'DUAL' (Cost=2 Card=82)
  3    1     VIEW OF 'index$_join$_002' (Cost=4 Card=1 Bytes=14)
  4    3       HASH JOIN
  5    4         INDEX (FAST FULL SCAN) OF 'IX_RADP_RRPR_ID' (NON-UNI
         QUE) (Cost=4 Card=1 Bytes=14)

  6    4         INDEX (FAST FULL SCAN) OF 'IX_RADP_RRPR_ID1' (NON-UN
         IQUE) (Cost=4 Card=1 Bytes=14)

SQL> select 'x' from dual where exists (
 2  SELECT /*+ full (<tablename>) */'z'
 3    FROM <tablename>
 4  WHERE (Radp_Rrpr_Id = 10000003254  AND Radp_Rrpr_Id1 IS NULL) OR
 5  (Radp_Rrpr_Id IS NULL AND Radp_Rrpr_Id1 = 10000003254))
 6  /

'
-
x

1 row selected.

Elapsed: 00:00:00.03

Execution Plan
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -----
  0      SELECT STATEMENT Optimizer=CHOOSE (Cost=2 Card=82)
  1    0   FILTER
  2    1     TABLE ACCESS (FULL) OF 'DUAL' (Cost=2 Card=82)
  3    1     TABLE ACCESS (FULL) OF '<tablename>' (Cost=2 Card=1 By
         tes=14)

Gints Plivna
http://www.gplivna.eu/
--
http://www.freelists.org/webpage/oracle-l