日期:2014-05-16  浏览次数:20566 次

How to dump redo log entry?
1.转储针对特定数据块(4号文件的第10-20号数据块)修改的 redo entry
select file#,name,blocks from v$datafile;
     FILE# NAME                                                   BLOCKS
---------- -------------------------------------------------- ----------
         1 +DATA/test/datafile/system.269.829746597                89600
         2 +DATA/test/datafile/sysaux.270.829746621                76800
         3 +DATA/test/datafile/undotbs1.271.829746639              25600
         4 +DATA/test/datafile/users.273.829746667                   640

-转储 test 表第4行所在的数据块的修改记录         
SQL> select t.rowid,t.* from scott.test t;

ROWID                  DEPTNO DNAME          LOC
------------------ ---------- -------------- -------------
AAAPtpAAEAAAADbAAA         10 ACCOUNTING     NEW YORK
AAAPtpAAEAAAADbAAB         20 RESEARCH       DALLAS
AAAPtpAAEAAAADbAAC         30 SALES          CHICAGO
AAAPtpAAEAAAADbAAD         40 OPERATIONS     BOSTON  


SQL> select DBMS_ROWID.ROWID_OBJECT(rowid) as object#,
  2         DBMS_ROWID.ROWID_RELATIVE_FNO(rowid) as file#,
  3         dbms_rowid.rowid_block_number(rowid) as block#,
  4         DBMS_ROWID.ROWID_ROW_NUMBER(rowid) as row#
  5         from scott.test;

   OBJECT#      FILE#     BLOCK#       ROW#
---------- ---------- ---------- ----------
     64361          4        219          0
     64361          4        219          1
     64361          4        219          2
     64361          4        219          3

--当前属于 current 状态的 online redo log
SQL> select * from v$log;

    GROUP#    THREAD#  SEQUENCE#      BYTES  BLOCKSIZE    MEMBERS ARC STATUS           FIRST_CHANGE# FIRST_TIM NEXT_CHANGE# NEX