Muhammad Nadeem Chaudhry's Blog


How To Get Execution Statistics Reports on Query Statements?

Posted in Uncategorized by Muhammad Nadeem Chaudhry on March 24, 2011

If your user account has autotrace configured by the DBA, you can use the “SET AUTOTRACE ON STATISTICS” command to turn on execution statistics reports on query statements. The tutorial exercise bellow shows you a good example:

SQL> CONNECT {USERNAME}/{PASSWORD}
SQL> SET AUTOTRACE ON STATISTICS
SQL> SELECT E.LAST_NAME, E.SALARY, J.JOB_TITLE
  2  FROM EMPLOYEES E, JOBS J
  3  WHERE E.JOB_ID=J.JOB_ID AND E.SALARY>12000;

Statistics
———————————————————-
          0  recursive calls
          0  db block gets
         16  consistent gets
          0  physical reads
          0  redo size
        720  bytes sent via SQL*Net to client
        384  bytes received via SQL*Net from client
          2  SQL*Net roundtrips to/from client
          0  sorts (memory)
          0  sorts (disk)
          6  rows processed

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s


%d bloggers like this: