当前位置:  数据库>oracle

rman 全库恢复asm数据库

    来源: 互联网  发布时间:2017-04-30

    本文导语: 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 s...

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 说明该文件丢失或者损坏,然后执行全库恢复














































































    
 
 
 
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。












  • 相关文章推荐
  • rman备份脚本和rman增量备份脚本分享
  • rman配置及rman常用命令操作
  • win平台oracle rman备份和删除dg备库归档日志脚本
  • linux自动运行rman增量备份脚本
  • Oracle相关:Rman Crosscheck删除失效归档
  • Oracle RMAN快速入门指南


  • 站内导航:


    特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!

    ©2012-2021,