0% found this document useful (0 votes)
260 views

ORADEBUG

The oradebug utility is used by Oracle support to troubleshoot database issues. It allows viewing the internal database processes and structures. Key functions include enabling SQL tracing, suspending processes, dumping shared memory and process statistics. Commands like setmypid, hanganalyze, procstat, and dump systemstate provide debugging information on sessions, hangs, process resources, and overall system state.

Uploaded by

raviranchi02
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
260 views

ORADEBUG

The oradebug utility is used by Oracle support to troubleshoot database issues. It allows viewing the internal database processes and structures. Key functions include enabling SQL tracing, suspending processes, dumping shared memory and process statistics. Commands like setmypid, hanganalyze, procstat, and dump systemstate provide debugging information on sessions, hangs, process resources, and overall system state.

Uploaded by

raviranchi02
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 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