Oracle所有診斷事件列表events

lhrbest發表於2017-03-23

Oracle所有診斷事件列表events




通過如下的指令碼可以獲取所有的診斷事件列表:

點選(此處)摺疊或開啟

  1. SET SERVEROUTPUT ON
  2. SET LINE 9999
  3. DECLARE
  4.   ERR_MSG VARCHAR2(32767);
  5. BEGIN
  6.   DBMS_OUTPUT.ENABLE('');
  7.   FOR ERR_NUM IN 10000 .. 10999 LOOP
  8.     ERR_MSG := SQLERRM(-ERR_NUM);
  9.     IF ERR_MSG NOT LIKE '%Message ' || ERR_NUM || ' not found%' THEN
  10.       DBMS_OUTPUT.PUT_LINE(ERR_MSG);
  11.     END IF;
  12.  
  13.  END LOOP;
  14. END;
  15. /


在UNIX系統下message檔案在底下目錄$ORACLE_HOME/rdbms/mesg/oraus.msg
在NT系統下message檔案在底下目錄$ORACLE_HOME/rdbms/mesg/oraus.msg
oraus.msg檔案屬於文字檔案,可以直接開啟檢視。

診斷事件可以像普通的
ORA錯誤一樣採用oerr命令來查詢,如下所示:


點選(此處)摺疊或開啟

  1. [oracle@orcltest ~]$ oerr ora 10046
  2. 10046, 00000, "enable SQL statement timing"
  3. // *Cause:
  4. // *Action:
  5. [oracle@orcltest ~]$ oerr ora 10053
  6. 10053, 00000, "CBO Enable optimizer trace"
  7. // *Cause:
  8. // *Action:
  9. [oracle@orcltest ~]$ oerr ora 10704
  10. 10704, 00000, "Print out information about what enqueues are being obtained"
  11. // *Cause: When enabled, prints out arguments to calls to ksqcmi and
  12. // ksqlrl and the return values.
  13. // *Action: Level indicates details:
  14. // Level: 1-4: print out basic info for ksqlrl, ksqcmi
  15. // 5-9: also print out stuff in callbacks: ksqlac, ksqlop
  16. // 10+: also print out time for each line






一、Oracle跟蹤檔案 
  Oracle跟蹤檔案分為三種型別:

  一種是後臺報警日誌檔案,記錄資料庫在啟動、關閉和執行期間後臺程式的活動情況,如表空間建立、回滾段建立、某些alter命令、日誌切換、錯誤訊息等。在資料庫出現故障時,應首先檢視該檔案,但檔案中的資訊與任何錯誤狀態沒有必然的聯絡。後臺報警日誌檔案儲存BACKGROUND_DUMP_DEST引數指定的目錄中,檔案格式為SIDALRT.LOG。

  另一種型別是DBWR、LGWR、SMON等後臺程式建立的後臺跟蹤檔案。後臺跟蹤檔案根據後臺程式執行情況產生,後臺跟蹤檔案也儲存在BACKGROUND_DUMP_DEST引數指定的目錄中,檔案格式為siddbwr.trc、sidsmon.trc等。

  還有一種型別是由連線到Oracle的使用者程式(Server Processes)生成的使用者跟蹤檔案。這些檔案僅在使用者會話期間遇到錯誤時產生。此外,使用者可以通過執行oracle跟蹤事件(見後面)來生成該類檔案,使用者跟蹤檔案儲存在USER_DUMP_DEST引數指定的目錄中,檔案格式為oraxxxxx.trc,xxxxx為建立檔案的程式號(或執行緒號)。

二、Oracle跟蹤事件 
  

Events事件是Oracle的重要診斷工具及問題解決辦法,很多時候需要通過Events設定來遮蔽或者更改Oracle的行為。

診斷事件大體上可以分為四類:

① 轉儲類事件:它們主要用於轉儲Oracle的一些結構,例如轉儲一下控制檔案、資料檔案頭等內容。

② 捕捉類事件:它們用於捕捉一些Error事件的發生,例如捕捉一下ORA-04031發生時一些Rdbms資訊,以判斷是Bug還是其它原因引起的這方面的問題。

③ 改變執行途徑類事件:它們用於改主一些Oracle內部程式碼的執行途徑,例如設定10269將會使Smon程式不去合併那些Free的空間。

④ 跟蹤類事件:這們用於獲取一些跟蹤資訊以用於Sql調優等方面,最典型的便是10046了,將會對Sql進行跟蹤。


Oracle提供了一類命令,可以將Oracle各類內部結構中所包含的資訊轉儲(dump)到跟蹤檔案中,以便使用者能根據檔案內容來解決各種故障。

設定跟蹤事件有兩種方法,

一種是在init.ora檔案中設定事件,這樣open資料庫後,將影響到所有的會話。設定格式如下:

EVENT="eventnumber trace name eventname [forever,] [level levelnumber] : ......."

通過冒號(:)符號,可以連續設定多個事件,也可以通過連續使用event來設定多個事件。如:


event = "10248 trace name context forever, level 10:10249 trace name context forever, level 10"

或者分開寫,如:

event="10248 trace name context forever, level 10"
event="10249 trace name context forever, level 10"

另一種方法是在會話過程中使用alter session set events命令,只對當前會話有影響。設定格式如下:

alter session|system set events '[eventnumber|immediate] trace name eventname [forever] [, level levelnumber] : .......'

通過:符號,可以連續設定多個事件,也可以通過連續使用alter session set events 來設定多個事件。

 ALTER SYSTEM SET

           EVENT='10325 trace name context forever, level 10','10015 trace name context forever, level 1'

           COMMENT='Debug tracing of control and rollback' SCOPE=SPFILE;  



或:

alter system set event='10325 trace name context forever, level 10:10015 trace name context forever, level 1' scope=spfile;

格式說明:

eventnumber指觸發dump的事件號,事件號可以是Oracle錯誤號(出現相應錯誤時跟蹤指定的事件)或oralce內部事件號,內部事件號在1000010999之間,不能與immediate關鍵字同用。

immediate關鍵字表示命令發出後,立即將指定的結構dump到跟蹤檔案中,這個關鍵字只用在alter session語句中,並且不能與eventnumberforever關鍵字同用。

trace name 是關鍵字,trace name位於第二、三項,除它們外的其它限定詞是供Oracle內部開發組用的。

eventname指事件名稱,即要進行dump的實際結構名。若eventnamecontext,則指根據內部事件號進行跟蹤。

forever關鍵字表示事件在例項或會話的週期內保持有效狀態,不能與immediate同用。

level為事件級別關鍵字。但在dump錯誤棧(errorstack)時不存在級別。level通常位於1-10之間(10046有時用到12)10意味著轉儲事件所有的資訊。例如當轉儲控制檔案時,level1表示轉儲控制檔案頭,而level 10表明轉儲控制檔案全部內容。

levelnumber表示事件級別號,一般從1101表示只dump結構頭部資訊,10表示dump結構的所有資訊。

轉儲所生成的trace檔案在user_dump_dest初始化引數指定的位置。

移除所有的events

ALTER SYSTEM RESET EVENT SCOPE=SPFILE SID='*' ;



  如何知道在系統中設定了哪些event?

a.如果你的事件是在init.ora中設定的可以用show parameter event;來檢視

b.可以使用如下的SQL

set serveroutput on size 1000000

DECLARE

  EVENT_LEVEL NUMBER;

BEGIN

  FOR I IN 10000 .. 99999 LOOP

    SYS.DBMS_SYSTEM.READ_EV(I, EVENT_LEVEL);

    IF (EVENT_LEVEL > 0) THEN

      DBMS_OUTPUT.PUT_LINE('Event ' || TO_CHAR(I) || ' set at level ' ||

                           TO_CHAR(EVENT_LEVEL));

    END IF;

  END LOOP;

END;

/



但是,1004610053事件不能通過這種方式查詢,只能通過oradebug來查詢。



SYS@orclasm > oradebug setmypid

SYS@orclasm > oradebug eventdump system

SYS@orclasm > oradebug eventdump session


LHR@orclasm > ALTER SESSION SET EVENTS '10046 trace name context  forever,level 12';


Session altered.



LHR@orclasm > ALTER SESSION SET EVENTS '10053 trace name context forever, level 1';


Session altered.


LHR@orclasm > ALTER SESSION SET EVENTS '10710 trace name context forever, level 1';


Session altered.


LHR@orclasm > alter session set events '10510 trace name context forever,level 1';


Session altered.


LHR@orclasm > set serveroutput on size 1000000

LHR@orclasm > DECLARE

  2    EVENT_LEVEL NUMBER;

  3  BEGIN

  4    FOR I IN 10000 .. 99999 LOOP

  5      SYS.DBMS_SYSTEM.READ_EV(I, EVENT_LEVEL);

    IF (EVENT_LEVEL > 0) THEN

  7        DBMS_OUTPUT.PUT_LINE('Event ' || TO_CHAR(I) || ' set at level ' ||

  8                             TO_CHAR(EVENT_LEVEL));

  9      END IF;

 10    END LOOP;

 11  END;

 12  /

Event 10510 set at level 1

Event 10710 set at level 1


PL/SQL procedure successfully completed.


LHR@orclasm >

LHR@orclasm > oradebug SETMYPID

ORA-01031: insufficient privileges

LHR@orclasm >

LHR@orclasm >

LHR@orclasm > conn / as  sysdba

Connected.

SYS@orclasm > oradebug SETMYPID

