Tkprof Log
Tkprof Log
Tkprof Log
Session altered.
Session altered.
$ cd /u01/app/oracle/admin/DEV/udump/
$
The contents of the translated file are displayed below.
********************************************************************************
count = number of times OCI procedure was executed
cpu = cpu time in seconds executing
elapsed = elapsed time in seconds executing
disk = number of physical reads of buffers from disk
query = number of buffers gotten for consistent read
current = number of buffers gotten in current mode (usually for update)
rows = number of rows processed by the fetch or execute call
********************************************************************************
ALTER SESSION SET EVENTS '10046 trace name context forever, level 8'
********************************************************************************
SELECT COUNT(*)
FROM
SQL_TRACE_TEST
********************************************************************************
COMMIT
1 session in tracefile.
8 user SQL statements in trace file.
7 internal SQL statements in trace file.
15 SQL statements in trace file.
15 unique SQL statements in trace file.
2 SQL statements EXPLAINed using schema:
sys.plan_table
Schema was specified.
Existing table was used.
146 lines in trace file.
22 elapsed seconds in trace file.
For each statement executed by the session, the file contains a record of the
parse, execute and fetch statistics, an execution plan where necessary and a list
of session waits.
===================================================================================
==========================================
Example:2
This example uses SQL Trace and the TKPROF utility to find parse information. You
log in to the database with administrator privileges, and then query the directory
location of the trace files (sample output included):
SELECT value
FROM v$diag_info
WHERE name = 'Default Trace File';
VALUE
--------------------------------------------------------------------------------
/disk1/oracle/log/diag/rdbms/orcl/orcl/trace/orcl_ora_23054.trc
You enable tracing, use the TRACEFILE_IDENTIFIER initialization parameter to give
the trace file a meaningful name, and then query hr.employees:
% ls *emp_stmt.trc
orcl_ora_17950_emp_stmt.trc
Use TKPROF to format the trace file, and then open the formatted file:
SELECT *
FROM
hr.employees
SELECT *
FROM
hr.employees