数据库

位置:IT落伍者 >> 数据库 >> 浏览文章

超级复杂困难之Oracle数据库大恢复


发布日期:2020年07月05日
 
超级复杂困难之Oracle数据库大恢复

昨天一个朋友公司的数据库崩溃

这再次印证了我反复提到的一个命题数据库也需要休息

每逢节假日数据库也经常会自我选择放假

以前我说年终难终 进入数据库事故多发期一年一度今又是记得另外一个圣诞节我还和Biti一起在北京的时候同样遇到一个上海的朋友数据库崩溃我们远程指导这位朋友恢复了数据

这次的事情是这样的

首先主机宕机磁盘出错

看到以下这类错误一般你的数据都很危险了

Dec :: kernel: sda: rw= want= limit=

Dec :: kernel: attempt to access beyond end of device

Dec :: kernel: sda: rw= want= limit=

Dec :: kernel: attempt to access beyond end of device

Dec :: kernel: sda: rw= want= limit=

Dec :: kernel: attempt to access beyond end of device

Dec :: kernel: sda: rw= want= limit=

Dec :: kernel: attempt to access beyond end of device

Dec :: kernel: sda: rw= want= limit=

Dec :: kernel: attempt to access beyond end of device

Dec :: kernel: sda: rw= want= limit=

Dec :: kernel: attempt to access beyond end of device

Dec :: kernel: sda: rw= want= limit=

Dec :: kernel: attempt to access beyond end of device

Dec :: kernel: sda: rw= want= limit=

Dec :: kernel: attempt to access beyond end of device

Dec :: kernel: sda: rw= want= limit=

Dec :: kernel: attempt to access beyond end of device

Dec :: kernel: sda: rw= want= limit=

数据文件大量损坏

当然这次也不例外大量文件损坏dbv大量如下错误

[oracle@stat datafile]$ dbv file=o_mf_system_mn_dbf blocksize=

DBVERIFY: Release Production on Thu Dec ::

Copyright (c) Oracle All rights reserved

DBVERIFY Verification starting : FILE = o_mf_system_mn_dbf

Page is influx most likely media corrupt

Corrupt block relative dba: x (file block )

Fractured block found during dbv:

Data in bad block:

type: format: rdba: x

last change scn: xfe seq: x flg: x

spare: x spare: x spare: x

consistency value in tail: xbc

check value in block header: xccb

computed block checksum: xb

Page is influx most likely media corrupt

Corrupt block relative dba: xe (file block )

Fractured block found during dbv:

Data in bad block:

type: format: rdba: xe

last change scn: xb seq: x flg: x

spare: x spare: x spare: x

consistency value in tail: xc

check value in block header: xdf

computed block checksum: xdc

控制文件损坏

启动数据库出现如下错误

Wed Dec ::

ALTER DATABASE MOUNT

Wed Dec ::

Errors in file /opt/oracle/admin/stat/udump/stat_ora_trc:

ORA: internal error code arguments: [kccpb_sanity_check_] [] [] [x] [] [] [] []

Wed Dec ::

ORA signalled during: ALTER DATABASE MOUNT

Wed Dec ::

Starting ORACLE instance (normal)

Wed Dec ::

Corrupt block found during reading backup piece file=/opt/oracle/product/dbg/dbs/snapcf_statf corr_type=

经过反复确认这个环境Over了

不完全的备份

以前的备份机制使得我可以从远程主机找到一系列备份集但是没有控制文件

通过备份集dbms_backup_restore等手段首先恢复出来数据文件然后尝试启动数据库

强制打开

通过强制resetlogs手段打开数据库出现ORA 错误

Wed Dec ::

Errors in file /opt/oracle/admin/stat/udump/stat_ora_trc:

ORA: internal error code arguments: [] [] [] [] [] [] [] []

Wed Dec ::

Errors in file /opt/oracle/admin/stat/udump/stat_ora_trc:

ORA: bootstrap process failure

ORA: bootstrap process failure

ORA: internal error code arguments: [] [] [] [] [] [] [] []

通过BBED解决ORA 错误

这个没说的只能通过BBED搞定了修复有问题的数据块再次尝试打开数据库

遇到ORA 错误

这个错误就好解决了通过我网站上的示例就可以解决

Wed Dec ::

Errors in file /opt/oracle/admin/stat/udump/stat_ora_trc:

ORA: internal error code arguments: [] [] [] [] [] [] [] []

ORA: ORACLE instance terminated Disconnection forced

ORA: internal error code arguments: [] [] [] [] [] [] [] []

Wed Dec ::

Errors in file /opt/oracle/admin/stat/udump/stat_ora_trc:

ORA: internal error code arguments: [] [] [] [] [] [] [] []

ORA: internal error code arguments: [] [] [] [] [] [] [] []

ORA: ORACLE instance terminated Disconnection forced

ORA: internal error code arguments: [] [] [] [] [] [] [] []

Wed Dec ::

Errors in file /opt/oracle/admin/stat/udump/stat_ora_trc:

ORA: internal error code arguments: [] [] [] [] [] [] [] []

ORA: internal error code arguments: [] [] [] [] [] [] [] []

ORA: ORACLE instance terminated Disconnection forced

ORA: internal error code arguments: [] [] [] [] [] [] [] []

解决ORA 号错误

接下来继续出现ORA 号错误这个也好解决搞定UNDO表空间就Ok了

Wed Dec ::

Errors in file /opt/oracle/admin/stat/bdump/stat_j_trc:

ORA: internal error code arguments: [] [] [] [] [] [] [] []

解决一些其他小问题

此处省略终于搞定了用户数据库!

这个案例所用到的所有知识在我的网站上全都有详细介绍不过要能把所有知识综合运用才能解决这次的故障

               

上一篇:Oracle约束操作

下一篇:oracle 10g 新特性中文笔记一