How to generate trace from Different Session ?
Detailed Steps to enable trace from different session
------------------------------------------------------
1. In SQL*Plus: connect with a DBA account and query all the sessions:
.
SQL> select username, sid, serial# from v$session where
username=<User_name>;
.
USERNAME SID SERIAL#
--------------------------------------------------------
OWB_DESIGN_REP 14 13202
OWB_DESIGN_REP 15 4665
.
2. In SQL*Plus: When you know the SID and the SERIAL#, you can enable the
trace for EACH session running command:
.
EXECUTE DBMS_SYSTEM.SET_SQL_TRACE_IN_SESSION(<SID>, <SERIAL#>, TRUE)
.
So in this example you would need to do following:
.
SQL> EXECUTE DBMS_SYSTEM.SET_SQL_TRACE_IN_SESSION(14, 13202, TRUE)
SQL> EXECUTE DBMS_SYSTEM.SET_SQL_TRACE_IN_SESSION(15, 4665, TRUE)
------------------------------------------------------
1. In SQL*Plus: connect with a DBA account and query all the sessions:
.
SQL> select username, sid, serial# from v$session where
username=<User_name>;
.
USERNAME SID SERIAL#
--------------------------------------------------------
OWB_DESIGN_REP 14 13202
OWB_DESIGN_REP 15 4665
.
2. In SQL*Plus: When you know the SID and the SERIAL#, you can enable the
trace for EACH session running command:
.
EXECUTE DBMS_SYSTEM.SET_SQL_TRACE_IN_SESSION(<SID>, <SERIAL#>, TRUE)
.
So in this example you would need to do following:
.
SQL> EXECUTE DBMS_SYSTEM.SET_SQL_TRACE_IN_SESSION(14, 13202, TRUE)
SQL> EXECUTE DBMS_SYSTEM.SET_SQL_TRACE_IN_SESSION(15, 4665, TRUE)
0