练习---日志恢复正常关库删除一组当前日志组

Posted Tomatoes

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了练习---日志恢复正常关库删除一组当前日志组相关的知识,希望对你有一定的参考价值。

1.查询当前日志组及状态:

10:45:14 SYS@ORA11GR2>select group#,member from v$logfile;

    GROUP# MEMBER
---------- --------------------------------------------------
         3 /u01/app/oracle/oradata/ORA11GR2/redo03.log
         2 /u01/app/oracle/oradata/ORA11GR2/redo02.log
         1 /u01/app/oracle/oradata/ORA11GR2/redo01.log
         3 /u01/app/oracle/disk/redo03b.log
         2 /u01/app/oracle/disk/redo02b.log
         1 /u01/app/oracle/disk/redo01b.log

6 rows selected.

10:45:26 SYS@ORA11GR2>select group#,members,bytes/1024/1024 M,status from v$log;

    GROUP#    MEMBERS          M STATUS
---------- ---------- ---------- ----------------
         1          2         50 CURRENT
         2          2         50 INACTIVE
         3          2         50 ACTIVE

2.模拟故障(正常关库删除一组当前日志组):

10:45:53 SYS@ORA11GR2>shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

[[email protected] ~]$ rm /u01/app/oracle/oradata/ORA11GR2/redo01.log
[[email protected] ~]$ rm /u01/app/oracle/disk/redo01b.log

3.起库报错,查看alert日志:

ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: /u01/app/oracle/disk/redo01b.log
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 1 thread 1: /u01/app/oracle/oradata/ORA11GR2/redo01.log
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3

4.解决:将数据库起到mount

10:50:09 SYS@ORA11GR2>alter database clear logfile group 1;

Database altered.

 
10:51:35 SYS@ORA11GR2>select group#,members,bytes/1024/1024 M,status from v$log;

    GROUP#    MEMBERS          M STATUS
---------- ---------- ---------- ----------------
         1          2         50 UNUSED
         3          2         50 INACTIVE
         2          2         50 CURRENT

10:51:41 SYS@ORA11GR2>alter database open;

Database altered.

 

 

 

 

以上是关于练习---日志恢复正常关库删除一组当前日志组的主要内容,如果未能解决你的问题,请参考以下文章

练习--日志恢复---非当前日志组所有成员丢失

Oracle - 备份与恢复

ORACLE配置重做日志文件

练习---日志文件的恢复-----多元化成员中,单个成员丢失

备份恢复

什么是oracle 日志文件