报错信息:
SQL> startup
ORACLE instance started.
Total System Global Area 849530880 bytes
Fixed Size 1339824 bytes
Variable Size 520097360 bytes
Database Buffers 322961408 bytes
Redo Buffers 5132288 bytes
Database mounted.
ORA-03113: end-of-file on communication channel
Process ID: 15444
Session ID: 1 Serial number: 5
查看警报日志文件:
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_lgwr_15340.trc:
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'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
由错误知道数据库因丢失日志文件redo01.log无法打开,下面开启数据库到mount,查询丢失日志文件的状态:
SQL> startup mount;
ORACLE instance started.
Total System Global Area 849530880 bytes
Fixed Size 1339824 bytes
Variable Size 520097360 bytes
Database Buffers 322961408 bytes
Redo Buffers 5132288 bytes
Database mounted.
SQL> select group#,members,status from v$log;
GROUP# MEMBERS STATUS
---------- ---------- ----------------
1 1 INACTIVE
3 1 CURRENT
2 1 INACTIVE
丢失的日志文件redo01.log是属于非活动日志组,由于非活动日志组已经完成了检查点,也就是记录在该日志组的事务提交造成的数据块的改变都
已经从database buffer cache写入到data file中了,数据库不会发生数据丢失,此时只需要用clear重建日志组就可恢复:
SQL> alter database clear logfile group 1;
Database altered.
打开数据库:
SQL> alter database open;
Database altered.
SQL> select group#,members,status from v$log;
GROUP# MEMBERS STATUS
---------- ---------- ----------------
1 1 UNUSED
2 1 INACTIVE
3 1 CURRENT
可以看到此时的日志组1已经变成了unused状态。
另外,如果数据库处于archivelog mode ,且丢失的日志组未完成归档,那么使用如下命令强制清除:
alter database clear unarchived logfile group 1;
SQL> startup
ORACLE instance started.
Total System Global Area 849530880 bytes
Fixed Size 1339824 bytes
Variable Size 520097360 bytes
Database Buffers 322961408 bytes
Redo Buffers 5132288 bytes
Database mounted.
ORA-03113: end-of-file on communication channel
Process ID: 15444
Session ID: 1 Serial number: 5
查看警报日志文件:
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_lgwr_15340.trc:
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'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
SQL> startup mount;
ORACLE instance started.
Total System Global Area 849530880 bytes
Fixed Size 1339824 bytes
Variable Size 520097360 bytes
Database Buffers 322961408 bytes
Redo Buffers 5132288 bytes
Database mounted.
SQL> select group#,members,status from v$log;
GROUP# MEMBERS STATUS
---------- ---------- ----------------
1 1 INACTIVE
3 1 CURRENT
2 1 INACTIVE
已经从database buffer cache写入到data file中了,数据库不会发生数据丢失,此时只需要用clear重建日志组就可恢复:
SQL> alter database clear logfile group 1;
Database altered.
打开数据库:
Database altered.
SQL> select group#,members,status from v$log;
GROUP# MEMBERS STATUS
---------- ---------- ----------------
1 1 UNUSED
2 1 INACTIVE
3 1 CURRENT
另外,如果数据库处于archivelog mode ,且丢失的日志组未完成归档,那么使用如下命令强制清除:
alter database clear unarchived logfile group 1;
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29800581/viewspace-1256226/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/29800581/viewspace-1256226/