当前位置:  数据库>oracle

ACTIVE日志损坏(有归档)

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

    本文导语: 归档模式下active日志损坏 active代表日志切换过可能已经归档;也可能代表日志中的脏块还没有被DBWR写盘 查看归档路径 SQL> show parameter recovery   NAME                                 TYPE        VALUE -----------------...

归档模式下active日志损坏

active代表日志切换过可能已经归档;也可能代表日志中的脏块还没有被DBWR写盘

查看归档路径

SQL> show parameter recovery

 

NAME                                 TYPE        VALUE

----------------------------------------------- ------------------------------

db_recovery_file_dest                string      /u01/tiger/flash_recovery_area

db_recovery_file_dest_size           big integer 2G

recovery_parallelism                 integer     0

如果是刚创建的数据库那么就会出现unused状态

SQL> select * from v$log;

 

   GROUP#    THREAD#  SEQUENCE#     BYTES    MEMBERS ARC STATUS           FIRST_CHANGE# FIRST_TIM

---------- ---------- ---------- -------------------- --- ---------------- ------------- ---------

        1          1          2  52428800          1 NO  CURRENT                452423 07-SEP-12

        2          1          0  52428800          1 YES UNUSED                       0

        3          1          1  52428800          1 YES INACTIVE                446075 07-SEP-12

第一,查看日志的状态和对应的日志文件

SQL> select * from v$logfile;

 

   GROUP# STATUS  TYPE    MEMBER                                   IS_

---------- ------- ----------------------------------------------- ---

        3         ONLINE  /u01/tiger/oradata/orcl/redo03.log       NO

        2         ONLINE  /u01/tiger/oradata/orcl/redo02.log       NO

        1         ONLINE  /u01/tiger/oradata/orcl/redo01.log       NO

 

SQL> select * from v$log;

 

   GROUP#    THREAD#  SEQUENCE#     BYTES    MEMBERS ARC STATUS           FIRST_CHANGE# FIRST_TIM

---------- ---------- ---------- -------------------- --- ---------------- ------------- ---------

        1          1          2  52428800          1 YES ACTIVE                  460765 07-SEP-12

        2          1          3  52428800          1 NO  CURRENT                 460767 07-SEP-12

        3          1          1  52428800          1 YES ACTIVE                  459268 07-SEP-12

第二破坏日志做测试

SQL> !cp /etc/passwd/u01/tiger/oradata/orcl/redo01.log

SQL> conn /as sysdba

Connected.

SQL> shut abort

Oracle instance shut down.

SQL> startup

ORACLE instance started.

 

Total System Global Area  314572800 bytes

Fixed Size                  1219136 bytes

Variable Size             104859072 bytes

Database Buffers          201326592 bytes

Redo Buffers                7168000 bytes

Database mounted.

ORA-00313: open failed for members of loggroup 1 of thread 1

ORA-00312: online log 1 thread 1:'/u01/tiger/oradata/orcl/redo01.log'

ORA-27046: file size is not a multiple oflogical block size

Additional information: 1

 

第三恢复日志

SQL> alter database clear logfile group 1;

alter database clear logfile group 1

*

ERROR at line 1:

ORA-01624: log 1 needed for crash recovery of instance orcl(thread 1)

ORA-00312: online log 1 thread 1:'/u01/tiger/oradata/orcl/redo01.log'

------当我们清洗日志组的时候发现因为视力恢复的时候需要日志组1所以清洗不了

SQL> select * from v$log;

 

   GROUP#    THREAD#  SEQUENCE#     BYTES    MEMBERS ARC STATUS           FIRST_CHANGE# FIRST_TIM

---------- ---------- ---------- -------------------- --- ---------------- ------------- ---------

        1          1          2  52428800          1 YES ACTIVE                  460765 07-SEP-12

        3          1          1  52428800          1 YES ACTIVE                  459268 07-SEP-12

        2          1          3  52428800          1 NO  CURRENT                 460767 07-SEP-12

------检查日志组的状态发现是在active的时候损坏的

SQL> recover database;

ORA-00283: recovery session canceled due toerrors

ORA-00313: open failed for members of log group 1 ofthread 1

ORA-00312: online log 1 thread 1:'/u01/tiger/oradata/orcl/redo01.log'

ORA-27046: file size is not a multiple oflogical block size

Additional information: 1

------当恢复读取日志组1的redo01.dbf的时候格式不对打开失败

因为有归档但是数据不认为此次恢复需要归档,我们手工提供归档

SQL> recover database until cancel;

ORA-00279: change 460765 generated at09/07/2012 13:32:38 needed for thread 1

ORA-00289: suggestion :/u01/tiger/flash_recovery_area/ORCL/archivelog/2012_09_07/o1_mf_1_2_%u_.arc

ORA-00280: change 460765 for thread 1 is insequence #2

 

 

Specify log: {=suggested |filename | AUTO | CANCEL}

 

ORA-00279: change 460767 generated at09/07/2012 13:32:40 needed for thread 1

ORA-00289: suggestion :/u01/tiger/flash_recovery_area/ORCL/archivelog/2012_09_07/o1_mf_1_3_%u_.arc

ORA-00280: change 460767 for thread 1 is insequence #3

ORA-00278: log file'/u01/tiger/flash_recovery_area/ORCL/archivelog/2012_09_07/o1_mf_1_2_84m1qrxr_.arc'no longer neededfor this recovery

 

------2号文件我们没有用到因为刚才recover databas恢复的时候应用了2号日志文件对应的是第三组下一个是3号日志文件实际上就是current日志还没有来得及切换就已经崩溃了所以没有归档我们提供在线的current日志,我们的在线日志是第二组里的日志文件

Specify log: {=suggested |filename | AUTO | CANCEL}

/u01/tiger/oradata/orcl/redo02.log

Log applied.

Media recovery complete.

SQL> alter database open;

alter database open

*

ERROR at line 1:

ORA-01589: must use RESETLOGS orNORESETLOGS option for database open

 

 

SQL> alter database open resetlogs;

 

Database altered.


    
 
 

您可能感兴趣的文章:

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












  • 相关文章推荐
  • java命名空间javax.sound.midi类voicestatus的类成员方法: active定义及介绍
  • 关于线程的问题,什么样的线程不是active线程?
  • java命名空间javax.sound.midi类shortmessage的类成员方法: active_sensing定义及介绍
  • Active CMS
  • java命名空间java.awt类systemcolor的类成员方法: active_caption定义及介绍
  • Active Network Service脚本或者执行命令
  • java命名空间javax.accessibility类accessiblestate的类成员方法: active定义及介绍
  • usb.c:usb 2(vend...) is not claimed by any active driver???
  • java命名空间java.awt类systemcolor的类成员方法: active_caption_border定义及介绍
  • linux有没有类似WIN SERVER下的Active Directory的东东啊?
  • java命名空间java.awt类systemcolor的类成员方法: active_caption_text定义及介绍
  • 请教linux问题:Active swap partions: dev/hda3/ no such device
  • java命名空间javax.accessibility类accessiblecontext的类成员方法: accessible_active_descendant_property定义及介绍
  • Jsp与Active X 组件的问题


  • 站内导航:


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

    ©2012-2021,