Start Session Trace:
To Enable the trace run the SQL query
SQL>ALTER SESSION SET sql_trace = true;
add an identifier to the trace file name for later identification:
SQL>ALTER SESSION SET tracefile_identifier = mysession_trace;
Get the SID and SERIAL# for the process you want to trace.
SQL>select sid, serial# from sys.v_$session where username like'SCOTT';
SID SERIAL#
---------- ----------
37 299
Now Enable the trace user level:
DBA's can use DBMS_SYSTEM.SET_SQL_TRACE_IN_SESSION to trace problematic database sessions.
Enable tracing for your selected process:
SQL> ALTER SYSTEM SET timed_statistics = true;
SQL> execute dbms_system.set_sql_trace_in_session(37, 299, true);
Ask user to run just the necessary to demonstrate his problem.
Disable tracing for your selected process:
SQL> execute dbms_system.set_sql_trace_in_session(37,299, false);
Now goto trace directory fin the trace file.
Cd /d01/DEV/11.2.0/admin/DEV_sreenidba1/diag/rdbms/dev/DEV/trace
Run tkprof command
DEV_ora_7881_MYSession_trace.trc
Run tkprof convert the trace file into text format
[sreenidba@sreenidba1 trace]$ tkprof DEV_ora_7881_mysession_TRACE.trc <Output Filename> explain=system/sys sort='(exeela, fchela)' sys=yes
To Enable the trace run the SQL query
SQL>ALTER SESSION SET sql_trace = true;
add an identifier to the trace file name for later identification:
SQL>ALTER SESSION SET tracefile_identifier = mysession_trace;
Get the SID and SERIAL# for the process you want to trace.
SQL>select sid, serial# from sys.v_$session where username like'SCOTT';
SID SERIAL#
---------- ----------
37 299
Now Enable the trace user level:
DBA's can use DBMS_SYSTEM.SET_SQL_TRACE_IN_SESSION to trace problematic database sessions.
Enable tracing for your selected process:
SQL> ALTER SYSTEM SET timed_statistics = true;
SQL> execute dbms_system.set_sql_trace_in_session(37, 299, true);
Ask user to run just the necessary to demonstrate his problem.
Disable tracing for your selected process:
SQL> execute dbms_system.set_sql_trace_in_session(37,299, false);
Now goto trace directory fin the trace file.
Cd /d01/DEV/11.2.0/admin/DEV_sreenidba1/diag/rdbms/dev/DEV/trace
Run tkprof command
DEV_ora_7881_MYSession_trace.trc
Run tkprof convert the trace file into text format
[sreenidba@sreenidba1 trace]$ tkprof DEV_ora_7881_mysession_TRACE.trc <Output Filename> explain=system/sys sort='(exeela, fchela)' sys=yes
No comments:
Post a Comment