标签:
通常会用到以下两个命令:
1.‘alter session‘命令用来dump redo日志的文件头
2.‘alter system dump logfile‘命令用来dump redo文件的内容
以上命令也可以对归档日志进行dump。输出结果存放在session的trace文件中。
可以根据以下方式对redo日志进行dump:
(1) To dump records based in DBA (Data Block Address)
语法:
alter system dump logfile ‘<filename>‘ dba min <fileno> <blockno> dba max <fileno> <blockno>;
# <fileno> <blockno>用空格分隔。
示例:
SQL> alter system dump logfile ‘/u01/app/oracle/oradata/db11/redo01.log‘ dba min 3 3 dba max 3 32;
(2) To dump records based on RBA (Redo Block Address)
语法:
alter system dump logfile ‘<filename>‘ rba min <seqno> <blockno> rba max <seqno> <blockno>;
# <seqno> <blockno>用空格分隔。
示例:
SQL> alter system dump logfile ‘/u01/app/oracle/oradata/db11/redo02.log‘ rba min 84 3 rba max 84 23;
(3) To dump records based on SCN
语法:
alter sstem dump logfile ‘<filename>‘ scn min <minscn> scn max <maxscn>;
示例:
SQL> alter system dump logfile ‘/u01/app/oracle/oradata/db11/redo02.log‘ scn min 1680008 scn max 1690008;
(4) To dump records based on time
语法:
alter system dump logfile ‘<filename>‘ time min <value> time max <value>;
#这里的<value>是 redo dump time
示例:
SQL> alter system dump logfile ‘/u01/app/oracle/oradata/db11/redo02.log‘ time min 233 time max 443;
(5) To dump records based on layer and opcode
layer和opcode被用来dump某种类型的redo信息,比如所有的drop的行
语法:
alter system dump ‘<filename>‘ layer <value> opcode <value>;
示例:
SQL> alter system dump logfile ‘/u01/app/oracle/oradata/db11/redo02.log‘ layer 11 opcode 3;
(6) Dump the file header information
SQL> alter session set events ‘immediate trace name redohdr level 10‘;
如果是归档日志,可以使用以下命令:
SQL> alter system dump logfile ‘<filename>‘ rba min 1 1 rba max 1 1;
(7) Dump an entire log file
alter system dump logfile ‘<filename>‘;
从11g开始,可以使用‘alter system dump redo ...‘将对多个reod文件的dump结果合并到一个trace文件中
标签:
原文地址:http://www.cnblogs.com/abclife/p/5770206.html