Getting trace reports of PL/SQL programs and SQL statements (tkprof)

As sys user

Create a user

2 Roles for OMER

6 System Privileges for OMER

 Tablespace Quota for OMER

Connecting as user Omer

Creating a table

Running the script whose trace report will be taken

The orcl_ora_14912_EXAMPLE.trc trace file is created in /u01/app/oracle/admin/orcl/udump.
To make the trace file readable

Creating the trace report by creating a procedure

Running the procedure

Getting a Trace report on a Session basis

Running a query

For a different session

Start the trace using the SID and SERIAL# values as shown in the following lines

DISPLAY_CURSOR shows the execution plans within memory.
DISPLAY_AWR shows the execution plans even if they aren’t in memory (by default shows the last 8 days, can be changed in + or - increments of days)
trcsess can be used to separate the session that is searched for within the trace file. Use tkprof to change the file into a readable state.

The service name can be filtered according to the module (program) name.

Note: session = sid.serial#

EXPLAIN PLAN

The following 2 lines can be used as an alternative to the SELECT statement above

Kategori seçin...