在突然断电后重启数据库 如果数据库业务逻辑处理频繁,往往引发错误。有简单的数据文件坏块,有些会引起内核错误,一般通过redo日志恢复都可以恢复正常状态

错误例子一:需要恢复数据文件

 重新启动出现 ora-01172,ora-01151错误
SQL> startup
ORACLE instance started.

Total System Global Area 1068937216 bytes
Fixed Size                  2220200 bytes
Variable Size             817893208 bytes
Database Buffers          243269632 bytes
Redo Buffers                5554176 bytes
Database mounted.
ORA-01172: recovery of thread 1 stuck at block 208 of file 3
ORA-01151: use media recovery to recover block, restore backup if needed

查看ora-01172错误描述
oerr ora 01172

[oracle@localhost ~]$ oerr ora 01172
01172, 00000, “recovery of thread %s stuck at block %s of file %s”
// *Cause: Crash recovery or instance recovery could not apply a change to a
//         block because it was not the next change. This can happen if the
//         block was corrupted and then repaired during recovery.
// *Action: Do a RECOVER DATAFILE for the file containing the block. If this
//         does not resolve the problem then restore the file from a backup
//         and  recover it.
[oracle@localhost ~]$ sqlplus / as sysdba

SQL> recover datafile 3;
Media recovery complete.
SQL> alter database open;

Database altered.

SQL> select name,open_mode from v$database;

NAME      OPEN_MODE
——— ——————–
ORCL      READ WRITE

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup

错误例子二:引起看不到的内核错误

重启出现 ORA-00600: internal error code, arguments: [kcratr_scan_lastbwr], [], [], [], [], [], [], [], [], [], [], []

ALTER DATABASE RECOVER  database
Media Recovery Start
started logmerger process
Parallel Media Recovery started with 2 slaves
Thu Mar 13 10:51:51 2014
Recovery of Online Redo Log: Thread 1 Group 3 Seq 2937 Reading mem 0
 Mem# 0: /home/oracle/oradata/orcl/redo03.log
Media Recovery Complete (orcl)
Completed: ALTER DATABASE RECOVER  database
alter database open