g2stone
作者g2stone·2010-07-15 22:55
工程师·shict

redo日志损坏恢复(一)

字数 4143阅读 2748评论 0赞 1
redo日志损坏症状:
1、在数据库启动时报告如下信息:
  SQL> startup
ORACLE instance started.
Total System Global Area  264241152 bytes
Fixed Size                  1218868 bytes
Variable Size              75499212 bytes
Database Buffers          184549376 bytes
Redo Buffers                2973696 bytes
Database mounted.
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: '/oracle/data/primary/redo01.log'
查看告警日志可以看到如下信息:
Thu Jul 15 19:25:38 2010
Errors in file /oracle/app/admin/primary/bdump/primary_lgwr_8466.trc:
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: '/oracle/data/primary/redo01.log'
ORA-27046: file size is not a multiple of logical block size ##该行指出redo日志被修改过了
Additional information: 1
Thu Jul 15 19:25:38 2010
ARC1: STARTING ARCH PROCESSES
ARC2 started with pid=18, OS id=8503
Thu Jul 15 19:25:38 2010
ARC2: Archival started
ARC1: STARTING ARCH PROCESSES COMPLETE
ARC1: Becoming the 'no FAL' ARCH
ARC1: Becoming the 'no SRL' ARCH
Thu Jul 15 19:25:38 2010
ARC0: Becoming the heartbeat ARCH
Thu Jul 15 19:25:38 2010
ORA-313 signalled during: ALTER DATABASE OPEN...
查看trc文件信息如下:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
ORACLE_HOME = /oracle/app/product/10g/db_1
System name:    Linux
Node name:      centOS
Release:        2.6.18-53.el5xen
Version:        #1 SMP Mon Nov 12 03:26:12 EST 2007
Machine:        i686
Instance name: primary
Redo thread mounted by this instance: 1
Oracle process number: 6
Unix process pid: 8466, image: oracle@centOS (LGWR)
*** SERVICE NAME:() 2010-07-15 19:25:38.227
*** SESSION ID:(166.1) 2010-07-15 19:25:38.227
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: '/oracle/data/primary/redo01.log'
ORA-27046: file size is not a multiple of logical block size
Additional information: 1
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: '/oracle/data/primary/redo01.log'
ORA-27046: file size is not a multiple of logical block size
Additional information: 1
通过以上信息可以看出redo日志组的第一个成员redo01.log文件损坏了(文件变长或变短了)。
查看日志信息,如下可以看出损坏的日志组1 的状态为INCATIVE,该日志已经归档,并且该日志文件并不是当前日志文件。
SQL> select group#,status,archived from v$log;
    GROUP# STATUS           ARC
---------- ---------------- ---
         1 INACTIVE         YES
         3 INACTIVE         YES
         2 CURRENT          NO
查看损坏的日志文件的状态,stale表明该文件内容不完全(INVALID表明该文件不可访问。STALE表明该文件内容不完全,例如正在添加一个日志文件成员。DELETED表明该文件已不再使用。空白表明文件正在使用中。)
SQL> select group#,status, member from v$logfile;
    GROUP#    STATUS        MEMBER
   ---------- ---------     -------
    1         STALE        /oracle/data/primary/redo01.log

修复损坏的日志文件(在mount状态下):
1、删除损坏的日志文件
   SQL> alter dababase drop logfile member '/oracle/data/primary/redo01.log';
    由于当前日志组1中仅有一个成员,因此无法删除。
    ERROR at line 1:
    ORA-00361: cannot remove last log member /oracle/data/primary/redo01.log for group 1
2、由于以上操作无法进行,因此重新初始化损坏的日志文件。  
    SQL> alter database clear logfile group 1;
    Database altered.
3、open数据库
    SQL> alter database open;
今天先写到这里,明天继续。

如果觉得我的文章对您有用,请点赞。您的支持将鼓励我继续创作!

1

添加新评论0 条评论

Ctrl+Enter 发表

相关文章

相关问题

相关资料

X社区推广