在之前測試已經使用了基於dba的方法,本文測試其它幾種方法,如下:
1. To dump records based on RBA (Redo Block Address) --基於rda
2. To dump records based on time --基於時間
3. To dump records based on layer and opcode --基於內部作業碼的核心所在層;這個比較進階一般用不上
4. Dump the file header information --dump頭部資訊 ,查看redo header不錯的命令
1. To dump records based on RBA (Redo Block Address) --基於rda
既然要根據rba來dump redo,如何擷取rba,可採用:
alter system dump logfile 'dump的記錄檔';
或
alter system dump logfile 'D:\ORACLE11G_64BIT\ORADATA\ORCL\REDO07.LOG' dba min 10 276635 dba max 10 276635;
就可以產生如下的trace內容
REDO RECORD - Thread:1 RBA: 0x000314.0000e11f.0010 LEN: 0x00e0 VLD: 0x06
rba的組成及各部分含義:
(1)the log file sequence number (4 bytes)
(2)the log file block number (4 bytes)
(3)the byte offset into the block at which the redo record starts (2bytes)
--知道了rba含義,作事就簡單了,操作如下:
---記錄序號
SQL> select to_number('314','xxxxxxxxxxx') from dual;
TO_NUMBER('314','XXXXXXXXXXX')
------------------------------
788
--記錄檔中的塊號
SQL> select to_number('e11f','xxxxxxxxxxx') from dual;
TO_NUMBER('E11F','XXXXXXXXXXX'
------------------------------
57631
然後運行基於rba的命令
alter system dump logfile 'D:\ORACLE11G_64BIT\ORADATA\ORCL\REDO07.LOG' rba min 788 57631 rba max 788 57631;
第二種dump log的方法
2. To dump records based on time --基於時間
這個我就不測試,可按網上一個非常優秀的貼子進行測試:
http://blog.csdn.net/tianlesoftware/article/details/6670962
第三種dump log的方法
3. To dump records based on layer and opcode
---這個其實就是filter out指定操作類型的
SQL> alter system dump logfile 'D:\ORACLE11G_64BIT\ORADATA\ORCL\REDO07.LOG' layer 11 opcode 18;
System altered
第四種dump log的方法
4. Dump the file header information --dump頭部資訊 ,查看redo header不錯的命令
SQL> alter session set events 'immediate trace name redohdr level 6';
Session altered