Statement processed.

SYS@orclasm > oradebug eventdump session

Statement processed.

SYS@orclasm > oradebug eventdump system

Statement processed.

SYS@orclasm > ALTER SESSION SET EVENTS '10046 trace name context  forever,level 12';


Session altered.


SYS@orclasm > oradebug eventdump session

sql_trace level=12

SYS@orclasm > oradebug eventdump system

Statement processed.

SYS@orclasm > ALTER SESSION SET EVENTS '10053 trace name context forever, level 1';


Session altered.


SYS@orclasm > oradebug eventdump session

trace [RDBMS.SQL_OPTIMIZER]

trace [RDBMS.SQL_Transform]

trace [RDBMS.SQL_MVRW]

trace [RDBMS.SQL_VMerge]

trace [RDBMS.SQL_Virtual]

trace [RDBMS.SQL_APA]

trace [RDBMS.SQL_Costing]

trace [RDBMS.SQL_Parallel_Optimization]

trace [RDBMS.SQL_Plan_Management]

sql_trace level=12

SYS@orclasm > oradebug eventdump system

Statement processed.

SYS@orclasm > ALTER SESSION SET EVENTS '10710 trace name context forever, level 1';


Session altered.


SYS@orclasm > oradebug eventdump session

10710 trace name context forever, level 1

trace [RDBMS.SQL_OPTIMIZER]

trace [RDBMS.SQL_Transform]

trace [RDBMS.SQL_MVRW]

trace [RDBMS.SQL_VMerge]

trace [RDBMS.SQL_Virtual]

trace [RDBMS.SQL_APA]

trace [RDBMS.SQL_Costing]

trace [RDBMS.SQL_Parallel_Optimization]

trace [RDBMS.SQL_Plan_Management]

sql_trace level=12

SYS@orclasm > oradebug eventdump system

Statement processed.

SYS@orclasm > alter system set events='1438 trace name errorstack forever,level 3';


System altered.


SYS@orclasm > oradebug eventdump session

1438 trace name errorstack forever,level 3

10710 trace name context forever, level 1

trace [RDBMS.SQL_OPTIMIZER]

trace [RDBMS.SQL_Transform]

trace [RDBMS.SQL_MVRW]

trace [RDBMS.SQL_VMerge]

trace [RDBMS.SQL_Virtual]

trace [RDBMS.SQL_APA]

trace [RDBMS.SQL_Costing]

trace [RDBMS.SQL_Parallel_Optimization]

trace [RDBMS.SQL_Plan_Management]

sql_trace level=12

SYS@orclasm >  oradebug eventdump system

1438 trace name errorstack forever,level 3

SYS@orclasm > alter system set events='1438 trace name errorstack off';


System altered.


SYS@orclasm > 



2.6 alter system events與alter system event的區別

結論:
1,events可以動態修改,可以使用alter session或alter system設定,隻影響內裡不影響引數檔案
2,event不能動態修改,只能使用alter system或在引數檔案裡設定,必須重啟庫方可生效


alter system會記錄到告警日誌中,alter session不會記錄在告警日誌中。


測試



SQL> show parameter event




NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
event                                string
SQL> alter system set event='10046 trace name context forever,level 12';
alter system set event='10046 trace name context forever,level 12'
                 *
ERROR at line 1:
ORA-02095: specified initialization parameter cannot be modified








SQL> alter system set event='10046 trace name context forever,level 12' scope=spfile;




System altered.




SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORA-32004: obsolete and/or deprecated parameter(s) specified
ORACLE instance started.




Total System Global Area 1157627904 bytes
Fixed Size                  2095800 bytes
Variable Size             402654536 bytes
Database Buffers          721420288 bytes
Redo Buffers               31457280 bytes
Database mounted.
Database opened.
SQL> show parameter event




NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
event                                string      10046 trace name context forev
                                                 er,level 12
SQL> 




SQL> alter system set event='' scope=spfile;




System altered.




SQL> alter system set events='10046 trace name context forever,level 12';




System altered.


1. alter system set event :此方法對spfile生效,無法對memory生效
SQL> ALTER system SET event='1461 trace name errorstack level 3';
ALTER system SET event='1461 trace name errorstack level 3'
                 *
ERROR at line 1:
ORA-02095: specified initialization parameter cannot be modified
 
SQL> ALTER system SET event='1461 trace name errorstack level 3' scope=spfile;
System altered.
驗證是否已成功更改:
SQL> CREATE pfile='/home/oracle/1.ora' FROM spfile;
File created.
SQL> !
[oracle@rac01 ~]$ grep event 1.ora
*.event='1461 trace name errorstack level 3'
這種方法的話,需要重啟DB。下面Rollback這個引數更改
SQL> ALTER system SET event='1461 trace name errorstack off' scope=spfile;
System altered.
SQL> CREATE pfile='/home/oracle/2.ora' FROM spfile;
File created.
SQL> !
[oracle@rac01 ~]$ grep event 2.ora
*.event='1461 trace name errorstack off'
2. alter system set events:此方法對memory生效,無法對spfile生效
SQL> ALTER system SET events '1461 trace name errorstack level 3';
 
System altered.
SQL> !
驗證:
[oracle@rac01 ~]$ tail -n1 /oracle/admin/strm1/bdump/alert_strm1.log
OS Pid: 9070 executed alter system set events '1461 trace name errorstack level 3'
這個引數更改沒有反應到spfile中
SQL> CREATE pfile='/home/oracle/3.ora' FROM spfile;
File created.
SQL> !
[oracle@rac01 ~]$ grep event 3.ora
*.event='1461 trace name errorstack off'
其實這裡的1461是個BUG 6085625,Metalink上可以參照NOTE: 461911.1
另外需要注意的是,RAC環境中用方法2動態設定event的話需要在所有instance設定。不過理解了上面的區別的話這個也就很容易明白了。


四. 示例 

4.1  檢視當前trc 檔案 
select 
  u_dump.value || '/' || 
  db_name.value || '_ora_' || 
  v$process.spid || 
  nvl2(v$process.traceid, '_' || v$process.traceid, null ) 
  || '.trc' "Trace File" 
from 
v$parameter u_dump 
cross join v$parameter db_name 
cross join v$process 
join v$session 
on v$process.addr = v$session.paddr 
where 
  u_dump.name = 'user_dump_dest' and 
  db_name.name = 'db_name' and 
  v$session.audsid=sys_context('userenv','sessionid'); 
eg: 
/oracle/product/10.2.0/admin/dw/udump\dw_ora_389530.trc 

4.2  執行event 

alter session set events '10046 trace name context forever, level 1'; 
select count(1) from all_tables; 
alter session set events '10046 trace name context off' ; 

4.3 在檢視dw_ora_389530.trc

$dw_ora_389530.trc








以下是所有的診斷事件列表:
  返回    
事件ID 事件 說明 例子
10046 enable SQL statement timing level 0:禁用SQL_TRACE,等價於SQL_TRACE=FALSE
level 1
:啟用標準的sql_trace功能跟蹤SQL語句,包括解析、執行、提取、提交和回滾等,等價於SQL_TRACE=TRUE
level 4
Level 1 +包括變數(bind values)的詳細資訊
level 8
Level 1 + 包括等待事件
level 12
:包括繫結變數與等待事件,包含
Level 1 + Level 4 + Level 8
1     Print SQL statements, execution plans and execution statistics
4     As level 1 plus bind variables
8     As level 1 plus wait statistics
12   As level 1 plus bind variables and wait statistics
ALTER SESSION SET EVENTS '10046 trace name context  forever,level 12';
ALTER SESSION SET EVEVTS '10046 trace name context off';
10053 CBO Enable optimizer trace 轉儲優化策略,Dump Optimizer Decisions---在分析SQL語句時,Dump出優化器所做的選擇,級別level 1最詳細
Level      Action
1     Print statistics and computations
2     Print computations only
ALTER SESSION SET EVENTS '10053 trace name context forever, level 1';
10704 Print out information about what enqueues are being obtained When enabled, prints out arguments to calls to ksqcmi and ksqlrl and the return values。跟蹤enqueues,可以檢視鎖的資訊。
Level: 1-4: print out basic info for ksqlrl, ksqcmi
       5-9: also print out stuff in callbacks:  ksqlac, ksqlop
       10+: also print out time for each line
ALTER SESSION SET EVENTS '10704 trace name context forever,level 10'; 
10710 Event 10710 - Trace Bitmap Index Access 跟蹤點陣圖索引的訪問情況 ALTER SESSION SET EVENTS '10710 trace name context forever, level 1';
10711 Event 10711 - Trace Bitmap Index Merge Operation 跟蹤點陣圖索引合併操作 ALTER SESSION SET EVENTS '10711 trace name context forever, level 1'; 
10712 Event 10712 - Trace Bitmap Index OR Operation 跟蹤點陣圖索引或操作情況 ALTER SESSION SET EVENTS '10712 trace name context forever, level 1'; 
10713 Event 10713 - Trace Bitmap Index AND Operation 跟蹤點陣圖索引與操作 ALTER SESSION SET EVENTS '10713 trace name context forever, level 1';
10714 Event 10714 - Trace Bitmap Index MINUS Operation 跟蹤點陣圖索引minus操作 ALTER SESSION SET EVENTS '10714 trace name context forever, level 1';
10715 Event 10715 - Trace Bitmap Index Conversion to ROWIDs Operation 跟蹤點陣圖索引轉換ROWID操作 ALTER SESSION SET EVENTS '10715 trace name context forever, level 1';
10716 Event 10716 - Trace Bitmap Index Compress/Decompress 跟蹤點陣圖索引壓縮和解壓縮情況 ALTER SESSION SET EVENTS '10716 trace name context forever, level 1';
10717 Event 10717 - Trace Bitmap Index Compaction   ALTER SESSION SET EVENTS '10717 trace name context forever, level 1';
10719 Event 10719 - Trace Bitmap Index DML 跟蹤點陣圖索引列的DML操作(引起點陣圖索引改變的DML操作) ALTER SESSION SET EVENTS '10719 trace name context forever, level 1';
10730 Event 10730 - Trace Fine Grained Access Predicates 跟蹤細粒度審計的斷語 ALTER SESSION SET EVENTS '10730 trace name context forever, level 1';
10731 Event 10731 - Trace CURSOR Statements 跟蹤CURSOR的語句情況,跟蹤遊標宣告 ALTER SESSION SET EVENTS '10731 trace name context forever, level level';
LEVEL
定義
1     Print parent query and subquery
2     Print subquery only
 
