Ask the Expert

Where is autotrace getting stats?

I am getting following statistics after setting the autotrace on for a query.
           0  recursive calls
           0  db block gets
           4  consistent gets
           0  physical reads
           0  redo size
         866  bytes sent via SQL*Net to client
         503  bytes received via SQL*Net from client
           2  SQL*Net roundtrips to/from client
           0  sorts (memory)
           0  sorts (disk)
          3  rows processed
Qusetion: From where is it getting information like 'consistent gets', 'physical reads', 'recursive calls '? Or is it calculated from views like v$sysstat, etc.?

    Requires Free Membership to View

I've never seen the code that SQL*Plus uses when you turn autotracing on. My guess is that SQL*Plus is querying from V$SESSTAT. I arrive at this guess since before you can set autotrace on, you must first run the $ORACLE_HOME/sqlplus/admin/plustrce.sql script. And this script grants SELECT privs on this view.

For More Information

This was first published in August 2002

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: