当前位置:  数据库>oracle

Oracle 联机日志文件损坏的几种场景和恢复方法

    来源: 互联网  发布时间:2017-06-05

    本文导语: Oracle联机日志文件记录数据库运行过程中数据块改变的日志,在数据库出现介质损坏或者异常挂掉后,需要通过联机日志(或归档)日志,重演数据库发生的改变。 在日志文件本身出现损坏(丢失)的情况下,数据库可能出现...

Oracle联机日志文件记录数据库运行过程中数据块改变的日志,在数据库出现介质损坏或者异常挂掉后,需要通过联机日志(或归档)日志,重演数据库发生的改变。
 
在日志文件本身出现损坏(丢失)的情况下,数据库可能出现无法正常打开,本文就是针对这种情况下进行的恢复测试(仅供参考):

Oracle调整联机重做日志大小(change redo log size)

Oracle 联机重做日志文件(ONLINE LOG FILE)

Oracle联机重做日志丢失的恢复

Oracle 联机重做日志文件(online redo log file) 详述

Oracle重做日志文件版本不一致问题处理

【备份与恢复】恢复受损的复用联机重做日志文件


一、日志文件损坏分类:
 
1、inactive 状态(不会造成数据丢失)
 
2、active、current状态(一般会造成数据丢失)
 
查看方法:
 
SQL> select group#,thread#,archived,status from v$log;
 
    GROUP#    THREAD# ARC STATUS
 ---------- ---------- --- ----------------
          1          1 YES INACTIVE
          2          1 NO  CURRENT
          3          1 YES INACTIVE

二、测试环境:
 
•OS: Linux xxxxxxxx  2.6.18-238.el5 #1 SMP Thu Jan 13 15:51:15 EST 2011 x86_64 x86_64 x86_64 GNU/Linux
•DB: oracle 11.2.0.1.6(非RAC)
 

三、inactive 状态日志文件损坏的恢复测试:
 
startup时错误日志:
 
SQL> startup
 ORACLE instance started.
 

Total System Global Area 3156877312 bytes
 Fixed Size                  2217424 bytes
 Variable Size            989858352 bytes
 Database Buffers        2147483648 bytes
 Redo Buffers              17317888 bytes
 Database mounted.
 ORA-03113: end-of-file on communication channel
 Process ID: 29499
 Session ID: 2273 Serial number: 5
 

alert错误日志:
 
Errors in file /u01/oracle/diag/rdbms/test/test/trace/test_lgwr_29457.trc:
 ORA-00313: open failed for members of log group 1 of thread 1
 ORA-00312: online log 1 thread 1: '/u01/test/test/redo01.log'
 ORA-27037: unable to obtain file status
 Linux-x86_64 Error: 2: No such file or directory
 Additional information: 3
 Errors in file /u01/oracle/diag/rdbms/test/test/trace/test_lgwr_29457.trc:
 ORA-00313: open failed for members of log group 1 of thread 1
 ORA-00312: online log 1 thread 1: '/u01/test/test/redo01.log'
 ORA-27037: unable to obtain file status
 Linux-x86_64 Error: 2: No such file or directory
 Additional information: 3
 Errors in file /u01/oracle/diag/rdbms/test/test/trace/test_ora_29499.trc:
 ORA-00313: open failed for members of log group 1 of thread
 ORA-00312: online log 1 thread 1: '/u01/test/test/redo01.log'
 USER (ospid: 29499): terminating the instance due to error 313
 Instance terminated by USER, pid = 29499
 

这种情况下,只需将active的日志组删除,然后startup,如下:
 
SQL> startup mount;
 ORACLE instance started.
 Total System Global Area 3156877312 bytes
 Fixed Size                  2217424 bytes
 Variable Size            989858352 bytes
 Database Buffers        2147483648 bytes
 Redo Buffers              17317888 bytes
 Database mounted.
 SQL> alter database drop logfile group 1;
 Database altered.
 SQL> alter database open;
 Database altered.

四、active、current日志文件损坏:
 
startup时错误:
 
SQL> startup
 ORACLE instance started.
 Total System Global Area 3156877312 bytes
 Fixed Size                  2217424 bytes
 Variable Size            989858352 bytes
 Database Buffers        2147483648 bytes
 Redo Buffers              17317888 bytes
 Database mounted.
 ORA-00313: open failed for members of log group 3 of thread 1
 ORA-00312: online log 3 thread 1: '/u01/test/test/redo03.log'
 ORA-27037: unable to obtain file status
 Linux-x86_64 Error: 2: No such file or directory
 Additional information: 3
 SQL> select group#,thread#,archived,status from v$log;
    GROUP#    THREAD# ARC STATUS
 ---------- ---------- --- ----------------
          1          1 NO  CURRENT
          3          1 YES ACTIVE
          2          1 YES INACTIVE 


alert日志错误:
 
Completed: ALTER DATABASE  MOUNT
 Fri Apr 25 16:49:21 2014
 ALTER DATABASE OPEN
 Beginning crash recovery of 1 threads
  parallel recovery started with 2 processes
 Started redo scan
 Errors in file /u01/oracle/diag/rdbms/test/test/trace/test_ora_29862.trc:
 ORA-00313: open failed for members of log group 3 of thread 1
 ORA-00312: online log 3 thread 1: '/u01/test/test/redo03.log'
 ORA-27037: unable to obtain file status
 Linux-x86_64 Error: 2: No such file or directory
 Additional information: 3
 Aborting crash recovery due to error 313
 Errors in file /u01/oracle/diag/rdbms/test/test/trace/test_ora_29862.trc:
 ORA-00313: open failed for members of log group 3 of thread 1
 ORA-00312: online log 3 thread 1: '/u01/test/test/redo03.log'
 ORA-27037: unable to obtain file status
 Linux-x86_64 Error: 2: No such file or directory
 Additional information: 3
 Errors in file /u01/oracle/diag/rdbms/test/test/trace/test_ora_29862.trc:
 ORA-00313: open failed for members of log group 3 of thread 1
 ORA-00312: online log 3 thread 1: '/u01/test/test/redo03.log'
 ORA-27037: unable to obtain file status
 Linux-x86_64 Error: 2: No such file or directory
 Additional information: 3
 ORA-313 signalled during: ALTER DATABASE OPEN...
 Fri Apr 25 16:49:21 2014
 Errors in file /u01/oracle/diag/rdbms/test/test/trace/test_m000_29874.trc:
 ORA-00313: open failed for members of log group 3 of thread 1
 ORA-00312: online log 3 thread 1: '/u01/test/test/redo03.log'
 ORA-27037: unable to obtain file status
 Linux-x86_64 Error: 2: No such file or directory
 Additional information: 3
 Checker run found 2 new persistent data failures


这种情况下无法删除active联机日志,尝试各种删除方式都会报错,如下:
 
SQL> alter database drop logfile group 3;
 alter database drop logfile group 3
 *
 ERROR at line 1:
 ORA-01624: log 3 needed for crash recovery of instance test (thread 1)
 ORA-00312: online log 3 thread 1: '/u01/test/test/redo03.log'
 SQL> alter database clear logfile group 3;
 alter database clear logfile group 3
 *
 ERROR at line 1:
 ORA-01624: log 3 needed for crash recovery of instance test (thread 1)
 ORA-00312: online log 3 thread 1: '/u01/test/test/redo03.log'
 SQL> alter database clear unarchived logfile group 3;
 alter database clear unarchived logfile group 3
 *
 ERROR at line 1:
 ORA-01624: log 3 needed for crash recovery of instance test (thread 1)
 ORA-00312: online log 3 thread 1: '/u01/test/test/redo03.log'

 

更多详情见请继续阅读下一页的精彩内容:


    
 
 
 
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。












  • 相关文章推荐
  • Oracle 12c发布简单介绍及官方下载地址
  • 在linux下安装oracle,如何设置让oracle自动启动!也就是让oracle那个服务自动启动,不是手动的
  • oracle 11g最新版官方下载地址
  • 请问su oracle 和su - oracle有什么不同?
  • Oracle 数据库(oracle Database)Select 多表关联查询方式
  • 虚拟机装Oracle R12与Oracle10g
  • Oracle数据库(Oracle Database)体系结构及基本组成介绍
  • Oracle 数据库开发工具 Oracle SQL Developer
  • 如何设置让Oracle SQL Developer显示的时间包含时分秒
  • Oracle EBS R12 支持 Oracle Database 11g
  • Oracle 10g和Oracle 11g网格技术介绍
  • SCO unix下安装oracle,但没有光盘,请大家推荐一个oracle下载站点(unix版本的)。谢谢!!!!
  • oracle中如何把表中具有相同值列的多行数据合并成一行
  • 请问大家用oracle数据库, 用import oracle.*;下的东西么? 还是用标准库?
  • Oracle 数据库(oracle Database)性能调优技术详解
  • Linux /$ORACLE_HOME $ORACLE_HOME
  • ORACLE日期相关操作
  • Linux系统下Oracle的启动与Oracle监听的启动
  • ORACLE数据库常用字段数据类型介绍
  • 请问在solaris下安装ORACLE,用root用户和用oracle用户安装有什么区别么?
  • Oracle 12c的九大最新技术特性介绍
  • 网间Oracle的连接,远程连接Oracle服务器??


  • 站内导航:


    特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!

    ©2012-2021,