10928 Event 10928 - Trace PL/SQL Execution 跟蹤PL/SQL執行情況 ALTER SESSION SET EVENTS '10928 trace name context forever, level 1';
10938 Event 10938 - Dump PL/SQL Execution Statistics 轉儲PL/SQL執行統計資訊,跟蹤PL/SQL執行狀態。使用前需要執行rdbms/admin下的tracetab.sql ALTER SESSION SET EVENTS '10938 trace name context forever, level 1';
Memory Dumps      
  flush_cache 重新整理BUFFER CACHE ALTER SESSION SET EVENTS 'immediate trace name flush_cache';
  DROP_SEGMENTS 手工刪除臨時段。當這些臨時段無法自動清除的時候可以手工清除 alter session set events 'immediate trace name DROP_SEGMENTS level ts#+1'; --ts#是指要刪除臨時段的表空間的ts#
  global_area 1 包含PGA               
2 
包含
SGA               
4 
包含
UGA               
8 
包含
indrect memory
ALTER SESSION SET EVENTS 'immediate trace name global_area level n';
  Library Cache 1 library cache統計資訊               
2 
包含hash table histogram
3 
包含object handle                       
4 
包含object結構(Heap 0
ALTER SESSION SET EVENTS 'immediate trace name library_cache level 10';
  Row Cache dump資料字典緩衝區中的資訊:
1 row cache
統計資訊               
2 
包含hash table histogram               
8 
包含object
結構
ALTER SESSION SET EVENTS 'immediate trace name row_cache level n';
  buffers 1 buffer header                                       
2 level 1 + block header
3 level 2 + block contents               
4 level 1 + hash chain
5 level 2 + hash chain                       
6 level 3 + hash chain
8 level 4 + users/waiters                       
9 level 5 + users/waiters
10 level 6 + users/waiters
ALTER SESSION SET EVENTS 'immediate trace name buffers level n';
  Buffer n為某個指定blockrdba,該命令可以轉儲某個blockbuffer中的所有版本。 ALTER SESSION SET EVENTS 'immediate trace name buffer level n';
  Heap dump PGASGAUGA中的資訊:
1 PGA
摘要                                               
2 SGA
摘要
                                               
4 UGA
摘要

8 Current call(CGA)
摘要               
16 User call(CGA)
摘要
               
32 Large call(LGA)
摘要

1025 PGA
內容                                       
2050 SGA
內容
                               
4100 UGA
內容

8200 Current call
內容               
16400 User call
內容
                       
32800 Large call
內容
ALTER SESSION SET EVENTS 'immediate trace name heapdump level level';
  Sub Heap Oracle 9.0.1版本之前
ALTER SESSION SET EVENTS 'immediate trace name heapdump_addr level n';
nsubheap的地址,轉儲的是subheap的摘要資訊
nsubheap的地址+1,轉儲的則是subheap的內容
Oracle 9.2.0
版本之後
ALTER SESSION SET EVENTS 'immediate trace name heapdump_addr level n, addr m';
其中msubheap的地址,n1轉儲subheap的摘要,n2轉儲subheap
的內容
 
  Process State 分析程式狀態 ALTER SESSION SET EVENTS 'immediate trace name processstate level 10';
  systemstate dump所有系統狀態和程式狀態,分析系統狀態,最好每10分鐘一次,做三次對比
alter session set events 'immediate trace name SYSTEMSTATE level 10';
ALTER SESSION SET EVENTS 'immediate trace name systemstate level 10';
  errorstack dump錯誤棧資訊,通常Oracle發生錯誤時前臺程式將得到一條錯誤資訊,但某些情況下得不到錯誤資訊,可以採用這種方式得到Oracle錯誤
0 Error stack                                       
1 level 0 + function call stack
2 level 1 + process state               
3 level 2 + context area
ALTER SESSION SET EVENTS 'immediate trace name errorstack level n';
alter session set events '604 trace name errorstack forever'; --
表示當出現604錯誤時,dump 錯誤棧和程式棧。

alter session set events '942 trace name errorstack level 3';
alter system set events='1438 trace name errorstack forever,level 3';
alter system set events='1438 trace name errorstack off';
  hanganalyze   ALTER SESSION SET EVENTS 'immediate trace name hanganalyze level n';
  Work Area 1 SGA資訊               
2 Workarea Table
摘要資訊               
3 Workarea Table
詳細資訊
ALTER SESSION SET EVENTS 'immediate trace name workareatab_dump level n';
  Latches 1 latch資訊
2 
統計資訊
ALTER SESSION SET EVENTS 'immediate trace name latches level n';
  events 1 session               
2 process              
3 system
ALTER SESSION SET EVENTS 'immediate trace name events level n';
  Locks    ALTER SESSION SET EVENTS 'immediate trace name locks level n';
  Shared Server Process n取值為1~14 ALTER SESSION SET EVENTS 'immediate trace name shared_server_state level n';
  Background Messages   ALTER SESSION SET EVENTS 'immediate trace name bg_messages level (pid+1)';
  coalesec事件 dump指定表空間中的自由區間 levelnumber以十六進位制表示時,兩個高位位元組表示自由區間數目,兩個低位位元組表示表空間號,如0x00050000表示dump系統表空間中的5個自由區間,轉換成十進位制就是327680,即:
alter session set events 'immediate trace name coalesec level 327680';
File Dumps      
  blockdump事件 dump資料檔案、索引檔案、回滾段檔案結構,在Oracle 8以後該命令已改為:
alter system dump datafile 11 block 9; --
表示dump資料檔案號為11中的第9
個資料塊。
alter session set events 'immediate trace name blockdump level 66666'; --表示dump塊地址為6666的資料塊。
  block 分析資料檔案塊,轉儲資料檔案n的塊m:
alter system dump datafile n block m;
ALTER SYSTEM DUMP DATAFILE file# BLOCK block#;                  
ALTER SYSTEM DUMP DATAFILE file# BLOCK MIN min # BLOCK MAX max #;
  Tree Dump   ALTER SESSION SET EVENTS 'immediate trace name treedump level object_id';
  Undo Segment Header   ALTER SYSTEM DUMP UNDO_HEADER 'segment_name';
  Undo for a Transaction   ALTER SYSTEM DUMP UNDO BLOCK 'segment_name' XID xidusn xidslot xidsqn;
  File Header dump 所有資料檔案的頭部資訊:
1 
控制檔案中的檔案頭資訊               
2 level 1 + 
檔案頭資訊

3 level 2 + 
資料檔案頭資訊
               
10 level 3
alter session set events 'immediate trace name file_hdrs level 1'; --表示dump 所有資料檔案頭部的控制檔案項。
alter session set events 'immediate trace name file_hdrs level 2'; --
表示dump 所有資料檔案的通用檔案頭。
alter session set events 'immediate trace name file_hdrs level 10'; --
表示dump 
所有資料檔案的完整檔案頭。
  Control file 轉儲控制檔案:
1 
檔案頭資訊
                                       
2 level 1 + 
資料庫資訊 + 檢查點資訊

3 level 2 + 
可重用節資訊
       
10 level 3
12
alter system set events 'immediate trace name controlf level 12';
  Redo log Header 分析日誌檔案頭:
1 
控制檔案中的redo log資訊               
2 level 1 + 
檔案頭資訊

3 level 2 + 
日誌檔案頭資訊
                       
10 level 3
alter session set events 'immediate trace name redohdr level 1'; --表示dump redo日誌頭部的控制檔案項。
alter session set events 'immediate trace name redohdr level 2'; --
表示dump redo日誌的通用檔案頭。
alter session set events 'immediate trace name redohdr level 10'; --
表示dump redo
日誌的完整檔案頭。
  Redo log 分析日誌檔案:
ALTER SYSTEM DUMP LOGFILE 'FileName'
SCN MIN MinSCN SCN MAX MaxSCN TIME MIN MinTime TIME MAX MaxTime
LAYER Layer OPCODE Opcode
DBA MIN File#.Block# DBA MAX File#.Block#
RBA MIN LogFileSequence#.Block# RBA MAX LogFileSequence#.Block#;

其中
time = ((((yyyy - 1988) * 12 + mm - 1) * 31 + dd - 1) * 24 + hh) * 60 + mi) * 60 + ss;
ALTER SYSTEM DUMP LOGFILE 'FileName';
  Loghist dump控制檔案中的日誌歷史項:
