An error stack describes the current state of a process. It includes the current SQL statement and the process state for the process.
Oracle recommends taking an error stack dump to diagnose:
Error stack dumps can also be triggered by an error
To dump an error stack use:
ALTER SESSION SET EVENTS 'immediate trace name errorstack level level';
where level is one of the following:
Level | Description |
0 | Error stack only |
1 | Error stack and function call stack |
2 | As level 1 plus the process state |
3 | As level 2 plus the context area |
The following ORADEBUG command has the same effect:
ORADEBUG DUMP ERRORSTACK level
An alternative syntax for the same command is:
ORADEBUG EVENT IMMEDIATE TRACE NAME ERRORSTACK level
To dump a level 3 errorstack when a ORA-00942 (table or view does not exist) error is raised use:
ALTER SESSION SET EVENTS '942 trace name errorstack level 3';
A conditional errorstack dump can also be specified without a level e.g.
ALTER SESSION SET EVENTS '604 trace name errorstack';
Alternatively a conditional errorstack dump can be specified in the init.ora file
event = "942 trace name errorstack level 3"
Errorstacks can also be dumped conditionally using ORADEBUG:
ORADEBUG EVENT 942 TRACE NAME ERRORSTACK LEVEL 3
A level 3 errorstack contains the following sections