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.
时间: 2024-10-29 04:20:31