1 dump
控制檔案中最早和最遲的日誌歷史項
>1 dump 2^n
個日誌歷史項
alter session set events 'immediate trace name loghist level 1'; --表示只dump最早和最遲的日誌歷史項。
levelnumber
大於等於2時,表示2levelnumber次方個日誌歷史項。
alter session set events 'immediate trace name loghist level 4'; --
表示dump 16
個日誌歷史項。
內部事件      
10000 control file debug event, name 'control_file'    
10001 control file crash event1    
10002 control file crash event2    
10003 control file crash event3    
10004 block recovery testing - internal error    
10005 trace latch operations for debugging    
10006 block recovery testing - external error    
10007 log switch debug crash after new log select, thread     
10008 log switch debug crash after new log header write, thread     
10009 log switch debug crash after old log header write, thread     
10010 Begin Transaction    
10011 End   Transaction    
10012 Abort Transaction    
10013 Instance Recovery 用於監視事務恢復,在Startup時跟蹤事務恢復 ALTER SESSION SET EVENTS '10013 trace name context forever, level 1';
10014 Roll Back to Save Point    
10015 Undo Segment Recovery 轉儲UNDO SEGMENT頭部,Dump Undo Segment Headers,在事務恢復後做Dump回退段頭資訊 ALTER SESSION SET EVENTS '10015 trace name context forever, level 1';
10016 Undo Segment extend    
10017 Undo Segment Wrap    
10018 Data Segment Create    
10019 Turn off data/space search cache    
10020 partial link restored to linked list (KSG)    
10021 KST event to trace control file header writes and reads    
10022 trace ktsgsp    
10023 Create Save Undo Segment    
10024 Write to Save Undo    
10025 Simulate block recovery errors    
10026 Apply Save Undo    
10027 Specify Deadlock Trace Information to be Dumped    
10028 Dump trace information during lock / resource latch cleanup    
10029 session logon (KSU) 用於給出會話期間的登陸資訊  
10030 session logoff (KSU) 用於給出會話期間的登出資訊  
10031 sort debug event (S*)    
10032 sort statistics (SOR*) 轉儲排序的統計資訊,Dump Sort Statistics----Dump排序的統計資訊,level 10是最詳細的 ALTER SESSION SET EVENTS '10032 trace name context forever, level 10';
10033 sort run information (SRD*/SRS*) 轉儲排序增長的統計資訊  ALTER SESSION SET EVENTS '10033 trace name context forever, level 10';
10034 access path analysis (APA*)    
10035 Write parse failures to alert log file 解析失敗寫入告警日誌 alter system set events '10035 trace name context forever,leve 5';
alter system set events '10035 trace name context off';
10036 create remote row source (QKANET)    
10037 allocate remote row source (QKARWS)    
10038 dump row source tree (QBADRV)    
10039 type checking (OPITCA)    
10040 disable result-cache    
10041 dump undo records skipped    
10042 file header reads return youngest mirror    
10043 check consistency of owner/waiter/converter lists in KSQ    
10044 free list undo operations    
10045 free list update operations - ktsrsp, ktsunl 跟蹤Freelist管理操作,Trace Free List Management Operations—跟蹤Freelist ALTER SESSION SET EVENTS '10045 trace name context forever, level 1';
10047 trace switching of sessions    
10048 Undo segment shrink    
10049 protect library cache memory heaps    
10050 sniper trace    
10051 trace OPI calls    
10052 don't clean up obj$    
10054 CBO Enable optimizer trace for recursive statement (RPI)    
10055 Rowsets: turn off rowsets for various operations    
10056 dump analyze stats (kdg)    
10057 suppress file names in error messages    
10058 use table scan cost in tab$.spare1    
10059 simulate error in logfile create/clear 模擬redo日誌中的建立和清除錯誤   
10060 CBO Enable predicate dump    
10061 disable SMON from cleaning temp segment 阻止SMON程式在啟動時清除臨時段  
10062 disable usage of OS Roles in osds    
10063 disable usage of DBA and OPER privileges in osds    
10064 thread enable debug crash level , thread     
10065 limit library cache dump information for state object dump Restrict Library Cache Dump Output for State Object Dumps  
10066 simulate failure to verify file    
10067 force redo log checksum errors - block number    
10068 force redo log checksum errors - file number    
10069 Flashback images for offline file  are lost    
10070 force datafile checksum errors - block number    
10071 force datafile checksum errors - file number    
10072 local tempspace tracing - recovery layer    
10073 latch cleanup tracing    
10074 default trace function mask for kst    
10075 CBO Disable outer-join to regular join conversion    
10076 CBO Enable cartesian product join costing    
10077 CBO Disable view-merging optimization for outer-joins    
10078 CBO Disable constant predicate elimination optimization    
10079 trace data sent/received via SQL*Net 轉儲SQL*NET統計資訊,Dump SQL*Net Statistics---Dump SQL*NeT的統計資訊 ALTER SESSION SET EVENTS '10079 trace name context forever, level 2';
10080 dump a block on a segment list which cannot be exchanged    
10081 segment High Water Mark has been advanced 轉儲高水標記變化,Trace High Water Mark Changes—跟蹤HWM的改變 ALTER SESSION SET EVENTS '10081 trace name context forever, level 1';
10082 free list head block is the same as the last block    
10083 Trace IMCDT in LIMITED mode    
10084 free list becomes empty    
10085 free lists have been merged    
10086 CBO Enable error if kko and qka disagree on oby sort    
10087 disable repair of media corrupt data blocks    
10088 CBO Disable new NOT IN optimization    
10089 CBO Disable index sorting    
10090 invoke other events before crash recovery    
10091 CBO Disable constant predicate merging    
10092 CBO Disable hash join    
10093 CBO Enable force hash joins    
10094 before resizing a data file    
10095 dump debugger commands to trace file    
10096 after the cross instance call when resizing a data file    
10097 after generating redo when resizing a data file    
10098 after the OS has increased the size of a data file    
10099 after updating the file header with the new file size    
10100 after the OS has decreased the size of a data file    
10101 DBWR refresh fails on cross instance resize call    
10102 switch off anti-joins    
10103 CBO Disable hash join swapping    
10104 dump hash join statistics to trace file 轉儲Hash連線統計資訊,Dump Hash Join Statistics—Dump HASH JOIN的統計資訊,level 10 ALTER SESSION SET EVENTS '10104 trace name context forever, level 10';
10105 CBO Enable constant pred trans and MPs w WHERE-clause    
10106 CBO Disable evaluating correlation pred last for NOT IN    
10107 CBO Always use bitmap index    
10108 CBO Don't use bitmap index    
10109 CBO Disable move of negated predicates    
10110 CBO Try index rowid range scans    
10111 Bitmap index creation switch    
10112 Bitmap index creation switch    
10113 Bitmap index creation switch    
10114 Bitmap index creation switch    
10115 CBO Bitmap optimization use maximal expression    
10116 CBO Bitmap optimization switch    
10117 CBO Disable new parallel cost model     
10118 CBO Enable hash join costing     
10119 QKA Disable GBY sort elimination    
10120 generate relative file # different from absolute    
10121 CBO Don't sort bitmap chains    
10122 Disable transformation of count(col) to count(*)    
10124 Force creation of segmented arrays by kscsAllocate    
10125 Disable remote sort elimination    
10126 Debug oracle java xa    
10127 Disable remote query block operation    
10128 Dump Partition Pruning Information 轉儲分割槽休整資訊,Dump Partition Pruning Information—Dump分割槽表資訊,
Level      Action
0x0001   Dump pruning descriptor for each partitioned object
0x0002   Dump partition iterators
0x0004   Dump optimizer decisions about partition-wise joins
0x0008   Dump ROWID range scan pruning information

9.0.1或者後面的版本,level 2後還需要建立如下的表
:
CREATE TABLE kkpap_pruning
    (
            partition_count    NUMBER,
            iterator           VARCHAR2(32),
            partition_level      VARCHAR2(32));
