墨墨导读:前几天某客户遇到这个问题:文件系统损坏导致Current redo log异常,最终恢复过程比较简单,这里不再累述。本文详述redo log os header block损坏的处理过程,希望对大家有帮助。
如下是简单测试过程:
SQL> select * from v$Log;
GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARCHIV STATUS FIRST_CHANGE# FIRST_TIME NEXT_CHANGE# NEXT_TIME CON_ID
---------- ---------- ---------- ---------- ---------- ---------- ------ -------------------------------- ------------- ------------ ------------ ------------ ----------
1 1 21 209715200 512 1 NO INACTIVE 13356440 12-MAY-20 13356445 12-MAY-20 0
2 1 22 209715200 512 1 NO CURRENT 13356445 12-MAY-20 9.2954E+18 0
3 1 19 209715200 512 1 NO INACTIVE 13356426 12-MAY-20 13356435 12-MAY-20 0
4 1 20 104857600 512 1 NO INACTIVE 13356435 12-MAY-20 13356440 12-MAY-20 0
SQL> select member from v$Logfile;
MEMBER
--------------------------------------------------
/opt/oracle/oradata/ENMOTECH/redo03.log
/opt/oracle/oradata/ENMOTECH/redo02.log
/opt/oracle/oradata/ENMOTECH/redo01.log
/opt/oracle/oradata/ENMOTECH/redo04.log
SQL> shutdown abort;
ORACLE instance shut down.
SQL> host
[oracle@mysqldb1 ~]$ cp /opt/oracle/oradata/ENMOTECH/redo02.log /opt/oracle/oradata/ENMOTECH/redo02.log.bak
这里我们分别dump一下redo log的os block:
[oracle@mysqldb1 ~]$ dd if=/opt/oracle/oradata/ENMOTECH/redo02.log bs=512 count=1 | od -x
1+0 records in
1+0 records out
512 bytes (512 B) copied, 4.6621e-05 s, 11.0 MB/s
0000000 2200 0000 0000 ffc0 0000 0000 0000 0400
0000020 9dc3 0000 0200 0000 4000 0006 7c7d 7a7b
0000040 0003 0000 0000 0000 0000 0000 0000 0000
0000060 0000 0000 0000 0000 0000 0000 0000 0000
*
0001000
[oracle@mysqldb1 ~]$ dd if=/opt/oracle/oradata/ENMOTECH/redo01.log bs=512 count=1 | od -x
1+0 records in
1+0 records out
512 bytes (512 B) copied, 6.8299e-05 s, 7.5 MB/s
0000000 2200 0000 0000 ffc0 0000 0000 0000 0400
0000020 9dc3 0000 0200 0000 4000 0006 7c7d 7a7b