The TKPROF utility uses a trace file as its raw material. Trace files are created for
individual sessions. You can start collecting a trace file either by running the target
application with a switch (if it??™s written with an Oracle product such as Developer)
or by explicitly turning it on with an EXEC SQL call or an ALTER SESSION SQL
statement in an application written with a 3GL. The trace process, as youcan probably
guess, can significantly affect the performance of an application, so you should
turn it on only when you have some specific diagnostic work to do.
Figure 4-5. Results of a simple EXPLAIN PLAN statement in SQL*Plus
SQL> EXPLAIN PLAN FOR
2 SELECT DNAME, ENAME FROM EMP, DEPT
3 WHERE EMP.DEPTNO = DEPT.DEPTNO
4 ORDER BY DNAME;
Explained.
SQL> SELECT OBJECT_NAME, OPERATION, OPTIONS FROM PLAN_TABLE ORDER BY ID;
OBJECT_NAME OPERATION OPTIONS
------------------------------ ------------------------------ --------------------------
SELECT STATEMENT
SORT ORDER BY
NESTED LOOPS
EMP TABLE ACCESS FULL
DEPT TABLE ACCESS BY INDEX ROWID
SYS_C004911 INDEX UNIQUE SCAN
6 rows selected.
Pages:
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279