http://blog.csdn.net/liweiah/article/details/4354563
大家在学习研究ORACLE的过程中,为了更深入的了解内部的机制,免不了要进程DUMP来研究学习, 下面我把学习过程中不断整理的各个DUMP罗列出来,希望大家指明错误和进行补充,共同进步!
—————————————————————————————
1、DUMP出控制文件 alter system (session) set events 'immediate trace name controlf level 10'
—————————————————————————————
2、DUMP出日志文件分析 alter system dump logfile logfilename;
—————————————————————————————
3、DUMP出日志文件头分析 alter session set events 'immediate trace name REDOHDR level 10'
———————————————————————————
4、DUMP出LIBRARY CACHE alter system (session) set events 'immediate trace name library_cache level 10'
—————————————————————————————
5、 DUMP出share_pool alter system (session) set events 'immediate trace name heapdump level 10'
———————————————————————————
6、DUMP出所有数据文件头 alter system (session) set events 'immediate trace name file_hdrs level 10';
———————————————————————————
7、DUMP出数据文件(只能是alter system)
alter system dump datafile n block m 如 select file_id,block_id,blocks from dba_extents where segment_name='EMPLOYEES' FILE_ID BLOCK_ID BLOCKS ---------- ---------- ---------- 5 81 8
SQL>; alter system dump datafile 5 block 81;
System altered. 另外是做很具体的针对某行所在的BLOCK 并DUMP出来研究,可以用如下方法
1、取BLOCK号 select dbms_rowid.rowid_block_number(rowid) from wdjk1999;
DBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID) 78
2、取文件号 select file_id from dba_data_files where tablespace_name='WDJK1999'
FILE_ID
---------- 16
SQL>; alter system dump datafile 16 block 78;
System altered.
—————————————————————————
8、DUMP出索引 SQL> select object_id from dba_objects where object_name=upper('index_name'); OBJECT_ID ---------- 70591 SQL> ALTER SESSION SET EVENTS 'immediate trace name TREEDUMP level 70591';
—————————————————————————————
9、DUMP出回滚段信息 select xidusn,xidslot,xidsqn,ubafil,ubablk,ubasqn,ubarec from v$transaction;
XIDUSN XIDSLOT XIDSQN UBAFIL UBABLK UBASQN UBAREC ---------- ---------- ---------- ---------- ---------- ---------- ---------- 1 31 442 2 21 242 52 dump对应的undo block SYS@ning>alter system dump datafile 2 block 21; System altered.
——————————————————————————
10、 DUMP出系统状态分析 (只能是SYSTEM) alter system set events 'immediate trace name systemdate level 10'
——————————————————————————
11、 DUMP出分析进程状态分析 alter session set events 'immediate trace name PROCESSSTATE level 10'