Answers

Question and Answer:

  Home  Oracle Database

⟩ How To Get Execution Path Reports on Query Statements?

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

SQL> CONNECT HR/retneclgg

SQL> SET AUTOTRACE ON EXPLAIN

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.

 197 views

More Questions for you: