ORACLE事件跟踪(二)
race name heapdump_addr level n';
若n为subheap的地址,转储的是subheap的摘要信息
若n为subheap的地址+1,转储的则是subheap的内容
oracle 9.2.0版本之后
Alter SESSION SET EVENTS 'immediate trace name heapdump_addr level n, addr m';
其中m为subheap的地址
n为1转储subheap的摘要,n为2转储subheap的内容
8).Process State
Alter SESSION SET EVENTS 'immediate trace name processstate level n';
9).System State
Alter SESSION SET EVENTS 'immediate trace name systemstate level n';
10).Error State
Alter SESSION SET EVENTS 'immediate trace name errorstack level n';
0 Error stack
1 level 0 + function call stack
2 level 1 + process state
3 level 2 + context area
11).Hang Analysis
Alter SESSION SET EVENTS 'immediate trace name hanganalyze level n';
12).Work Area
Alter SESSION SET EVENTS 'immediate trace name workareatab_dump level n';
1 SGA信息
2 Workarea Table摘要信息
3 Workarea Table详细信息
13).Latches
Alter SESSION SET EVENTS 'immediate trace name latches level n';
1 latch信息
2 统计信息
14).Events
Alter SESSION SET EVENTS 'immediate trace name events level n';
1 session
2 process
3 system
15).Locks
Alter SESSION SET EVENTS 'immediate trace name locks level n';
16).Shared Server Process
Alter SESSION SET EVENTS 'immediate trace name shared_server_state level n';
n取值为1~14
17).Background Messages
Alter SESSION SET EVENTS 'immediate trace name bg_messages level n';
n为pid+1
二.File Dumps
1).Block
oracle 7之前
Alter SESSION SET EVENTS 'immediate trace name blockdump level n';
n为block的rdba
oracle8以后
Alter SYSTEM DUMP DATAFILE file# BLOCK block#;
Alter SYSTEM DUMP DATAFILE file#
BLOCK MIN minimum_block#
BLOCK MAX maximum_block#
2).Tree Dump 查看索引的结构
Alter SESSION SET EVENTS 'immediate trace name treedump level n';
n为object_id
object_id可以从select object_id from user_objects where object_name = '索引的名字'得到。
3).Undo Segment Header 查看回滚段头部信息
Alter SYSTEM DUMP UNDO_HEADER 'segment_name';
4).Undo for a Transaction
Alter SYSTEM DUMP UNDO BLOCK 'segment_name' XID xidusn xidslot xidsqn;
5).File Header
Alter SESSION SET EVENTS 'immediate trace name file_hdrs level n';
1 控制文件中的文件头信息
2 level 1 + 通用文件头信息
3 level 2 + 数据完整文件头信息
10 level 3
6).Control file
Alter SESSION SET EVENTS 'immediate trace name controlf level n';
1 控制文件中的文件头信息
2 level 1 + 数据库信息 + 检查点信息
3 level 2 + 可重用节信息
10 level 3
7).Redo log Header
Alter SESSION SET EVENTS 'immediate trace name redohdr level n';
1 控制文件中的redo log信息
2 level 1 + 通用文件头信息
3 level 2 + 完整日志文件头信息
10 level 3
8).Redo log
Alter SYSTEM DUMP LOGFILE 'FileName';
Alter SYSTEM DUMP LOGFILE 'FileName'
SCN MIN MinimumSCN
SCN MAX MaximumSCN
TIME MIN MinimumTime
TIME MAX MaximumTime
LAYER Layer
OPCODE Opcode
DBA MIN FileNumber . BlockNumber
DBA MAX FileNumber . BlockNumber
RBA MIN LogFileSequenceNumber . BlockNumber
RBA MAX LogFileSequenceNumber . BlockNumber;
其中time = (((((yyyy - 1988)) * 12 + mm - 1) * 31 + dd - 1) * 24 + hh) * 60 + mi) * 60 + ss;
详细内容请看:http://blog.csdn.net/yidian815/article/details/12568027
9).Loghist
Alter SESSION SET EVENTS 'immediate trace name loghist level n';
n=1 dump控制文件中最早和最迟的日志历史项
n>1 dump 2^n个日志历史项