Oracle internals, debugging and undocumented features

Getting Oracle stack using Oradebug short_stack

To collect stack traces for debugging I normaly use on OS debuggers like (pstacke, gdb, dbx – it depends on which platform Oracle runs ) .From Oracle I would run oradebug commands

dump errorstack

or    oradebug short_stack command.Today I will focus on oradebug short_stack

This is very  fast way to obtain a stack.Some of the OS debuggers tend to be slower.
sqlplus / as as sysdba
oradebug setospid ospid
( ospid  is the OS process id of the related process)
oradebug short_stack

e.g. stack for SMON process

SQL> oradebug short_stack

and output is right there.No need to look trace files.If you need to record everything you can run

oradebug direct_access enable trace

oradebug tracefile_name

now I will get stack for the same process using pstack command

pstack 18632

     0x0000000007793787 in sskgpwwait ()
     0x0000000007792339 in skgpwwait ()
     0x000000000749ceb2 in ksliwat ()
     0x000000000749c49c in kslwait ()
     0x0000000000ac0988 in ktmmon ()
     0x0000000000ac06b1 in ktmSmonMain ()
     0x000000000141ad85 in ksbrdp ()
     0x0000000001552c8d in opirip ()
     0x0000000000e3b186 in opidrv ()
     0x00000000011e2342 in sou2o ()
     0x00000000009556e5 in opimai_real ()
     0x00000000011e6279 in ssthrdmain ()
     0x000000000095558f in main ()

More information about these functions can be found on my previous blog Analysis of Oracle Call  Stack


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: