Welcome 微信登录

首页 / 数据库 / MySQL / 探索Oracle之RMAN_07 磁盘损坏数据丢失恢复

有的时候在企业里面难免会出现由于磁盘损坏而导致数据库的故障乃至数据的丢失,那么这个时候,那么这个时候数据的备份就显得尤为的重要。在这一节我们重点讨论下由于装载数据文件,redo日志文件,controlfile控制文件的磁盘损坏的数据恢复。 6.1 通过强制卸载磁盘模拟数据磁盘损坏:[root@wwldb ~]# umount -f /DBData/umount2: 资源或设备忙umount: /DBData: device is busyumount2: 资源或设备忙umount: /DBData: device is busy [root@wwldb ~]# fuser -m -k /DBData/     查看设备占用情况/DBData/: 3508 3510  3512  3514 3516  3518  3529 3531  3535  3541 3610c [root@wwldb ~]# fuser -m -k -i -k /DBData/   强制kill  /DBData相关进程[root@wwldb ~]# umount -f /DBData/       卸载/DBData[root@wwldb ~]#  6.2 umount 后,通过alert看到实例也随之宕机了。Fri Jul  616:03:33 2012Errors in file/DBSoft/admin/WWL/bdump/wwl_pmon_3502.trc:ORA-00471: DBWR process terminated with errorFri Jul  616:03:33 2012PMON: terminating instance due to error 471Instance terminated by PMON, pid = 3502 [root@wwldb bdump]# ps -ef|grep oraroot     2965  2943  0 14:39 ?        00:00:00 hald-addon-storage: polling/dev/hdcroot     3944  3050  0 16:07 pts/2    00:00:00 su - Oracleoracle   3945  3944  0 16:07 pts/2    00:00:00 -bashoracle   3977  3945  0 16:07 pts/2    00:00:00 rlwrap sqlplus / as sysdbaoracle   3978  3977  0 16:07 pts/3    00:00:00 sqlplus   as sysdbaoracle   3979  3978  0 16:07 ?        00:00:00 oracleWWL(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))root     4022  3980  0 16:10 pts/4    00:00:00 grep ora[root@wwldb bdump]# 6.3 要恢复首先要将数据库启动到mount状态才能恢复SQL> startupORACLE instance started. Total System Global Area  100663296 bytesFixed Size                  1217884 bytesVariable Size              88083108 bytesDatabase Buffers            8388608 bytesRedo Buffers               2973696 bytesORA-00205: error in identifying control file, checkalert log for more info 数据库无法启动到mount状态,要执行恢复必须启动到mount状态下才能执行,不过我们在alert日志里面看到是因为确实控制文件2数据库无法启动到mount状态,见如下:Fri Jul  616:13:24 2012ORA-00202: control file:"/DBData/oradata/WWL/control02.ctl"ORA-27037: unable to obtain file statusLinux Error: 2: No such file or directoryAdditional information: 3Fri Jul  616:13:24 2012ORA-205 signalled during: ALTER DATABASE   MOUNT... 这个时候我们可以尝试查找其它控制文件是否都存在,存放在哪里,只要存在任何一个控制文件我们只需要修改参数文件来达到将数据库启动到mount状态。 SQL> show parameter control NAME                                 TYPE        VALUE----------------------------------------------- ------------------------------control_file_record_keep_time        integer     7control_files                        string      /DBSoft/oradata/WWL/control01.ctl, /DBData/oradata/WWL/control02.ctl, /DBData/oradata/WWL/control03.ctl 我们通过spfile参数可以看到控制文件是存放在两块磁盘上,损坏的磁盘为/DBData,那么也就以为着control02.ctl和control03.ctl两个控制文件损坏,这个时候我们可以通过/DBSoft磁盘上的control01.ctl来启动数据库,或者将control02.ctl和control03通过control01.ctl转储到其它磁盘上来启动数据库。 我现在通过修改参数文件仅保留control01.ctl来启动数据库。 SQL> alter system set control_files ="/DBSoft/oradata/WWL/control01.ctl" scope=spfile;System altered. SQL> shutdown immediateORA-01507: database not mountedORACLE instance shut down. SQL> startup mount;ORACLE instance started. Total System Global Area  100663296 bytesFixed Size                  1217884 bytesVariable Size              88083108 bytesDatabase Buffers            8388608 bytesRedo Buffers                2973696 bytesDatabase mounted.SQL>我们可以看到通过修改参数文件,现在数据库已经启动到mount状态。
  • 1
  • 2
  • 3
  • 4
  • 下一页
探索Oracle之RMAN_07 数据库所有文件全部丢失恢复mysql --prompt一个很好用的命令相关资讯      Oracle高级培训 
  • delete表的数据后恢复  (08/30/2012 08:59:58)
  • 使用ASH信息,发现高CPUsession  (08/14/2012 07:21:32)
  • 如何阅读Oracle Errorstack Output  (08/14/2012 07:15:47)
  • Oracle Apps Patching:adpatch(  (08/16/2012 15:41:37)
  • 话说V$SQL_MONITOR  (08/14/2012 07:19:54)
  • Oracle Apps DBA工具:ADADMIN使用  (08/14/2012 07:00:09)
本文评论 查看全部评论 (0)
表情: 姓名: 字数