ALTER SESSION SET EVENTS '10128 trace name context forever, level level';
10129 Alter histogram lookup for remote queries    
10130 sort disable readaheads    
10131 CONNECT BY debug event    
10132 dump plan after compilation    
10133 testing for SQL Memory Management    
10134 tracing for SQL Memory Management for session    
10135 CBO do not count 0 rows partitions    
10136 CBO turn off fix for bug 1089848    
10137 CBO turn off fix for bug 1344111    
10138 CBO turn off fix for bug 1577003    
10139 CBO turn off fix for bug 1386119    
10140 CBO turn off fix for bug 1332980    
10141 CBO disable additional keys for inlist in bitmap optimization    
10142 CBO turn off advanced OR-expansion checks    
10143 CBO turn off hints    
10144 CBO turn off cost based selection of bji over bsj subquery    
10145 test auditing network errors    
10146 enable Oracle TRACE collection    
10147 enable join push through UNION view    
10148 Quarantine trace event    
10149 allow the creation of constraints with illegal date constants    
10150 import exceptions    
10152 CBO don't consider function costs in plans    
10153 Switch to use public synonym if private one does not translate    
10154 Switch to disallow synonyms in DDL statements    
10155 CBO disable generation of transitive OR-chains    
10156 CBO disable index fast full scan    
10157 CBO disable index access path for in-list    
10158 CBO preserve predicate order in post-filters    
10159 CBO disable order-by sort pushdown into domain indexes    
10160 CBO disable use of join index    
10161 CBO recursive semi-join on/off-switch    
10162 CBO join-back elimination on/off-switch    
10163 CBO join-back elimination on/off-switch    
10164 CBO disable subquery-adjusted cardinality fix    
10165 mark session for special handling during instance administration    
10166 trace long operation statistics updates    
10167 CBO use old index MIN/MAX optimization    
10168 CBO disable single-table predicate predicate generation    
10169 CBO disable histograms for multi partitions    
10170 CBO use old bitmap costing    
10171 CBO disable transitive join predicates    
10172 CBO force hash join back    
10173 Dynamic Sampling time-out error    
10174 view join-back elimination switch    
10175 CBO star transformation switch    
10176 CBO colocated join switch    
10177 CBO colocated join switch    
10178 CBO turn off hash cluster filtering through memcmp    
10179 CBO turn off transitive predicate replacement    
10180 temp table transformation print error messages    
10181 CBO disable multi-column in-list processing    
10182 CBO disable generation of implied predicates    
10183 CBO disable cost rounding    
10184 CBO disable OR-exp if long inlist on bitmap column    
10185 CBO force index joins    
10186 CBO disable index join    
10187 CBO additional index join switch    
10188 CBO additional index join switch    
10189 CBO turn off FFS null fix    
10190 Analyze use old frequency histogram collection and density    
10191 Avoid conversion of in-lists back to OR-expanded form    
10192 nopushdown when number of groups exceed number of rows    
10193 Force repeatable sampling with specified seed    
10194 CBO disable new LIKE selectivity heuristic    
10195 CBO don't use check constraints for transitive predicates    
10196 CBO disable index skip scan    
10197 CBO force index skip scan    
10199 set parameter in session    
10200 consistent read buffer status 轉儲一致性讀資訊  
10201 consistent read undo application 轉儲一致性讀中Undo應用   
10202 consistent read block header    
10203 block cleanout    
10204 signal recursive extend    
10205 row cache debugging    
10206 transaction table consistent read    
10207 consistent read transactions' status report    
10208 consistent read loop check    
10209 enable simulated error on control file 允許在控制檔案中模擬錯誤   
10210 check data block integrity 觸發資料塊檢查事件 event = "10210 trace name context forever, level 10"
10211   觸發索引檢查事件,我並沒有找到這個事件  
10212 check cluster integrity    
10213 crash after control file write 模擬在寫控制檔案後崩潰  
10214 simulate write errors on control file 模擬在控制檔案中的寫錯誤,levelnumber1-9表示產生錯誤的塊號,大於等於10則每個控制檔案將出錯  
10215 simulate read errors on control file 模擬在控制檔案中的讀錯誤  
10216 dump control file header    
10217 debug sequence numbers    
10218 dump uba of applied undo    
10219 monitor multi-pass row locking    
10220 show updates to the transaction table 轉儲Undo頭部變化  
10221 show changes done with undo 轉儲Undo變化  
10222 row cache    
10223 transaction layer - turn on verification codes    
10224 index block split/delete trace 10224事件可以分析索引塊分裂及刪除 alter session set events '10224 trace name context forever,level 10';
alter session set events '10224 trace name context off';
10225 free/used extent row cache 轉儲基於字典管理的區間的變化  
10226 trace CR applications of undo for data operations    
10227 verify (multi-piece) row structure    
10228 trace application of redo by kcocbk    
10229 simulate I/O error against datafiles 模擬在資料檔案上的I/O錯誤  
10230 KSFD block repair test event    
10231 skip corrupted blocks on _table_scans_ 設定在全表掃描時忽略損壞的資料塊 alter session set events '10231 trace name context off'; -- 關閉會話期間的資料塊檢查 
event = "10231 trace name context forever, level 10" -- 
對任何程式讀入SGA
的資料塊進行檢查
10232 dump corrupted blocks symbolically when kcbgotten 將設定為軟損壞(DBMS_REPAIR包設定或DB_BLOCK_CHECKINGTRUE時設定)的資料塊dump到跟蹤檔案  
10233 skip corrupted blocks on index operations    
10234 trigger event after calling kcrapc to do redo N times    
10235 check memory manager internal structures 用於記憶體堆檢查 alter session set events '10235 trace name context forever, level 1';
10236 dump redo on object no. or block type mismatch errors 1410/8103    
10237 simulate ^C (for testing purposes)    
10238 instantiation manager    
10239 multi-instance library cache manager    
10240 dump dba's of blocks that we wait for    
10241 remote SQL execution tracing/validation 轉儲遠端SQL執行   
10242 suppress OER 2063 (for testing distrib w/o different error log)    
10243 simulated error for test  of K2GTAB latch cleanup    
10244 make tranids in error msgs print as 0.0.0 (for testing)    
10245 Testing event used by server I/O ksfd/ksfq module    
10246 print trace of PMON actions to trace file 跟蹤PMON程式,將PMON的動作輸出到trace檔案中 alter session set events '10246 trace name context forever,level 4';
alter session set events '10246 trace name context off';
10247 Turn on scgcmn tracing. (VMS ONLY)    
10248 turn on tracing for dispatchers 跟蹤dispatch程式  
10249 turn on tracing for multi-stated servers 跟蹤MTS程式   
10250 Trace all allocate and free calls to the topmost SGA heap    
10251 check consistency of transaction table and undo block    
10252 shared IO pool error simulation 模擬寫資料檔案頭部錯誤  
10253 limit SQL text returned from X$KGLNA[1] 模擬寫redo日誌檔案錯誤  
10254 trace cross-instance calls    
10255 pl/sql parse checking    
10256 shared server debug event    
10257 trace shared server load balancing    
10258 force shared servers to be chosen round-robin    
10259 get error message text from remote using explicit call    
10260 PGA limit ( MB) exceeded - process terminated 10260, 00000, "PGA limit (%s MB) exceeded - process terminated"
// *Cause:    The Resource Manager SESSION_PGA_LIMIT directive was exceeded
//            because the process used too much program global area (PGA)
//            memory.
// *Action:   Reduce the complexity of the update or query, or contact your
//            database administrator for more information.
 
