rman 全库恢复asm数据库

php中文网
发布: 2016-06-07 17:15:51
原创
1361人浏览过

用rman做全库恢复,首先保证控制文件是完好的,在恢复的过程中不会恢复控制文件,是以控制文件为标准来恢复数据文件。应用redo日

1、做全库备份
 
注意:rman 可以把asm上的数据文件备份到文件系统,也可恢复
 
rman> run{
 allocate channel c1 type disk maxpiecesize=500m;
 backup current controlfile format '+dgasm/backup/ctl_%d_%s';
 backup full database format '+dgasm/backup/db_%d_%s_%p_%t';
 sql 'alter system archive log current';
 release channel c1;
 }2> 3> 4> 5> 6> 7>
allocated channel: c1
channel c1: sid=31 device type=disk
starting backup at 24-jun-12
channel c1: starting full datafile backup set
channel c1: specifying datafile(s) in backup set
including current control file in backup set
channel c1: starting piece 1 at 24-jun-12
channel c1: finished piece 1 at 24-jun-12
piece handle=+dgasm/backup/ctl_ora11_19 tag=tag20120624t172227 comment=none
channel c1: backup set complete, elapsed time: 00:00:03
finished backup at 24-jun-12
starting backup at 24-jun-12
channel c1: starting full datafile backup set
channel c1: specifying datafile(s) in backup set
input datafile file number=00001 name=+dgasm/ora11/datafile/system.257.785186755
input datafile file number=00002 name=+dgasm/ora11/datafile/sysaux.258.785186845
input datafile file number=00003 name=+dgasm/ora11/datafile/undotbs1.259.785186901
input datafile file number=00004 name=+dgasm/ora11/datafile/users.261.785186921
channel c1: starting piece 1 at 24-jun-12
channel c1: finished piece 1 at 24-jun-12
piece handle=+dgasm/backup/db_ora11_20_1_786820952 tag=tag20120624t172232 comment=none
channel c1: starting piece 2 at 24-jun-12
channel c1: finished piece 2 at 24-jun-12
piece handle=+dgasm/backup/db_ora11_20_2_786820952 tag=tag20120624t172232 comment=none
channel c1: backup set complete, elapsed time: 00:01:22
channel c1: starting full datafile backup set
channel c1: specifying datafile(s) in backup set
including current control file in backup set
including current spfile in backup set
channel c1: starting piece 1 at 24-jun-12
channel c1: finished piece 1 at 24-jun-12
piece handle=+dgasm/backup/db_ora11_21_1_786821034 tag=tag20120624t172232 comment=none
channel c1: backup set complete, elapsed time: 00:00:01
finished backup at 24-jun-12
sql statement: alter system archive log current
released channel: c1
rman>
2、shutdown immediate  关闭数据库,然后删除user数据文件,,模拟数据文件损坏
asmcmd> ls
sysaux.258.785186845
system.257.785186755
undotbs1.259.785186901
users.261.785186921
asmcmd>
asmcmd>
asmcmd> rm -f users.261.785186921
asmcmd> ls
sysaux.258.785186845
system.257.785186755
undotbs1.259.785186901
asmcmd>
3、启动数据到mount,然后open 出现下面的问题
sql> alter database open;
alter database open
*
error at line 1:
ora-01157: cannot identify/lock data file 4 - see dbwr trace file
ora-01110: data file 4: '+dgasm/ora11/datafile/users.261.785186921'
4、说明数据文件出现问题,查看具体的问题
sql> select * from v$recover_file
  2  ;
     file# online  online_ error
---------- ------- ------- -----------------------------------------------------------------
   change# time
---------- ------------
         4 online  online  file not found
         0
file not found 说明该文件丢失或者损坏,然后执行全库恢复

linux

最佳 Windows 性能的顶级免费优化软件
最佳 Windows 性能的顶级免费优化软件

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号