记一次某客户数据库异常恢复记录 ( 无备份,无归档 )
数据库运行时异常宕机,并在重新启动后报如下错误:
1、开启数据库时,提示 ORA-01113, ORA-01110,然后 recover这个数据文件报 ORA-00742, ORA-00312
2 、尝试设置隐含参数跳过报错
alter system set "_allow_resetlogs_corruption"=true scope=spfile; alter system set "_allow_error_simulation"=true scope=spfile;
然后 resetlogs 打开
3 、设置完打开数据库报错
SQL> alter database open RESETLOGS; alter database open RESETLOGS * ERROR at line 1: ORA-00603: ORACLE server session terminated by fatal error ORA-01092: ORACLE instance terminated. Disconnection forced ORA-00704: bootstrap process failure ORA-00704: bootstrap process failure ORA-00600: internal error code, arguments: [kcbzib_kcrsds_1], [], [], [], [], [], [], [], [], [], [], [] Process ID: 60930 Session ID: 244 Serial number: 49624
4 、尝试设置隐含参数推进 SCN
alter system set event="21307096 trace name context forever, level 3" scope=spfile;
重启打开数据库,报如下错误,有戏了这是
ORA-00603: ORACLE server session terminated by fatal error ORA-01092: ORACLE instance terminated. Disconnection forced ORA-00600: internal error code, arguments: [4194], [57], [35], [], [], [], [], [], [], [], [], [] Process ID: 5313 Session ID: 3121 Serial number: 41735
该错误表示检测到 redo 和 undo 回滚段记录的信息不一致
Arg [a] - Undo 块中的最大 Undo 记录数
Arg [b] - Redo 块中的 Undo 记录数
根据mos 文档:
Step by step to resolve ORA-600 4194 4193 4197 on database crash (Doc ID 1428786.1)
处理方法:
create pfile='/tmp/initsid.ora' from spfile; vi /tmp/initsid.ora add *.undo_management = manual *.event='21307096 trace name context forever, level 3','10513 trace name context forever, level 2'(设置 event 10531,禁止smon进程进行回滚) startup restrict pfile='/tmp/initsid.ora'(此时数据库状态为读写) select tablespace_name, status, segment_name from dba_rollback_segs where status != 'OFFLINE'; TABLESPACE_NAME STATUS SEGMENT_NAME ------------------------------ ---------------- ------------------------------ SYSTEM ONLINE SYSTEM UNDOTBS1 PARTLY AVAILABLE _SYSSMU4_1254879796$ shutdown immediate;
修改参数文件,添加隐含参数,将上述查出来的回滚段,添加至隐含参数中( 一个online 的undo 段都没有的话就不用添加该参数)
*._corrupted_rollback_segments=(_SYSSMU4_1254879796$) startup restrict pfile='/tmp/initsid.ora'
重建undo 表空间
单机:
create undo tablespace <new undo tablespace> datafile <datafile> size 2000M; eg:create undo tablespace undo1 datafile '/ora11g/app/ora11g/undo1.dbf' size 200M; drop tablespace <old undo tablespace> including contents and datafiles; eg:drop tablespace UNDOTBS1 including contents and datafiles;
集群:
create undo tablespace undo3 datafile '+DATA/.../undo3.dbf' size 1G; create undo tablespace undo4 datafile '+DATA/.../undo4.dbf' size 1G; drop tablespace UNDOTBS1 including contents and datafiles; drop tablespace UNDOTBS2 including contents and datafiles; shutdown immediate; startup nomount; 此处使用原始的参数文件
单机:
alter system set undo_tablespace = '<new tablespace created in step 6>' scope=spfile; eg: alter system set undo_tablespace=undo1 scope=spfile;
集群:
alter system set undo_tablespace=undo3 scope=spfile sid='1节点'; alter system set undo_tablespace=undo4 scope=spfile sid='2节点'; shutdown immediate; startup;
打开后赶紧做个备份