10261 Limit the size of the PGA heap    
10262 Don't check for memory leaks 允許連線時存在記憶體洩漏  alter session set events '10262 trace name context forever, level 300'; -- 允許存在300個位元組的記憶體洩漏
10263 Don't free empty PGA heap extents    
10265 Keep random system generated output out of error messages    
10266 Trace OSD stack usage    
10267 Inhibit KSEDMP for testing    
10268 Don't do forward coalesce when deleting extents    
10269 Don't do coalesces of free space in SMON    
10270 Debug shared cursors 轉儲共享遊標  
10271 distributed transaction after COLLECT    
10272 distributed transaction before PREPARE    
10273 distributed transaction after PREPARE    
10274 distributed transaction before COMMIT    
10275 distributed transaction after COMMIT    
10276 distributed transaction before FORGET    
10277 Cursor sharing (or not) related event (used for testing)    
10278 Internal testing    
10279 Simulate block corruption in kdb4chk    
10280 Internal testing - segmentation fault during crash recovery    
10281 maximum time to wait for process creation    
10282 Inhibit signalling of other backgrounds when one dies    
10284 simulate zero/infinite asynch I/O buffering    
10285 Simulate control file header corruption 模擬控制檔案頭部損壞  
10286 Simulate control file open error 模擬控制檔案開啟錯誤  
10287 Simulate archiver error 模擬歸檔出錯  
10288 Do not check block type in ktrget    
10289 Do block dumps to trace file in hex rather than fromatted    
10290 Internal sequence tracing event    
10291 die in tbsdrv to test control file undo    
10292 hang analysis trace event    
10293 trace log switch media recovery checkpoints    
10294 ksrpc tracing    
10295 die after file header update durning cf xact    
10296 disable 379    
10297 shared I/O pool tracing    
10298 ksfd i/o tracing    
10299 Trace prefetch tracking decisions made by CKPT    
10300 Distributed transaction tracing    
10301 Enable LCK timeout table consistency check    
10302 trace create or drop internal trigger    
10303 trace loading of library cache for internal triggers    
10304 trace replication trigger    
10305 trace updatable materialized view trigger    
10306 trace materialized view log trigger    
10307 trace RepCat execution    
10308 replication testing event    
10309 Trigger Debug event    
10310 trace synchronous change table trigger    
10311 Disable Flashback Table Timestamp checking    
10312 Allow disable to log rows into the mapping table    
10314 Enable extra stats gathering for CR    
10316 Events for extensible txn header, non zero ext header size    
10317 Events for extensible txn header, zero ext header size    
10318 Trace extensible txn header movements    
10319 Trace PGA statistics maintenance    
10320 Enable data layer (kdtgrs) tracing of space management calls    
10321 Datafile header verification debug failure.    
10322 CBO don't simplify inlist predicates    
10323 before committing an add datafile command    
10324 Enable better checking of redo logs errors    
10325 Trace control file record section expand and shrink operations    
10326 clear logfile debug crash at , log     
10327 simulate 00235 error for testing    
10328 disable first-to-mount split-brain error, for testing    
10329 simulate out-of-memory error during first pass of recovery    
10330 clear MTTR statistics in checkpoint progress record    
10331 simulate resilvering during recovery    
10332 force ALTER SYSTEM QUIESCE RESTRICTED command to fail    
10333 dump MTTR statistics each time it is updated    
10334 force FG to wait to be killed during MTTR advisory simulation    
10335 trace database open status    
10336 Do remote object transfer using remote SQL    
10337 enable padding owner name in slave sql    
10338 CBO don't use inlist iterator with function-based indexes    
10339 CBO disable DECODE simplification    
10340 Buffer queues sanity check for corrupted buffers    
10341 Simulate out of PGA memory in DBWR during object reuse    
10342 Raise unknown exception in ACQ_ADD when checkpointing    
10343 Raise an out of memory exception-OER 4031 in ACQ_ADD    
10344 reserved for simulating object hash reorganization    
10345 validate queue when linking or unlinking a buffer    
10346 check that all buffers for checkpoint have been written    
10347 dump active checkpoint entries and checkpoint buffers    
10348 test abnormal termination of process initiating file checkpoint    
10349 do not allow ckpt to complete    
10350 Simulate more than one object & tsn id in object reuse    
10351 size of slots    
10352 report direct path statistics    
10353 number of slots    
10354 turn on direct read path for parallel query    
10355 turn on direct read path for scans    
10356 turn on hint usage for direct read    
10357 turn on debug information for direct path 除錯直接路徑機制   
10358 Simulate out of PGA memory in cache advisory reset    
10359 turn off updates to control file for direct writes    
10360 enable dbwr consistency checking    
10361 check buffer change vector count consistency    
10362 simulate a write error to take a file offline    
10363 Simulate messaging error for fast object reuse/checkpoint    
10364 Do not clear GIMH_STC_SHUT_BEGIN state during shutdown    
10365 turn on debug information for adaptive direct reads    
10366 kgnfs tracing    
10367 kgodm tracing    
10368 maximum number of internal errors a process will tolerate    
10369 test SQL monitoring feature    
10370 parallel query server kill event    
10371 disable TQ hint    
10372 parallel query server kill event proc    
10373 parallel query server kill event    
10375 turn on checks for statistics rollups    
10376 enable archive compression loads    
10377 force slave allocation    
10378 force hard process/range affinity    
10380 kxfp latch cleanup testing event    
10381 kxfp latch cleanup testing event    
10382 parallel query server interrupt (reset)    
10383 auto parallelization testing event    
10384 parallel dataflow scheduler tracing    
10385 parallel table scan range sampling method    
10386 parallel SQL hash and range statistics    
10387 parallel query server interrupt (normal)    
10388 parallel query server interrupt (failure)    
10389 parallel query server interrupt (cleanup)    
10390 Trace parallel query slave execution    
10391 trace PX granule allocation/assignment    
10392 parallel query debugging bits    
10393 print parallel query statistics    
10394 generate a fake load to test adaptive and load balancing    
10395 adjust sample size for range table queues    
10397 suppress verbose parallel coordinator error reporting    
10398 enable timeouts in parallel query threads    
10399 trace buffer allocation    
10400 turn on system state dumps for shutdown debugging    
10401 turn on IPC (ksxp) debugging    
10402 turn on IPC (skgxp) debugging    
10403 fake CPU number for default degree of parallelism    
10404 crash dbwr after write    
10405 emulate broken mirrors    
10406 enable datetime TIMESTAMP, INTERVAL datatype creation    
10407 enable datetime TIME datatype creation    
10408 disable OLAP builtin window function usage    
10409 enable granule memset and block invalidation at startup    
10410 trigger simulated communications errors in KSXP    
10412 dump the call stack if an error is signaled    
10413 force simulated error for testing purposes    
10414 simulated error from event  level     
10415 parallel degree specified is too large, max value allowed     
10416 disable fix for 2736734    
10417 limit 1 file per sbtinfo2() validation call    
10418 disable re-creating tempfile    
10419 create tempfile without create_scn and time    
10420 trace KSO OS-process operations    
10421 enable dump from ksbwco if there is no reply    
10422 KSU debugging    
10423 dump the call stack if the specified error is cleared    
10424 KGE debugging    
10425 enable global enqueue operations event trace    
10426 enable ges/gcs reconfiguration event trace    
10427 enable global enqueue service traffic controller event trace    
10428 enable tracing of global enqueue service cached resource    
10429 enable tracing of global enqueue service IPC calls    
10430 enable ges/gcs dynamic remastering event trace    
10431 enable verification messages on pi consistency    
10432 enable tracing of global cache service fusion calls    
10433 global enqueue service testing event    
10434 enable tracing of global enqueue service multiple LMS    
10435 enable tracing of global enqueue service deadlock detetction    
10436 enable global cache service duplicate ping checking    
10437 enable trace of global enqueue service S optimized resources    
10438 force lowest node to be master of all gcs resources    
10439 enable tracing of global cache service fusion calls - part 2    
10440 enable global enqueue service inquire resource modes trace    
10441 enable diagnosibility daemon (DIAG) trace    
10442 enable trace of kst for 01555 diagnostics    
10443 reserved for data layer diagnostics and debugging    
10444 enable DLM timeout testing    
10445 enable tracing of LMS priority management    
10446 reserved for data layer diagnostics and debugging    
10447 reserved for data layer diagnostics and debugging    
10448 Dump trace for OLTP partial compression features diagnostics    
10449 enable trace of kst for undo manageability features diagnostics    
10450 signal ctrl-c in kdddca (drop column) after n rows    
10451 Force heap segment compression bypassing compatibility checks    
10452 Cannot do block media recovery; media recovery session may be in progress    
10453 Dump compression statistics to trace file    
10454 Disable column reordering during compression    
10455 Do Compression Block Checking    
10456 cannot open standby database; media recovery session may be in progress    
10457 cannot close standby database due to active media recovery    
10458 standby database requires recovery    
10459 cannot start media recovery on standby database; conflicting state detected    
10460 Perform backward tablescans for consistent read reduction    
10461 Simulate control file corruption during write operation    
10462 enable recovery debug module    
10463 enable controlfile test    
10464 enable incremental checkpoint debug for split brain check    
10465 force slave death during parallel crash recovery    
10466 enable HARD check for block write    
10467 amplify control file record expansion for testing    
10468 log writer debug module    
10469 error creating control file backup, no checkpoint    
10470 disable compatibility check for lost write detection 10470, 00000, "disable compatibility check for lost write detection"
// *Document: NO
// *Cause:
// *Action: Set this event to run database with lost write detection
//          enabled in compatibility mode below 11.0.
//          Level 1: equivalent of "typical" setting
//          Level 2: equivalent of "full" setting
//          for the parameter db_lost_write_protect

12c中,
Lost write detection related event
10470, 00000, "Lost write detection related event"
// *Document: NO
// *Cause:
// *Action: Set this event to enable certain lost write detection related
//          functionalities.
 
