ORACLE列出已經開啟的event set[ID 436036.1]
Applies to:
Oracle Server - Enterprise Edition - Version 8.0.3.0 and laterInformation in this document applies to any platform.
Goal
Oracle Internal Events, both named event (eg: ERRORSTACK) as numeric events (eg 10046) can be set at the session level. This document outlines how DataBase Administrators can verify which events have been set in a specific session or in the entire system.
Fix
This can be achieved through the ORADEBUG functionality. The exact syntax to use depends on the Oracle version you are using.
If you want to retrieve the events set in a specific session, then use the following oradebug commands to identify the session:
1. identify the session
SQL> select p.pid, p.spid, s.username
from v$process p, v$session s
where p.addr = s.paddr;
2. Attach to the desired session
SQL> connect / as sysdba
SQL> oradebug setorapid
- OR -
SQL> oradebug setospid
...
If you want to retrieve the events set in your current SESSION or at the SYSTEM level, you can use the following commands:
SQL> connect / as sysdba
SQL> oradebug setmypid
...
Oracle 8i / 9i
SQL> oradebug dump events
Level 1 - Dump session group's event settings
Level 2 - Dump process group's event settings
Level 4 - Dump system group's event settings (Ie the instance wide events)
Oracle 10g / 11g and above
SQL> oradebug eventdump
session - Dump session group's event settings
process - Dump process group's event settings
system - Dump system group's event settings(Ie the instance wide events)
Note: level needs to be specified in lowercase !
-- OR --
SQL> alter session set events 'immediate eventdump()';
SESSION - Dump session group's event settings
PROCESS - Dump process group's event settings
SYSTEM - Dump system group's event settings(Ie the instance wide events)
Example 1: Oracle 9i - system events
This example illustrates how to retrieve the events set at the system level in an Oracle 9i database.
Session altered.
After the event is set we dump the events information
Statement processed.
SQL> oradebug dump events 4;
Statement processed.
SQL> oradebug tracefile_name
/u01/oracle/product/9.2.0/admin/ORCL/udump/ORCL_ora_2620.trc
The following information will be dumped in the in the trace file ORCL_ora_2620.trc.
2. Dump event group for level SYSTEM
3. TC Addr Evt#(b10) Action TR Addr Arm Life
4. 78B6584 942 1 78b65c4 0 0
5. TR Name TR level TR address TR arm TR life TR type
6. ERRORSTACK 3 0 1 2 1961960
Notice the line 2 "Dump event group for level SYSTEM" which tells you which level was used to dump the information. In our case level 1 was used to dump the session information.
In line 4 the second column value tells us the event that was set, in our case 942.
In line 6 the first column tells us the name of the event, in our case the named event "ERRORSTACK" appears. On the same line check the second column, the determines the level at which the event was set, in our case "3"
Hence from the above information was can conclude that the event "942 trace name ERRORSTACK level 3" was set at the system level
Example 2: Oracle 11g - events set at session user SCOTT
This example illustrates how to retrieve the events user SCOTT has set at his session in an Oracle 11g database:
from v$process p, v$session s
where p.addr = s.paddr;
For example:
PID SPID USERNAME
---- ------- ---------
15 28390 SCOTT
Attach to the above identified session:
SQL> oradebug setorapid 15
--OR--
SQL> oradebug setospid 28390
Unix process pid: 32493, image: oracle@jschelfh-pc (TNS V1-V3)
Get the event information:
942 trace name ERRORSTACK level 3
Example 3: Oracle 11g - events set at your current session
This example illustrates how to retrieve the events set in your current session environment in an Oracle 11g database:
Session altered.
SQL> oradebug tracefile_name
/oracle/admin/L111/udump/l112_ora_32493.trc
The following information will be dumped in the in the trace file l112_ora_32493.trc
Dumping Event (group=SYSTEM)
942 trace name errorstack level 3
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/15747463/viewspace-752367/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- git列出所有已經跟蹤檔案Git
- alter system set event和set events的區別
- ORACLE EVENT && ORADEBUGOracle
- 列出oracle dbtime得sql語句OracleSQL
- oracle event 2 (zt)Oracle
- 我已經迷失在事件環(event-loop)中了【Nodejs篇】事件OOPNodeJS
- Openfiles /? 允許管理員列出系統上已開啟的檔案和資料夾或與其斷開連線。
- function ALV 獲取OO ALV event IDFunction
- centos(linux): 列出所有的開機自啟動程式CentOSLinux
- 《深入淺出Oracle》新書已經出版Oracle新書
- 【TUNE_ORACLE】列出走了Filter的SQL參考OracleFilterSQL
- oracle 如何不備份已經備份的歸檔Oracle
- 2019遊鼎獎正式啟動!評選報名通道已經開啟
- 2020遊鼎獎正式啟動!評選報名通道已經開啟
- 如何列出 Ubuntu 和 Debian 上已安裝的軟體包Ubuntu
- 開工大吉:Oracle 18c已經發布及新特性介紹Oracle
- 不講武德:以太坊2.0竟然今天已經開始啟動
- oracle驗證設定的event是否生效:Oracle
- 【TUNE_ORACLE】列出索引被哪些SQL引用的SQL參考Oracle索引SQL
- 【TUNE_ORACLE】列出有標量子查詢的SQL參考OracleSQL
- 【TUNE_ORACLE】列出走了INDEX FULL SCAN的SQL參考OracleIndexSQL
- 【TUNE_ORACLE】列出走了TABLE ACCESS FULL的SQL參考OracleSQL
- 【TUNE_ORACLE】列出走了INDEX SKIP SCAN的SQL參考OracleIndexSQL
- ORACLE _small_table_threshold與eventOracle
- ORACLE多個event設定方式Oracle
- Oracle 最新PSU (Doc ID 2118136.2)Oracle
- 【TUNE_ORACLE】列出走了笛卡爾積的SQL參考OracleSQL
- Id software還在《狂怒2》上裹足不前,但約翰·卡馬克已經去開闢全新的天地了
- C# 中的 ref 已經被放開,或許你已經不認識了C#
- Java 11已經不再完全免費,不要陷入Oracle的Java 11陷阱JavaOracle
- 面試經典:Event Loop面試OOP
- 微軟Win10 19H2 開發工作已經啟動微軟Win10
- 網民規模10億+的背後,智慧數字經營浪潮已加速開啟
- Oracle OCP(13):GROUPING & GROUPING_ID & GROUP_ID & GROUPING SETSOracle
- 【TUNE_ORACLE】列出帶有自定義函式的SQL的SQL參考Oracle函式SQL
- [20181107]18c set feedback顯示sql_id.txtSQL
- SqlServer 備份集和備份片以及mirror的backup_set_idSQLServer
- 【TUNE_ORACLE】列出必須建立直方圖的列SQL參考Oracle直方圖SQL
- 【TUNE_ORACLE】列出走了低選擇性索引的SQL參考Oracle索引SQL