Where is autotrace getting stats?

I am getting following statistics after setting the autotrace on for a query.
          Statistics
           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

Join the conversationComment

Share
Comments

    Results

    Contribute to the conversation

    All fields are required. Comments will appear at the bottom of the article.