Use of oradebug (practical part) (in continuous update)

Time:2020-2-13

Trace a session

For example, if I want to track a session, I need to obtain the SID, serial ID, and SPID of the session first

SELECT a.username,
  a.sid ,
  a.serial#,
  b.spid
FROM v$session a,
  v$process b
WHERE a.paddr=b.addr
and a.sid = 285
;

USERNAME                              SID    SERIAL# SPID
------------------------------ ---------- ---------- ------------------------
APPS                                  285      44645 30468

Then use oradebug to set the event on the target session, trace, and get the name of trace file

SQL > oradebug setospid 30468 -- process SPID

SQL> oradebug event 10046 trace name context forever,level 12

SQL> oradebug event 10046 trace name context off

SQL> oradebug TRACEFILE_NAME

/u01/VIS02/db/tech_st/11.1.0/admin/VIS02_vs011/diag/rdbms/vis02/VIS02/trace/VIS02_ora_30468.trc

Recommended Today

1500 lines of typescript code to implement the component keep alive in react

The essence of modern frameworkDomOperation, I like a sentence today. Don’t set limits for yourself. In the end, most of the technical essence is the same. For example, the back endKafka, redis, SQL transaction writing, nginxLoad balancing algorithm,diffAlgorithmGRPC,Pb protocolThe serialization and deserialization, locks, etc. of can be similar to a large number of reuse logic […]