.ora-code.com

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
Select from dual return 3 rows !

Select from dual return 3 rows !

2005-11-09       - By Norman Dunbar
Reply:     <<     11     12     13     14     15     16     17     18     19  


Morning all,

just thought I'd throw this into the mix, seeing as no-one else has
yet. Skip to the end for the best bit - 10g FAST DUAL access.

In 8i, SELECT SYSDATE FROM DUAL results in this from autotrace (every
time it is called) :

Execution Plan
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -----
  0      SELECT STATEMENT Optimizer=CHOOSE
  1    0   TABLE ACCESS (FULL) OF 'DUAL'

Statistics
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -----
         0  recursive calls
         4  db block gets
         1  consistent gets
         0  physical reads
         0  redo size
       434  bytes sent via SQL*Net to client
       436  bytes received via SQL*Net from client
         3  SQL*Net roundtrips to/from client
         0  sorts (memory)
         0  sorts (disk)
         3  rows processed


Selecting from USER_USERS gets this the first call :

Execution Plan
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -----
  0      SELECT STATEMENT Optimizer=CHOOSE
  1    0   NESTED LOOPS
  2    1     NESTED LOOPS
  3    2       NESTED LOOPS
  4    3         NESTED LOOPS
  5    4           NESTED LOOPS
  6    5             TABLE ACCESS (FULL) OF 'USER_ASTATUS_MAP'
  7    5             TABLE ACCESS (CLUSTER) OF 'USER$'
  8    7               INDEX (UNIQUE SCAN) OF 'I_USER#' (NON-UNIQUE)
  9    4           TABLE ACCESS (CLUSTER) OF 'TS$'
 10    9             INDEX (UNIQUE SCAN) OF 'I_TS#' (NON-UNIQUE)
 11    3         TABLE ACCESS (CLUSTER) OF 'TS$'
 12   11           INDEX (UNIQUE SCAN) OF 'I_TS#' (NON-UNIQUE)
 13    2       TABLE ACCESS (BY INDEX ROWID) OF 'PROFILE$'
 14   13         INDEX (RANGE SCAN) OF 'I_PROFILE' (NON-UNIQUE)
 15    1     TABLE ACCESS (BY INDEX ROWID) OF 'PROFILE$'
 16   15       INDEX (RANGE SCAN) OF 'I_PROFILE' (NON-UNIQUE)




Statistics
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -----
       475  recursive calls
         6  db block gets
       149  consistent gets
        17  physical reads
         0  redo size
       207  bytes sent via SQL*Net to client
        57  bytes received via SQL*Net from client
         2  SQL*Net roundtrips to/from client
        10  sorts (memory)
         0  sorts (disk)
         1  rows processed


and these stats on subsequent calls :

Statistics
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -----
         0  recursive calls
         4  db block gets
        61  consistent gets
         0  physical reads
         0  redo size
       208  bytes sent via SQL*Net to client
       128  bytes received via SQL*Net from client
         3  SQL*Net roundtrips to/from client
         0  sorts (memory)
         0  sorts (disk)
         1  rows processed


Which looks much 'nastier'.  With 9i it looks like this for DUAL on all
calls (Stats only) :

Statistics
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -----
         0  recursive calls
         0  db block gets
         3  consistent gets
         0  physical reads
         0  redo size
       200  bytes sent via SQL*Net to client
       275  bytes received via SQL*Net from client
         2  SQL*Net roundtrips to/from client
         0  sorts (memory)
         0  sorts (disk)
         1  rows processed

Note only 3 consistent gets this time. Again, stats only for USER_USERS
I get this first time :

Statistics
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -----
       250  recursive calls
         0  db block gets
       153  consistent gets
        15  physical reads
         0  redo size
       200  bytes sent via SQL*Net to client
       275  bytes received via SQL*Net from client
         2  SQL*Net roundtrips to/from client
        11  sorts (memory)
         0  sorts (disk)
         1  rows processed

and the following on subsequent attempts :

Statistics
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -----
         0  recursive calls
         0  db block gets
        80  consistent gets
         0  physical reads
         0  redo size
       199  bytes sent via SQL*Net to client
       275  bytes received via SQL*Net from client
         2  SQL*Net roundtrips to/from client
         0  sorts (memory)
         0  sorts (disk)
         1  rows processed


But the good news for 10g users is this, there is a new FAST DUAL
access path when selecting something from dual where that something is
not a column of dual. If you select * or DUMMY from dual, you won't get
fast dual access. Fast dual results in 0 (zero) logical I/Os which is
nice.

Unfortunately due to my laptop eating its own hard drive, I'm currently
without Oracle 10g and cannot test against USER_USERS but I suspect the
stats are somewhat similar to the above.

I'd say that with the new protected DUAL where you can't put extra rows
in and 10g's access path, DULA is still the way to go.

Cheers,
Norman.

Norman Dunbar.
Contract Oracle DBA.
Rivers House, Leeds.

Internal : 7 28 2051
External : 0113 231 2051


Information in this message may be confidential and may be legally privileged.
If you have received this message by mistake, please notify the sender
immediately, delete it and do not copy it to anyone else.

We have checked this email and its attachments for viruses. But you should
still check any attachment before opening it.

We may have to make this message and any reply to it public if asked to under
the Freedom of Information Act, Data Protection Act or for litigation.  Email
messages and attachments sent to or from any Environment Agency address may
also be accessed by someone other than the sender or recipient, for business
purposes.

If we have sent you information and you wish to use it please read our terms
and conditions which you can get by calling us on 08708 506 506.  Find out more
about the Environment Agency at www.environment-agency.gov.uk
--
http://www.freelists.org/webpage/oracle-l