Thursday, June 12, 2008

ERRORSTACK- Oracle Debugging Event

Errorstack is used as debugging event for following reasons
To extract Failing SQL statement

To get Oracle Function call (to be used by Oracle) for interpreting cause for the error (e.g ORA 4030, ORA- 4031). It is also used in case of database hang scenarios. Refer to my earlier article on database hang

It also contains execution plan in some cases which can be used to diagnose ORA - 1652 errors (Excessive temp usage)

Errorstack can be set at System level and also at Session level.
e.g To set errorstack for ORA - 1652 ,Syntax will be

alter system set events ‘1652 trace name errorstack level 3′;
If suppose, you want to set it at session level, then

alter session set events ‘1652 trace name errorstack level 3′;

You can also use oradebug to take errorstack for particular process (say ospid 1234) as below
sqlplus “/ as sysdba”
oradebug setospid 1234
oradebug unlimit
oradebug dump errorstack 3

No comments: