INACTIVE日志损坏

INACTIVE状态的日志损坏_oracle学习

SQL> alter system switch logfile; 


System altered.


查看日志的状态


SQL> select * from v$log;


 


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


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


        1          1         28  52428800          1 YES ACTIVE                  579215 07-SEP-12


        2          1         29  52428800          1 NO  CURRENT                 579450 07-SEP-12


         3         1         27   52428800          1 YES INACTIVE                579032 07-SEP-12


查看到第三组日志属于INACTIVE状态


查看日志所属的组与对应的日志文件


SQL> select * from v$logfile; 


   GROUP# STATUS  TYPE    MEMBER                                   IS_


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


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


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


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


查看到第三组日志对应的日志文件


SQL> !cp /etc/passwd/u01/tiger/oradata/orcl2/redo03.log 


SQL> shutdown immediate


Database closed.


Database dismounted.


Oracle instance shut down.


SQL> startup


ORACLE instance started.


 


Total System Global Area  314572800 bytes


Fixed Size                  1219136 bytes


Variable Size             121636288 bytes


Database Buffers          184549376 bytes


Redo Buffers                7168000 bytes


Database mounted.


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


ORA-00312: online log 3 thread 1:'/u01/tiger/oradata/orcl2/redo03.log' 


清洗当前日志组


SQL> alter database clear logfile group 3; 


Database altered. 


SQL> alter database open; 


Database altered. 


SQL>