RMAN学习之四:丢失非当前的联机重做日志。
1、查看日志组和日志文件。
SQL> select group#, sequence#, members, archived, status from v$log; GROUP# SEQUENCE# MEMBERS ARCHIV STATUS ---------- ---------- ---------- ------ -------------------------------- 1 0 1 YES UNUSED 2 0 1 YES UNUSED 3 1 1 NO CURRENT
SQL> select group#, member from v$logfile; GROUP# MEMBER ------------------------------------------------------------------------------------------------------------------------- 3 /u01/app/oracle/oradata/orcl/redo03.log 2 /u01/app/oracle/oradata/orcl/redo02.log 1 /u01/app/oracle/oradata/orcl/redo01.log
GROUP3联机日志组为当前状态,对应的联机日志文件时/u01/app/oracle/oradata/orcl/redo03.log,其他两组就是非当前联机日志组。
2、删掉一组非当前联机日志组文件。
SQL> host rm '/u01/app/oracle/oradata/orcl/redo01.log';
SQL> startup ORA-32004: obsolete and/or deprecated parameter(s) specified ORACLE instance started. Total System Global Area 285212672 bytes Fixed Size 1218992 bytes Variable Size 79693392 bytes Database Buffers 201326592 bytes Redo Buffers 2973696 bytes Database mounted. ORA-00313: open failed for members of log group 1 of thread 1 ORA-00312: online log 1 thread 1: '/u01/app/oracle/oradata/orcl/redo01.log'
SQL> select instance_name, status from v$instance; INSTANCE_NAME STATUS -------------------------------- ------------------------ orcl MOUNTED
3、修复日志文件。
SQL> alter database clear logfile GROUP 1; Database altered.
SQL> alter database open; Database altered.