Trace Current Oracle Session – Different Methods

advertisements

_____________________________________________________________________________________________________________________

The Eucharistic Miracles of the World
Method 1. 
Using alter session command

ALTER SESSION SET sql_trace=TRUE;
ALTER SESSION SET sql_trace=FALSE;

Example

SQL> ALTER SESSION SET sql_trace=TRUE;
 
Session altered.
 
SQL> ALTER SESSION SET sql_trace=FALSE;
 
Session altered.

advertisements
 
Method 2. 
Using DBMS_SESSION package

EXEC DBMS_SESSION.set_sql_trace(sql_trace => TRUE);
EXEC DBMS_SESSION.set_sql_trace(sql_trace => FALSE);
 
SQL> EXEC DBMS_SESSION.set_sql_trace(sql_trace => TRUE);
 
PL/SQL procedure successfully completed.
 
SQL> EXEC DBMS_SESSION.set_sql_trace(sql_trace => FALSE);
 
PL/SQL procedure successfully completed.

Method 3. 
Using Alter session set events command

ALTER SESSION SET EVENTS '10046 trace name context forever, level 8';
ALTER SESSION SET EVENTS '10046 trace name context off';
 
SQL> ALTER SESSION SET EVENTS '10046 trace name context forever, level 8';
 
Session altered.
 
SQL> ALTER SESSION SET EVENTS '10046 trace name context off';
 
Session altered.

_____________________________________________________________________________________________________________________

Website Stats

0 comments:

Post a Comment

Labels

Oracle (629) Script (86) General (77) Unix (47) Blog (23) Technology (19) gadget (6) games (6) Business (3) OCI (3) SQL* Loader (3) Datapump (2)
 

acehints.com Copyright 2011-23 All Rights Reserved | Site Map | Contact | Disclaimer