Databases Reference
In-Depth Information
There's more...
We have seen how simple it is to trace SQL statements executed in our session.
However, if we want to set up tracing in a different session, we cannot use the
SQL_TRACE
parameter as shown in our example. We have to execute the procedure
SYS.DBMS_SYSTEM.
SET_SQL_TRACE_IN_SESSION
, giving the
SID
and
SERIAL#
of the session to be traced as
parameters to the procedure.
The
SID
and
SERIAL#
of the sessions can be queried from the
V$SESSION
dynamic
performance view, as shown in the following query:
SELECT
SID, SERIAL#, AUDSID, PADDR, USERNAME,
COMMAND, SERVER, OSUSER, PROCESS, MACHINE,
PORT, TERMINAL, PROGRAM
FROM V$SESSION
See also
F
In
Appendix A
,
Dynamic Performance Views
there is a summary of useful Dynamic
Performance Views used in the topic
F
Appendix B
,
A Summary of Oracle Packages Used for Performance Tuning
shows
Oracle Tools and Packages used for performance tuning