Tracing LMS processes using DBMS_SYSTEM.set_ev

Tracing LMS processes ( or any other RAC background process )  using DBMS_SYSTEM.set_ev

Select sid, serial#  process from  gv$session    
SQL>  select inst_id,sid, serial#, program from gv$session where program like '%LMS%' and INST_ID=3;
   INST_ID        SID    SERIAL# PROGRAM
---------- ---------- ---------- ------------------------------------------------
         3         66          1 oracle@grac43.example.com (LMS0)
         3        128          1 oracle@grac43.example.com (LMS1)

Connect to instance 3 and enable tracing for LMS0 and LMS1 process 
SQL> EXEC DBMS_SYSTEM.set_ev(si=>66 ,se=>1,  ev=>10046, le=>12,  nm=>'');
SQL> EXEC DBMS_SYSTEM.set_ev(si=>128  ,se=>1,  ev=>10046, le=>12,  nm=>'');

Check for tracefile grac43_lms0_XXX and grac43_lms1_XXX in your trace directory and 
display wait events by suppressing  "gcs remote message" messages
# cat grac43_lms0_7493.trc | grep -v "gcs remote message"
*** 2014-02-11 10:15:08.807
WAIT #0: nam='gcs log flush sync' ela= 2722 waittime=30 poll=0 event=138 obj#=0 tim=1392110108814702

Disable tracing:
EXEC DBMS_SYSTEM.set_ev(si=>66   ,se=>1,  ev=>10046, le=>0,  nm=>'');
EXEC DBMS_SYSTEM.set_ev(si=>128  ,se=>1,  ev=>10046, le=>0,  nm=>'');

Leave a Reply

Your email address will not be published. Required fields are marked *