Wednesday, July 29, 2009

Tracing own session

To trace your own session follow the steps below,

Step 1: Set the init parameters

SQL> Alter session set TIMED_STATISTICS = TRUE;
SQL> Alter session set MAX_DUMP_SIZE = UNLIMITED;
SQL> Alter session set TRACEFILE_IDENTIFIER = ‘mytrace’;

Timed_statistics – Allows tracing to occur on the system.
Max_dump_size – Maximum size of the trace file in OS level blocks.
Tracefile_identifier - To identify the trace file generated for a particular session in the udump.

Step 2: Enable the tracing

SQL> Alter session set SQL_TRACE='TRUE';

or in 10g

SQL> Execute DBMS_MONITOR.SESSION_TRACE_ENABLE(NULL,NULL, TRUE, TRUE);

Note: In Oracle 10g SQL_TRACE parameter has been deprecated.

Step 3: Disable the Tracing

SQL> Alter session set SQL_TRACE= False;
Or
SQL> Execute DBMS_MONITOR.SESSION_TRACE_DISABLE;
Or
SQL> Exit;

Thanks

1 comment:

sap support pack said...

This post tells how to trace your own. The steps given in this post to do so are very simple and easy. You just need to follow these steps then you will be able to trace your session. Try to implement these steps and see the result. This is new thing that I learned.

Followers

Powered By Blogger
 

Oracle Database Administration. Copyright 2008 All Rights Reserved Revolution Two Church theme by Brian Gardner Converted into Blogger Template by Bloganol dot com