oracle dump trace redo幾則方法小記__oracle

來源:互聯網
上載者:User

在之前測試已經使用了基於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

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.