Get the App
SLTechnology News&Howtos  ›  Database  › 

Use ErrorStack for error tracking and diagnosis!

Shulou Source: shulou.com Published: 2022-06-01 06:59:11 09月10日 Update

In the process of using oracle database, you may encounter a variety of errors or exceptions, and many exception prompts are not specific, so it is necessary to understand the ErrorStack tracking method of oracle. ErrorStack is a method provided by oracle to trace the error stack. By setting the trace, some error background information can be dumped in detail and written into the trace file, which is very effective for error research and diagnosis. There are four main levels for setting up ErrorStack:

0 only dumps the error stack (level 0 has been gradually discarded)

1 dump error stack and function call stack

2 level 1+ProcessState

3 level 2+Context area (show all cursors, highlight current cursor)

Usage:

Start tracking: alter system set events' trace name errorstack forever,level'

End tracking: alter system set events' trace name errorstack off'

First simulate an error:

SQL > create table T3 (id number,name varchar2 (10))

The table has been created.

SQL > insert into T3 values (1pm a)

Insert into T3 values (1)

*

An error occurred on line 1:

ORA-00984: listed here is not allowed

Follow up on this error:

SQL > alter system set events' 984 trace name errorstack forever,level 3'

The system has changed.

SQL > insert into T3 values (1pm a)

Insert into T3 values (1)

*

An error occurred on line 1:

ORA-00984: listed here is not allowed

SQL > alter system set events' 984 trace name errorstack off'

The system has changed.

You can see the following information in the alert_orcl.log file:

Sun Dec 18 21:08:13 2011

OS Pid: 4058 executed alter system set events' 984 trace name errorstack forever,level 3'

Errors in file / u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_4058.trc:

ORA-00984: listed here is not allowed

Sun Dec 18 21:08:49 2011

Trace dumping is performing id= [cdmp _ 20111218210849]

Sun Dec 18 21:09:20 2011

OS Pid: 4058 executed alter system set events' 984 trace name errorstack off'

Intercept a piece of error message from the trace file:

DbkedDefDump (): Starting a non-incident diagnostic dump (flags=0x0, level=3, mask=0x0)

-Error Stack Dump-

ORA-00984: listed here is not allowed

-Current SQL Statement for this session (sql_id=9b8cruw3gwdxx)-

Insert into T3 values (1)

* 2011-12-18 21 purl 08 purl 22.550

-Call Stack Trace-

Calling call entry argument values in hex

Location type point (? Means dubious value)

Tags: Error trace stack information file system valid detailed necessary function various background data database method method level process prompt research Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Shulou Information Huawei Apple Shulou Tech Info