Home >> FAQs/Tutorials >> Oracle Tutorials

Oracle Tutorials - Show Execution Statistics Reports

By: FYIcenter.com

(Continued from previous topic...)

How To Get Execution Statistics Reports on Query Statements?

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 HR/retneciyf

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;

LAST_NAME             SALARY JOB_TITLE
----------------- ---------- -----------------------------
King                   24000 President
Kochhar                17000 Administration Vice President
De Haan                17000 Administration Vice President
Russell                14000 Sales Manager
Partners               13500 Sales Manager
Hartstein              13000 Marketing Manager

6 rows selected.

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

  1. What Is SQL*Plus?
  2. How To Start the Command-Line SQL*Plus?
  3. How To Get Help at the SQL Prompt?
  4. What Information Is Needed to Connect SQL*Plus an Oracle Server?
  5. What Is a Connect Identifier?
  6. How To Connect a SQL*Plus Session to an Oracle Server?
  7. What Happens If You Use a Wrong Connect Identifier?
  8. What To Do If DBA Lost the SYSTEM Password?
  9. What Types of Commands Can Be Executed in SQL*Plus?
  10. How To Run SQL Commands in SQL*Plus?
  11. How To Run PL/SQL Statements in SQL*Plus?
  12. How To Change SQL*Plus System Settings?
  13. How To Look at the Current SQL*Plus System Settings?
  14. What Are SQL*Plus Environment Variables?
  15. How To Generate Query Output in HTML Format?
  16. What Is Output Spooling in SQL*Plus?
  17. How To Save Query Output to a Local File?
  18. What Is Input Buffer in SQL*Plus?
  19. How To Revise and Re-Run the Last SQL Command?
  20. How Run SQL*Plus Commands That Are Stored in a Local File?
  21. How To Use SQL*Plus Built-in Timers?
  22. What Is Oracle Server Autotrace?
  23. How To Set Up Autotrace for a User Account?
  24. How To Get Execution Path Reports on Query Statements?
  25. How To Get Execution Statistics Reports on Query Statements?

Oracle Tutorials:

More...


Other Tutorials/FAQs:

More...


Related Resources:

More...


Selected Jobs:

More...