1)ALTER SESSION SET EVENTS ’10046 TRACE NAME CONTEXT FOREVER,LEVEL 12′;
2)DBMS_SYSTEM.SET_SQL_TRACE_IN_SESSION(SID, SERIAL#, TRUE);
DBMS_SYSTEM.SET_SQL_TRACE_IN_SESSION(SID, SERIAL#, FALSE);
3)DBMS_SUPPORT.START_TRACE_IN_SESSION(SID, SERIAL#, WAITS, BINDS);
SQL> @?/rdbms/admin/dbmssupp.sql
4)DBMS_MONITOR.SESSION_TRACE_ENABLE(SESSION_ID, SERIAL_NUM,BINDS,WAITS);
5)how to find the trace file location using sql query?
select
u_dump.value || '/' ||
db_name.value || '_ora_' ||
v$process.spid ||
nvl2(v$process.traceid, '_' || v$process.traceid, null )||'.trc' "Trace File"
from
v$parameter u_dump
cross join
v$parameter db_name
cross join
v$process
join
v$session
on
v$process.addr = v$session.paddr
where
u_dump.name = 'user_dump_dest'
and
db_name.name = 'db_name'
and
v$session.audsid=sys_context('userenv','sessionid');
6) convert the trace files to human readble format using tkprof
trprof source_file target_file
2)DBMS_SYSTEM.SET_SQL_TRACE_IN_SESSION(SID, SERIAL#, TRUE);
DBMS_SYSTEM.SET_SQL_TRACE_IN_SESSION(SID, SERIAL#, FALSE);
3)DBMS_SUPPORT.START_TRACE_IN_SESSION(SID, SERIAL#, WAITS, BINDS);
SQL> @?/rdbms/admin/dbmssupp.sql
4)DBMS_MONITOR.SESSION_TRACE_ENABLE(SESSION_ID, SERIAL_NUM,BINDS,WAITS);
5)how to find the trace file location using sql query?
select
u_dump.value || '/' ||
db_name.value || '_ora_' ||
v$process.spid ||
nvl2(v$process.traceid, '_' || v$process.traceid, null )||'.trc' "Trace File"
from
v$parameter u_dump
cross join
v$parameter db_name
cross join
v$process
join
v$session
on
v$process.addr = v$session.paddr
where
u_dump.name = 'user_dump_dest'
and
db_name.name = 'db_name'
and
v$session.audsid=sys_context('userenv','sessionid');
6) convert the trace files to human readble format using tkprof
trprof source_file target_file
No comments:
Post a Comment