某银行须要恢复2004年磁带备份数据库 8.0.5,当时由于开发商使用begin backup命令进行热备,而后压缩到磁带上.在硬盘紧张,rman不成熟的时代,使用这样的方法备份自己没有大问题,但是由于没有备份归档日志,给如今的恢复带来了不少的问题.
尝试不彻底恢复启动库数据库
SVRMGR> startup pfile= 'init.ora' mount oracle ORACLE instance started. spa Total System Global Area 141826208 bytes 日志 Fixed Size 47264 bytes code Variable Size 124829696 bytes 事务 Database Buffers 16777216 bytes ci Redo Buffers 172032 bytes 开发 Database mounted. it SVRMGR> recover database using backup controlfile until cancel; io ORA-00279: change 613561556 generated at 08/21/04 22:42:48 needed for thread 1 ORA-00289: suggestion : /oracle/product/8.0.5/dbs/arch1_55329.dbf ORA-00280: change 613561556 for thread 1 is in sequence #55329 Specify log: {<RET>=suggested | filename | AUTO | CANCEL} cancel Media recovery cancelled. SVRMGR> alter database open resetlogs; alter database open resetlogs * ORA-00600: internal error code, arguments: [4146], [31400], [31370], [], [], [], [], [] |
这个错误是由于回滚段corruption致使,客户已经没有了一致性要求,因此解决办法是经过一些手段找出回滚段并屏蔽
屏蔽回滚段重启库
SVRMGR> shutdown abort ORACLE instance shut down. SVRMGR> startup pfile= 'init.ora' mount ORACLE instance started. Total System Global Area 141826208 bytes Fixed Size 47264 bytes Variable Size 124829696 bytes Database Buffers 16777216 bytes Redo Buffers 172032 bytes Database mounted. SVRMGR> alter database open ; alter database open * ORA-00600: internal error code, arguments: [3668], [1], [2], [55992], [55992], [4], [], [] |
根据ORA-00600[3668]错误的提示,由于重建控制文件,有一个数据文件由于在磁带恢复丢失,因此控制文件在上次重建的时候没有包含进去,根据经验在8.0中能够经过resetlogs解决
resetlogs从新打开数据库
SVRMGR> alter database open resetlogs; alter database open resetlogs * ORA-01139: RESETLOGS option only valid after an incomplete database recovery SVRMGR> recover datatabase using backup controlfile until cancel; ORA-00274: illegal recovery option DATATABASE SVRMGR> recover database using backup controlfile until cancel; ORA-00279: change 613561558 generated at 07/30/12 09:14:49 needed for thread 1 ORA-00289: suggestion : /oracle/product/8.0.5/dbs/arch1_1.dbf ORA-00280: change 613561558 for thread 1 is in sequence #1 Specify log: {<RET>=suggested | filename | AUTO | CANCEL} cancel Media recovery cancelled. SVRMGR> alter database open resetlogs; alter database open resetlogs * ORA-00604: error occurred at recursive SQL level 1 ORA-01555: snapshot too old: rollback segment number with name "" too small |
根据经验多是屏蔽了undo或者undo损坏,而后有事务可能须要读undo,没法读到对应记录,可能出现此错误,由于无trace文件,尝试推动scn解决.固然这个问题能够经过open时作10046而后深刻分析也许能够找到缘由.
open数据库成功
根据上面的分析,重启库,推动scn,resetlogs库解决问题
SVRMGR> shutdown immediate ORA-01109: database not open Database dismounted. ORACLE instance shut down. SVRMGR> startup pfile= 'init.ora' mount; ORACLE instance started. Total System Global Area 141826208 bytes Fixed Size 47264 bytes Variable Size 124829696 bytes Database Buffers 16777216 bytes Redo Buffers 172032 bytes Database mounted. SVRMGR> alter database open ; alter database open * ORA-00600: internal error code, arguments: [3668], [1], [2], [55994], [55994], [4], [], [] SVRMGR> recover database using backup controlfile until cancel; ORA-00279: change 613561560 generated at 07/30/12 09:17:11 needed for thread 1 ORA-00289: suggestion : /oracle/product/8.0.5/dbs/arch1_1.dbf ORA-00280: change 613561560 for thread 1 is in sequence #1 Specify log: {<RET>=suggested | filename | AUTO | CANCEL} cancel Media recovery cancelled. SVRMGR> alter database open resetlogs; Statement processed. |
此次恢复比较幸运,在备份到磁带过程当中被覆盖的一个同名的数据文件,由于是index,经过查询dba_extents,而后删除并重建相关index,s数据库算恢复彻底.有些时候,对数据库多一份备份,可能成为最后的救命稻草,哪怕是一份不是十分完整的备份.再次重复:对dba而言,数据库备份重于一切
更多Oracle精彩内容请关注我:
