您好,欢迎访问一九零五行业门户网

rman 全库恢复asm数据库

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

推荐信息