You are on page 1of 15

ORADEBUG

Oracleutilitycalledoradebug.Thistoolisprimarilyusedby
OracleworldwidecustomersupportWithoradebugutilityyoucan
literallyseethedatabaseengine.Theoradebugisespeciallyuseful
whenthingsgoverybad.e.g.thedatabasejuststops,hangs,orthe
databasekeepscrashingwiththeORA0600error.

Purpose of oradebug utility


Amongthemanyusefulthingsthatcanbedonewithoradebugare:
1.enabling/disablingtheSQLtracingforanotheruser'ssession.
2.suspendingintensiveprocesses
3.findinginformationaboutsharedmemoryandsemaphores
4.closingthetracefilesothatnewonecanbegenerated
5.manipulatinganddumpinginternalstructures
5.wakeupprocessesetc.

Oradebug Commands
HerearetheListofthevariouscommandoftheoradebugutility.

oradebughelp
oradebughelpwilllistalldebugcommands.

Oradebug Commands
continue

Oradebugsetmypid
(DebugCurrentProcess)

Oradebugsetospid
(SetOSprocessidofprocesstodebug.)
selectspid,pidfromv$processwhereaddr=(selectpaddrfrom
v$sessionwheresid=<yourSID>);
SQL>oradebugsetospid19592
Oraclepid:18,Unixprocesspid:19592,image:oracle@apollo(TNS
V1V3)

Oradebug hanganalyze
oradebughanganalyze(Analyzesystemhang)
Thereareseveralleveldefined.
Dump
LevelDumpContains
12OnlyHANGANALYZEoutput,noprocessdumpatall
3Level2+Dumponlyprocessesthoughttobeinahang(IN_HANG
state)
4Level3+Dumpleafnodes(blockers)inwaitchains
(LEAF,LEAF_NW,IGN_DMP
state)
5Level4+Dumpallprocessesinvolvedinwaitchains(NLEAF
state)
10Dumpallprocesses(IGNstate)

Oradebug hanganalyze
Toperformclusterwide(RAC)HANGANALYZEusethefollowingsyntax:
ORADEBUGsetmypid
ORADEBUGsetinstall
ORADEBUGgdefhanganalyze<level>

Oradebug Continue
oradebugunlimit
Removethefilesizelimit.Usefulwhenneedtracefilelargerthen
sizespecifiedbymax_dump_sizeparameter.
SyntaxParameter
oradebugunlimit
oradebugprocstat(DumpprocessStatistics)
oradebugprocstat<ospid><ospid>OSPID
Example
DumpstatisticsfortheDBWRbackgroundprocess:
selectpid,name
fromv$processp,v$bgprocessb
whereb.paddr=p.addr
PIDNAME

2PMON
3DBW0
4LGWR

Oradebug Continue
SQL>oradebugsetorapid3
Unixprocesspid:15668,image:oracle@apollo(DBW0)
SQL>oradebugprocstat
Statementprocessed.
Tofindoutwhereisthetracefilelocatedrun:
SQL>oradebugtracefile_name
/oramain/app/oracle/admin/test/bdump/test_dbw0_15668.trc
DumpsofStateObjects
oradebugdumpsystemstate
Dumpofal
SQL>oradebugsetmypid
Statementprocessed.
SQL>oradebugunlimit
Statementprocessed.
SQL>oradebugsetinstall
Statementprocessed.
SQL>oradebuggdefdumpsystemstate10

Purpose of oradebug utility


Amongthemanyusefulthingsthatcanbedonewithoradebugare:
1.enabling/disablingtheSQLtracingforanotheruser'ssession.
2.suspendingintensiveprocesses
3.findinginformationaboutsharedmemoryandsemaphores
4.closingthetracefilesothatnewonecanbegenerated
5.manipulatinganddumpinginternalstructures
5.wakeupprocessesetc.

System /Process state


Dumps

You might also like