How to generate systemdump when the instance is hung?

Using oradebug one can analyze if an instance is hung $ sqlplus “/as sysdba” SQL> oradebug mysetpid Statement processed. — no limit on trace file SQL> oradebug unlimit Statement processed. SQL> oradebug hanganalyze 3 Hang Analysis in /u01/oradata/admin/TEST/udump/test_ora_11852.trc — Wait for couple of minutes SQL> oradebug hanganalyze 3 Hang Analysis in /u01/oradata/admin/TEST/udump/test_ora_11852.trc — Wait for…

Using oradebug to dump call stack?

Using “oradebug dump errorstack <dump level>” one can dump the call stack of the process after attaching to a running session. There are 3 values that can be passed as dump level 0 – dump error buffer 1 – level 0 with call stack 2 – level 1 with process state 3 – level 2…

How to find/list the events set in a session?

Using “oradebug dump events 1” one can find/list events set in a session. For example: In a session events 10046 and 1410 events are set SQL> ALTER SESSION SET EVENTS='10046 trace name context forever, level 12'; Session altered. SQL> ALTER SESSION SET EVENTS='1410 trace name context forever, level 12'; Session altered. SQL> SELECT distinct sid…

How to suspend/resume a process using oradebug?

Suspend a running process SQL> oradebug setorapid 12 Unix process pid: 10932, image: oracle@localhost.localdomain (TNS V1-V3) SQL> oradebug suspend Statement processed. Resume a process SQL> oradebug resume Statement processed. If you have trace turned on a suspended and resume session you will see the following messages in the trace file. FETCH #5:c=54992,e=55962,p=0,cr=2334,cu=0,mis=0,r=1,dep=1,og=1,tim=1249098751175228 EXEC #5:c=0,e=72,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=1,tim=1249098751175408 Received…

Using oradebug to set event

The following example shows how to set event on a oracle session To turn on event, needs to be run as sysdba SQL> connect /as sysdba – attach to session by OS process id SQL> oradebug setospid 5243378; Oracle pid: 68, Unix process pid: 5243378, image: oracle@hostname (TNS V1-V3) – sets maximum dump file size…

How to find the trace file name?

To find the trace file one using oradebug one can find it using the example below: SQL> oradebug mysetpid Statement processed. SQL> oradebug tracefile_name /u01/oradata/admin/TEST/udump/test_ora_9964.trc If you try to run the above command without attaching to a session it will return ORA-00074 SQL> oradebug tracefile_name ORA-00074: no process has been specified