昨天遇到一个断电导致oracle异常的案例,记录一下:
客户方有同事不懂数据库,直接将装有oracle双机的两台服务器直接先后断电,等待几分钟再重新启动两台服务器,结果后来oracle在启动的时候报如下错误:
Mon Oct 17 17:23:08 2011
Errors in file /founder/oracle/admin/bzdb/udump/bzdb_ora_23965.trc:
ORA-00600: internal error code, arguments: [kccpb_sanity_check_2], [127404], [127399], [0x000000000], [], [], [], []
ORA-600 signalled during: ALTER DATABASE MOUNT...
查了下资料,原因和解决方法如下:
Cause
[kccpb_sanity_check_2] indicates that the seq# of the last read block is higher than the seq# of the control file header block. This is indication of the lost write of the header block during commit of the previous cf transaction.
Solution
1) restore a backup of a controlfile and recover
OR
2) recreate the controlfile
OR
3) restore the database from last good backup and recover
因为这个灾备数据库不是很关键很重要的,客户要求没有启用归档,有个4月份的冷备,和客户方商量后决定先试试重建控制文件;
数据库没有控制文件备份,只能nomount,执行alter database mount的时候报错,所以没法接着alter database backup controlfile to trace;
于是从alter告警文件里找寻最近成功启动数据库的相关记录信息,摘录如下,编写出重建控制文件的脚步create_ctrl.sql,
sqlplus / as sysdba;
直接运行该重建控制文件脚步,数据库成功open。
create_ctrl.sql
STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "bzdb" RESETLOGS
MAXLOGFILES 5
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 1
MAXLOGHISTORY 226
LOGFILE
GROUP 1 ('/oracle/oradata/db/redo01.log') SIZE 51200K,
GROUP 2 ('/oracle/oradata/db/redo02.log') SIZE 51200K,
GROUP 3 ('/oracle/oradata/db/redo03.log') SIZE 51200K
DATAFILE
'/oracle/oradata/db/system01.dbf',
'/oracle/oradata/db/undotbs01.dbf',
'/oracle/oradata/db/sysaux01.dbf',
'/oracle/oradata/db/users01.dbf',
'/oracle/oradata/db/temp01.dbf',
......
CHARACTER SET AL32UTF8;
ALTER DATABASE MOUNT;
RECOVER DATABASE;
ALTER DATABASE OPEN NORESETLOGS;