Error Stack
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
what the process is doing
a problem identified by a systemstate dump
processes looping or hanging
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 ORA-00942 (table or view does not exist) 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
Call Stack Trace
Files Currently Opened
Process State
Pinned Buffer History
Cursor Dump
Fixed PGA
Fixed SGA
Fixed UGA
In memory trace dump
http://askdba.org/weblog/2008/04/errorstack-oracle-debugging-event/
跟蹤oracle特定報錯
errorstack
======================
不知道是由那個session觸發的錯誤的前提下,發現是什麼造成的這個錯誤
可以使用errorstack來跟蹤
啟動跟蹤:
例如,我不知道什麼時候那個sid會發生920錯誤。
alter system set events '920 trace name errorstack level 3';
:
errorstack有4個級別:
0:只轉存錯誤堆疊資訊(逐漸被廢棄)
1:轉儲錯誤堆疊和函式呼叫堆疊
2:level 1+processstate
3:level 2+context area(顯示所有cursor,著重當前cursor)
開啟後會生成相應的trace檔案,在udump中
也可以通過指令碼獲取trace名,指令碼內容如下:
select
d.value||'/'||lower(rtrim(i.instance, chr(0)))||'_ora_'||p.spid||'.trc' trace_file_name
from
( select p.spid
from sys.v$mystat m,sys.v$session s,sys.v$process p
where m.statistic# = 1 and s.sid = m.sid and p.addr = s.paddr) p,
( select t.instance from sys.v$thread t,sys.v$parameter v
where v.name = 'thread' and (v.value = 0 or t.thread# = to_number(v.value))) i,
( select value from sys.v$parameter where name = 'user_dump_dest') d
/
TRACE_FILE_NAME
----------------------------------------------------------------------------------------------------
/u01/admin/bkdb/udump/bkdb_ora_30844.trc
分析trace檔案中有用資訊就可以進一步分析出現問題的原因
SELECT partno, sno, wono, stockdt
FROM stock2 a,stock3 b
WHERE a.partno = b.partno(+) and a.sno = b.sno(+) and a.wono = b.wono(+) and b.partno is null and b,sno is null and b.wono is null;
WHERE a.partno = b.partno(+) and a.sno = b.sno(+) and a.wono = b.wono(+) and b.partno is null and b,sno is null and b.wono is null
*
ERROR at line 3:
ORA-00920: invalid relational operator
關閉跟蹤
alter system set events '920 trace name errorstack off';
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/13750068/viewspace-696624/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 使用error stack診斷特定錯誤資訊Error
- 使用Error Stack跟蹤Oracle錯誤堆疊資訊ErrorOracle
- 使用error stack 抓取儲存過程的當前SQLError儲存過程SQL
- STACK!
- java Stack總結Java
- Docker Stack 筆記Docker筆記
- Elastic Stack 簡介AST
- C++ STL stackC++
- Java之Stack --- 棧Java
- C++ Templates (2.2 使用Stack類别範本 Use of Class Template Stack )C++
- LeetCode Min StackLeetCode
- Elastic stack(基於7.0.0)AST
- np.stack函式函式
- Elastic Stack基礎概念AST
- ORAchk Health Checks for the Oracle StackOracle
- C# Queue Stack SortedListC#
- C#堆疊(Stack)C#
- C++ Templates (2.1 類别範本Stack的實現 Implementation of Class Template Stack)C++
- 06 . ELK Stack + kafka叢集Kafka
- Where the top of the stack is on x86
- postprocessing stack v2
- Leetcode-Min StackLeetCode
- [CareerCup] 3.6 Sort Stack 棧排序排序
- Heap和Stack的區別
- The Stack and the Heap棧與堆__RustRust
- Pandas 基礎 (12) - Stack 和 Unstack
- C++【stack/queue】用法和例子C++
- Java集合Stack原始碼深入解析Java原始碼
- js資料結構--棧(stack)JS資料結構
- C++初階(stack+queue)C++
- 什麼是 SAP Support Package StackPackage
- [譯]Stack View 自定義間隙View
- Elasticsearch 5.0和ELK/Elastic Stack指南Elasticsearch
- C++ STL學習之stack。C++
- 鴻蒙HarmonyOS實戰-ArkUI元件(Stack)鴻蒙UI元件
- ATX 報錯-32001 Jsonrpc error: <java.lang.StackOverflowError> data: java.lang.StackOverflowError: stack size 1041KBJSONRPCErrorJava
- Flutter控制元件--Row、Column和StackFlutter控制元件
- Oracle 21C Clusterware Technology StackOracle