oradebug

Select Process

oradebug setmypid

oradebug setospid pid

oradebug setorapid pid

selects the current process as the ORADEBUG process

selects the specified OS process

selects the specified Oracle process

Tracefile Management

oradebug unlimit

oradebug tracefile_name

remove size limit of the trace file (redundant after 8.1.6)

returns name and path of tracefile

Process Management

oradebug suspend

oradebug resume

suspends selected process (don't use with setmypid)

reumes selected process

You can achieve the same using OS level commands...

Linux...

kill -sigstop $SPID

kill -sigcont $SPID

suspends selected process

reumes selected process

AIX...

kill -17 $SPID

kill -19 $SPID

suspends selected process

reumes selected process

Note that signal numbers are different across operating systems... always check with...kill -l

Hanganlayze

oradebug hanganalyze 3

Waiting a meaningful amount of time and the repeating the hanganlayze can sometimes be useful to help eliminate false positives.
“Hanganalyze tries to work out who is waiting for who by building wait chains, and then depending on the level will request various processes to dump their errorstack.” Oracle
The most common hanganalyze level used is 3, which dumps only process that Oracle thinks are hanging. Lower values (1,2) provide less information.Higher values (4,5,6,10) provide more information. Level 10 dumps all processes. Obviously this may not be a good idea.

Dump

oradebug dumplist

oradebug dump systemstate 266

oradebug dump ashdumpseconds 30

list of possible dumpnames

level 266 dump of systemstate

dump latest 30 seconds of ASH data (needs Diagnostic Pack license!)

Trace

Example...

oradebug session_event 10046 trace name context forever, level 12

Bibliography

http://www.juliandyke.com/Diagnostics/Tools/ORADEBUG/ORADEBUG.phphttps://www.dbi-services.com/blog/oracle-suspendingresuming-an-oracle-pid-with-oradebug-suspendresume-or-the-os-kill-command/
hanganalyzehttps://www.dbi-services.com/blog/oracle-is-hanging-dont-forget-hanganalyze-and-systemstate/https://grepora.com/2016/12/14/hanganalyze-part-1/https://grepora.com/2016/12/21/hanganalyze-part-2/
systemstatehttps://grepora.com/2017/01/04/systemstate-dump/
https://support.oracle.comTroubleshooting Database Hang Issues (Doc ID 1378583.1)How to Collect Diagnostics for Database Hanging Issues (Doc ID 452358.1)Troubleshooting Database Contention With V$Wait_Chains (Doc ID 1428210.1)EVENT: HANGANALYZE – Reference Note (Doc ID 130874.1)Important Customer information about using Numeric Events (Doc ID 75713.1)Reading and Understanding Systemstate Dumps (Doc ID 423153.1)