redo日志损坏恢复总结(三)

2014-11-24 12:23:11 · 作者: · 浏览: 4
-. 1 oracle oinstall 671096832 Oct 27 17:54 sysaux01.dbf
-rw-r-----. 1 oracle oinstall 796925952 Oct 27 17:54 system01.dbf
-rw-r-----. 1 oracle oinstall 44048384 Oct 27 16:18 temp01.dbf
-rw-r-----. 1 oracle oinstall 524296192 Oct 27 17:54 undotbs02.dbf
-rw-r-----. 1 oracle oinstall 5251072 Oct 27 17:54 users01.dbf
SQL> r
1* alter system switch logfile
System altered.
SQL> r
1* alter system switch logfile
System altered.
SQL> r
1* alter system switch logfile
System altered.
SQL> r
1* alter system switch logfile
System altered.
SQL> r
1* alter system switch logfile
System altered.
SQL> r
1* alter system switch logfile
System altered.
SQL> r
1* alter system switch logfile
System altered.
SQL> r
1* alter system switch logfile
SQL>
在执行dml语句,以及切换日志都成功,但是数据库启动后报错。
日志文件如下:
Errors in file /opt/app/oracle/diag/rdbms/rhys/RHYS/trace/RHYS_ora_3779.trc:
ORA-00313: open failed for members of log group 1 of thread
ORA-00312: online log 2 thread 1: '/opt/app/oracle/oradata/RHYS/redo02.log'
USER (ospid: 3779): terminating the instance due to error 313
System state dump requested by (instance=1, osid=3779), summary=[abnormal instance termination].
System State dumped to trace file /opt/app/oracle/diag/rdbms/rhys/RHYS/trace/RHYS_diag_3749_20131027175926.trc
Dumping diagnostic data in directory=[cdmp_20131027175926], requested by (instance=1, osid=3779), summary=[abnormal instance termination].
Instance terminated by USER, pid = 3779
解决方案:
只需要把损坏的日志文件清除日志组即可。
SQL> startup mount;
ORACLE instance started.
Total System Global Area 492707840 bytes
Fixed Size 2254544 bytes
Variable Size 322963760 bytes
Database Buffers 163577856 bytes
Redo Buffers 3911680 bytes
Database mounted.
SQL> alter database clear logfile group 2;
Database altered.
SQL> alter database;
alter database
*
ERROR at line 1:
ORA-02231: missing or invalid option to ALTER DATABASE
SQL> alter database oepn;
alter database oepn
*
ERROR at line 1:
ORA-02231: missing or invalid option to ALTER DATABASE
SQL> alter database open;
Database altered.
SQL>
四、非归档模式、数据库关闭、不是正在使用的日志文件损坏。
模拟过程:
SQL> select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM NEXT_CHANGE# NEXT_TIME
---------- ---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- --------- ------------ ---------
1 1 450 52428800 512 1 NO CURRENT 5388976 27-OCT-13 2.8147E+14
2 1 449 52428800 512 1 NO INACTIVE 5388970 27-OCT-13 5388976 27-OCT-13
3 1 447 52428800 512 1 NO INACTIVE 5388964 27-OCT-13 5388967 27-OCT-13
4 1 448 52428800 512 1 NO INACTIVE 5388967 27-OCT-13 5388970 27-OCT-13
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> !rm redo02.log
SQL> !ls -l
total 3647744
-rw-r-----. 1 oracle oinstall 9977856 Oct 27 18:06 control01.ctl
-rw-r-----. 1 oracle oinstall 362422272 Oct 27 18:06 example01.dbf
-rw-r-----. 1 oracle oinstall 62922752 Oct 27 18:06 i