10471 PQ slave allocation timeout test    
10472 dump reading log buffer hit ratio histogram to lgwr trace file    
10473 enable BRR tracing    
10474 controlfile time tracing    
10475 readable standby debug event    
10476 control file corruption range testing    
10477 simulated rollback error    
10478 DBW0 file identification trace event    
10479 disk sector size test event    
10480 Soft asserts for fast detection of datafile storage problems    
10481 Backup data block for data file has an unlogged change    
10482 Automatic block repair cannot repair an offline or read-only data file    
10483 Simulate overly advanced incremental checkpoint    
10484 Enable test move operation 12c中,Enable tracing for online data file move operation  
10485 Real-Time Query cannot be enabled while applying migration redo.    
10486 Verify data file-related SGA alignment    
10487 Dump redo memory protection information.    
10488 Dump block headers read for media recovery.    
10489 Generate future redo for testing    
10490 Trace OSM misc. events    
10491 Trace OSM messaging (KFN) events    
10492 Trace OSM metadata events    
10493 Return empty define buffers on 1422    
10494 Trace OSM metadata events    
10495 Trace OSM metadata events    
10496 Turn off fix for bug 2554178    
10497 Trace OSM metadata events    
10498 Trim blank characters including contol characters    
10499 Trace OSM metadata events    
10500 turn on traces for SMON 跟蹤SMON程式  
10501 periodically check selected heap    
10502 CBO disable the fix for bug 2098120    
10503 enable user-specified graduated bind lengths    
10504 CBO disable the fix for bug 2607029    
10505 CBO enable dynamic sampling dump to table    
10506 Disable fix for bug 2588217    
10507 Trace bind equivalence logic    
10508 Enable fix for bug 14772545    
10509 Check kghu subheaps at call boundaries    
10510 turn off SMON check to offline pending offline rollback segment    
10511 turn off SMON check to cleanup undo dictionary    
10512 turn off SMON check to shrink rollback segments    
10513 turn on IPC (ksmsq) debugging    
10515 turn on event to use physical cleanout    
10519 enable ALTER TYPE RESET support    
10520 recreate view only if definition has changed    
10521 CMON connection pool test event    
10522 turn off wrap source compression    
10523 force recreate package even if definition is unchanged    
10524 CMON connection pool trace event    
10525 Disable automatic object validation for describe    
10526 enables lightweight thread tracing    
10527 enables SGA allocation tracing    
10528 enables ksmg tracing    
10530 lightweight thread spawn failed, error stack:    
10531 lightweight thread unit test failure error      
10532 lightweight thread encountered internal error    
10542 Enable tracing for block compare    
10543 Standby Block Media Recovery (bmr) and split brain testing event    
10544 Inject standby autobmr failures    
10545 Print standby autobmr messages in alert log    
10546 Cannot perform block media recovery; standby database does not have requisite redo.    
10547 Cannot perform block media recovery; standby database is not caught up with primary.    
10548 Cannot perform block media recovery on a read-only plugged-in datafile.    
10549 Cannot perform block media recovery using a read-only plugged-in backup datafile.    
10550 signal error during create as select/create index after n rows    
10551 Internal testing for 1551 error handling    
10552 allow unlimited corruption during recovery    
10553 Incompatible UNTIL CONSISTENT clause    
10554 Media recovery failed to bring datafile  to a consistent point    
10555 Disable redo dumping    
10556 Enable tracing for multi instance Redo Apply                     
10557 NID clears database incarnation section in controlfile           
10558 Disable unkeep marker handling for ADG                           
10559 LGWR code path debugging event for deferred log flush on ping     
10560 block type ''    
10561 block type '', data object#     
10562 Error occurred while applying redo to data block (file# , block# )    
10563 Test recovery had to corrupt data block (file# , block# ) in order to proceed    
10564 tablespace     
10565 Another test recovery session is active    
10566 Test recovery has used all the memory it can use    
10567 Redo is inconsistent with data block (file# , block# , file offset is  bytes)    
10568 Failed to allocate recovery state object: out of SGA memory    
10569 Trace datafile header writes    
10570 Test recovery complete    
10571 Test recovery canceled    
10572 Test recovery canceled due to errors    
10573 Test recovery tested redo from change  to     
10574 Test recovery did not corrupt any data block    
10575 Give up restoring recovered datafiles to consistent state: out of memory    
10576 Give up restoring recovered datafiles to consistent state: some error occurred    
10577 Can not invoke test recovery for managed standby database recovery    
10578 Can not allow corruption for managed standby database recovery    
10579 Can not modify control file during test recovery    
10580 Can not modify datafile header during test recovery    
10581 Can not modify redo log header during test recovery    
10582 The control file is not a backup control file    
10583 Can not recovery file  renamed as missing during test recovery    
10584 Can not invoke parallel recovery for test recovery    
10585 Test recovery can not apply redo that may modify control file    
10586 Test recovery had to corrupt 1 data block in order to proceed    
10587 Invalid count for ALLOW n CORRUPTION option    
10588 media recovery file header validation    
10589 Test recovery had to corrupt  data blocks in order to proceed    
10590 kga (argus debugger) test flags    
10591 kga (argus debugger) test flags    
10592 kga (argus debugger) test flags    
10593 kga (argus debugger) test flags    
10594 kga (argus debugger) test flags    
10595 kga (argus debugger) test flags    
10596 kga (argus debugger) test flags    
10597 kga (argus debugger) test flags    
10598 kga (argus debugger) test flags    
10599 kga (argus debugger) test flags    
10600 check cursor frame allocation    
10601 turn on debugging for cursor_sharing (literal replacement)    
10603 cause an error to occur during truncate (for testing purposes)    
10604 trace parallel create index    
10605 enable parallel create index by default    
10606 trace parallel create index    
10607 trace index rowid partition scan    
10608 trace create bitmap index 跟蹤點陣圖索引的建立   
10609 trace for array index insertion    
10610 trace create index pseudo optimizer    
10611 causes migration to fail - testing only    
10612 prints debug information for auto-space managed segments    
10613 prints debug information for auto-space managed segments    
10614 Operation not allowed on this segment    
10615 Invalid tablespace type for temporary tablespace    
10616 Operation not allowed on this tablespace    
10617 Cannot create rollback segment in dictionary managed tablespace    
10618 Operation not allowed on this segment    
10619 Avoid assertions when possible    
10620 Operation not allowed on this segment    
10621 specify retry count for online index build cleanup DML lock get    
10622 test/trace online index (re)build test or trace online index build or rebuild  
10623 test synchronized flow of SORT rows into FOR UPDATE lock phase    
10624 Disable UJV invalidation on drop index    
10625 Turn off redo log dump for the index when OERI 12700    
10626 specify timeout for online index rebuild to wait for DML    
10627 Dump the content of the index leaf block    
10628 Turn on sanity check for kdiss index skip scan state    
10629 force online index build to backoff and retry DML lock upgrade    
10630 Illegal syntax specified with SHRINK clause    
10631 SHRINK clause should not be specified for this object    
10632 Invalid rowid    
10633 No space found in the segment    
10634 Segment is already being shrunk    
10635 Invalid segment or tablespace type    
10636 ROW MOVEMENT is not enabled    
10637 The segment does not exist    
10638 Index status is invalid    
10639 Dump library cache during reparse loops    
10640 Operation not permitted during SYSTEM tablespace migration    
10641 Cannot find a rollback segment to bind to    
10642 Found rollback segments in dictionary managed tablespaces    
10643 Database should be mounted in restricted mode and Exclusive mode    
10644 SYSTEM tablespace cannot be default temporary tablespace    
10645 Recursive Extension in SYSTEM tablespace during migration    
10646 Too many recursive extensions during SYSTEM tablespace migration    
10647 Tablespace other than SYSTEM, ,  not found in read only mode    
10648 Tablespace SYSAUX is not offline    
10649 Turn off/trace lob index freelist coalesce    
10650 disable cache-callback optimisation    
10651 incorrect file number block number specified    
10652 Object has on-commit materialized views    
10653 Table is in a cluster    
10654 Table is of type temporary or external    
10655 Segment can be shrunk    
10656 Table is in unusable state due to incomplete operation    
10657 Lob column to be shrunk does not exist    
10658 Lob column to be shrunk is marked unused    
10659 Segment being shrunk is not a lob    
10660 Segment is a shared lob segment    
10661 Invalid option specified    
10662 Segment has long columns    
10663 Object has rowid based materialized views    
10664 Table has bitmap join indexes    
10665 Inject Evil Literals    
10666 Do not get database enqueue name    
10667 Cause sppst to check for valid process ids    
10668 Inject Evil Identifiers    
10690 Set shadow process core file dump type (Unix only)    
10691 Set background process core file type (Unix only)    
10693 Internal event    
10700 Alter access violation exception handler    
10701 Dump direct loader index keys    
10702 Application continuity debugging was not enabled    
10706 Print out information about global enqueue manipulation 跟蹤全域性enqueues   
10707 Simulate process death for instance registration    
10708 print out trace information from the RAC buffer cache 跟蹤RACbuffer cache   
10709 enable parallel instances in create index by default    
10718 event to disable automatic compaction after index creation    
10719 trace bitmap index dml    
10720 trace db scheduling    
10721 Internal testing - temp table transformation    
10722 set parameters for CPU frequency calculation (debug) 12c中,trace server level database scheduling  
10723 Internal testing - release buffer for buffer cache shrink    
10724 trace cross-instance broadcast    
10725 bitmap index version control    
10726 frequent itemset counting    
10727 introduce failure events in IPC    
10728 set parameters for CPU frequency calculation (debug)    
10732 honor pctfree during insert into AQ IOTs    
10733 test transient-IOT metadata during PMO cleanup    
10734 reroute external procedures    
10735 debug ksws operations    
10736 buffer cache pin history dump    
10737 test block checking    
10738 internal block testing    
10739 debug WLM (kywm) operations    
10740 disables fix for bug 598861    
10741 trace missing BRR generation               
10742 dump process state on flush buffer_cache    
10743 define the misbehaved vt dump thresholds    
10744 disable LMD stale cvak traces and dumps     
10745 enable LCK1 kqlmbivg-NULL-kglhdrac dump     
10746 enable KGCE_DEBUG_MODE                     
10750 test rollback segment blksize guessing for index array insert    
10751 override for remote row source maximum buffer size    
10752 override for the Exponential Moving Average factor    
10753 enforce deterministic behaviour for prefetching row source    
10754 disable fix for bug 14173995 for multi-table select for update           
10755 Event to store SIG_1551 stacks to KST                                    
10756 Event to enable svpt/autotxn tracing                                     
10757 Event to control tracing row source: rows to dump per rowset             
10758 Event to control tracing row source: start row number                    
10759 Event to control tracing row source: end row number                      
10760 Event to control tracing row source: maximum encoded operands to check    
10761 Event to control tracing row source: size of dictionary                  
10780 LogMiner API trace event    
10781 LogMiner reader trace event    
10782 LogMiner preparer trace event    
10783 LogMiner builder trace event    
10784 LogMiner dictionary trace event    
10785 LogMiner trace event    
10786 call push/pop (KSU)    
10787 trace intra-instance broadcast    
10788 trace call stacks    
10789 LogMiner test event    
10790 LogMiner trace event    
10791 Logical Standby swithover/failover trace event    
10792 Logical Standby XDAT trace event    
10793 Logical Standby trace event    
10794 Logical Standby trace event    
10795 VKTM Process trace event    
10796 Elevate Scheduler Priority trace event    
10797 Logical Standby Test Event    
10798 debug GSM operations    
10800 disable Smart Disk scan    
10804 reserved for ksxb    
10806 Switch to 7.3 mode when detaching sessions    
10807 Disable user id check when switching to a global transaction    
10808 Enable assert when waiting without a reason    
10809 Trace state object allocate / free history    
10810 Trace snapshot too old    
10811 Trace block cleanouts    
10812 Trace Consistent Reads    
10826 enable upgrade/downgrade error message trace    
10827 enable upgrade/downgrade diagnostics    
10828 memory allocator error    
10830 Trace group by sort row source    
10831 Trace group by rollup row source    
10832 Trace approximate NDV row source    
10833 Runtime distribution keys for adaptive partial rollup             
10834 Runtime behavior control for adaptive partial rollup              
10835 exclude SYS_OP_CYCLED_SEQ from TQ keys for scalable percentile     
10839 trace / debug caching module (qesca.c)    
10840 trace / debug pl/sql caching module (kkxmInitCache)    
10841 Default un-inintialized charact set form to SQLCS_IMPLICIT    
10842 Event for OCI Tracing and Statistics Info    
10843 Event for client result cache tracing    
10844 turn on Native Net IPC debugging (skgxp)    
10845 Enable Director tracing    
10846 Enable Director Single Node Testing 12c中,Event for non-blocking testing  
10847 OCI dump action is being invoked for internal error     
10848 OCI Non Blocking not supported with     
10849 Internal OCI event number    
10850 Enable time manager tracing    
10851 Allow Drop command to drop queue tables    
10852 Enable tracing for Enqueue Dequeue Operations    
10853 Enable tracing for Replicating AQ Operations    
10854 Sets poll count used for AQ listen code under RAC    
10856 Disable AQ propagator from using streaming    
10857 Force AQ propagator to use two-phase commit    
10858 Crash the AQ propagator at different stages of commit    
10859 Disable updates of message retry count    
10860 event for AQ admin disable new name parser    
10861 disable storing extended message properties    
10862 resolve default queue owner to current user in enqueue/dequeue    
10863 Control behavior of buffered background operations    
10864 event to enable AQ dedicated propagation    
10865 Control tracing of notification operations    
10866 event to order dequeue by condition    
10867 event to turn off authentication for emon to oci client connections 12c中,turn off authentication for emon to oci client and disable HA rstat  
10868 event to enable interop patch for AQ enqueue options    
10870 Disable multi-instance standby role transition    
10871 dump file open/close timestamp during media recovery    
10872 Flashback Database fault insertion event #.    
10873 file  needs to be either taken out of backup mode or media recovered    
10874 Change max logfiles in hashtable in krfbVerifyRedoAvailable    
10875 Require instance bounce after switchover to primary    
10876 IDR Test event    
10877 error signaled in parallel recovery slave     
10878 parallel recovery slave died unexpectedly    
10879 error signaled in parallel recovery slave     
10880 trace Java VM execution    
10883 Event for Fast Application Notification tracing     
10884 TTC event                                          
10885 Switchover test event    
10886 Recovery test event                                                                                                        
10887 An Oracle Active Data Guard license is required to open a pluggable database while standby recovery is applying changes.    
10888 TTC event for optimized fetch                                                                                              
10889 minimum number of instances needed for redo apply unavailable                                                              
10890 ADG test event    
10891 disable column pruning in ANSI join transformation    
10892 multi-instance redo apply encountered nonlogged operation    
10893 TTC trace event                                             
10898 LGWR timing event    
10900 extent manager fault insertion event #    
10901 disable the fix for bug 1230798    
10902 disable seghdr conversion for ro operation    
10903 Force tablespaces to become locally managed    
10904 Allow locally managed tablespaces to have user allocation    
10905 Do cache verification (kcbcxx) on extent allocation    
10906 Unable to extend segment after insert direct load    
10907 Trace extent management events    
10908 Trace temp tablespace events    
10909 Trace free list events    
10910 inject corner case events into the RAC buffer cache    
10911 Locally managed SYSTEM tablespace bitmaps can be modified only under the supervision of Oracle Support    
10912 Used to perform admin operations on locally managed SYSTEM tablespace    
10913 Create locally managed database if compatible > 920 by default    
10914 invalid TABLESPACE GROUP clause    
10915 TABLESPACE GROUP cannot be specified for this type of tablespace    
10916 TABLESPACE GROUP already specified    
10917 TABLESPACE GROUP cannot be specified    
10918 TABLESPACE GROUP name cannot be the same as tablespace name    
10919 Default temporary tablespace group must have at least one tablespace    
10920 Cannot offline tablespace belonging to default temporary tablespace group    
10921 Cannot drop tablespace belonging to default temporary tablespace group    
10922 Temporary tablespace group is empty    
10923 prints debug information for object space server manageability    
10924 import storage parse error ignore event    
10925 trace name context forever    
10926 trace name context forever    
10927 trace name context forever    
10929 trace name context forever    
10930 trace name context forever    
10931 trace name context forever    
10932 trace name context forever    
10933 trace name context forever    
10934 trace name context forever    
10936 trace name context forever    
10937 trace name context forever    
10939 trace name context forever    
10940 trace name context forever    
10941 trace name context forever    
10943 trace name context forever    
10944 trace name context forever    
10945 trace name context forever    
10946 trace name context forever    
10947 trace name context forever    
10948 trace name context forever    
10949 Disable autotune direct path read for full table scan    
10960 AQ tracing event    
10961 Enable tracing for Scheduler subscriber cleanup    
10970 backout event for bug 2133357    
10971 prints debugging information for LOBs    
10972 raise a 1551 exception in kdu_array_flush    
10973 backout evet for 2619509    
10974 Turn on LOB integrity verification    
10975 trace execution of parallel propagation    
10976 internal package related tracing    
10977 trace event for RepAPI    
10978 general event for materialized view logs    
10979 trace flags for join index implementation    
10980 prevent sharing of parsed query during Materialized View query generation    
10981 dscn computation-related event in replication    
10982 event to turn off CDC-format MV Logs    
10983 event to enable Create_Change_Table debugging    
10984 subquery materialized view-related event    
10985 event for NULL refresh of materialized views    
10986 donot use HASH_AJ in refresh    
10987 event for the support of caching table with object feature    
10988 event to get exclusive lock during materialized view refresh in IAS    
10989 event to internally create statistics MV    
10990 dump spreadsheet info    
10991 event for optimizing the online redefinition instantiation    
10992 event to enable dbms_job instead of dbms_scheduler    
10993 Runtime enable IOQ batching    
10994 Compiletime enable IOQ batching    
10995 general event for materialized views    
10997 another startup/shutdown operation of this instance inprogress    
10998 event to enable short stack dumps in system state dumps    
10999 do not get database enqueue name    
28401   遮蔽密碼延遲驗證,
28401, 00000, "Event to disable delay after three failed login attempts"
// *Document: NO
// *Cause: N/A
// *Action: Set this event in your environment to disable the login delay
//          which will otherwise take place after three failed login attempts.
// *Note: THIS IS NOT A USER ERROR NUMBER/MESSAGE. THIS DOES NOT NEED TO BE
//        TRANSLATED OR DOCUMENTED.
ALTER SYSTEM SET EVENTS '28401 TRACE NAME CONTEXT FOREVER, LEVEL 1';--遮蔽密碼延遲驗證
ALTER SYSTEM SET EVENTS '28401 TRACE NAME CONTEXT OFF'; --
關閉28401
事件
5614566   如果資料庫版本為Oracle 10g以前,那麼只能清空整個Shared Pool,命令為:“ALTER SYSTEM FLUSH SHARED_POOL;”。在Oracle 10g中提供了一個包DBMS_SHARED_POOL,該包可以實現該功能。若該包沒有安裝,則可以通過$ORACLE_HOME/rdbms/admin/dbmspool.sql進行安裝。在Oracle 10.2.0.4中有BUGMOS為:751876.1),需要通過設定事件來規避該問題,命令為: ALTER SESSION SET EVENTS '5614566 TRACE NAME CONTEXT FOREVER';”
使用這種方法,就可以精確的將一個SQL從共享池中刪除,從而使得Oracle為這個SQL重新生成執行計劃。這種方法只針對單個SQL語句,使得解決問題的同時不會造成任何的誤傷。

SYS@lhrdb>  SELECT ADDRESS,HASH_VALUE FROM V$SQLAREA WHERE ROWNUM<=1;
ADDRESS          HASH_VALUE
---------------- ----------
0000000092D263D0 3231842444
SYS@lhrdb> EXEC DBMS_SHARED_POOL.PURGE('0000000092D263D0,3231842444','C');
PL/SQL procedure successfull
ALTER SESSION SET EVENTS '5614566 TRACE NAME CONTEXT FOREVER';





About Me

...............................................................................................................................

本文作者:小麥苗,只專注於資料庫的技術,更注重技術的運用

本文在itpubhttp://blog.itpub.net/26736162)、部落格園http://www.cnblogs.com/lhrbest和個人微信公眾號(xiaomaimiaolhr)上有同步更新

本文itpub地址:http://blog.itpub.net/26736162/viewspace-2135959/

本文部落格園地址:http://www.cnblogs.com/lhrbest

本文pdf小麥苗雲盤地址:http://blog.itpub.net/26736162/viewspace-1624453/

● QQ群:230161599     微信群:私聊

聯絡我請加QQ好友(646634621),註明新增緣由

2017-04-28 09:00 ~ 2017-04-30 22:00魔都完成

文章內容來源於小麥苗的學習筆記,部分整理自網路,若有侵權或不當之處還請諒解

版權所有,歡迎分享本文,轉載請保留出處

...............................................................................................................................

拿起手機使用微信客戶端掃描下邊的左邊圖片來關注小麥苗的微信公眾號:xiaomaimiaolhr,掃描右邊的二維碼加入小麥苗的QQ群,學習最實用的資料庫技術。

Oracle所有診斷事件列表events
DBA筆試面試講解
歡迎與我聯絡

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26736162/viewspace-2135959/,如需轉載,請註明出處,否則將追究法律責任。

相關文章