ITPub博客

首页 > 数据库 > Oracle > RMAN恢复之RMAN-06555处理

RMAN恢复之RMAN-06555处理

原创 Oracle 作者:yingyifeng306 时间:2022-04-15 13:20:00 0 删除 编辑

因为生产备份的时候排除了一个表空间:

 

 

解决方式:

 

1 、跳过表空间

recover database until time "to_date('2021-9-29 15:55:00','yyyy-mm-dd hh24:mi:ss')" skip forever tablespace BOSS3;

 

2 、使用脚本run,时间写在前面

#!/bin/bash

source /home/oracle/.bash_profile

export ORACLE_SID=jszg6

rmanlog=/home/oracle/scripts/log.txt

rman target / << EOF >> ${rmanlog}

run{

allocate channel t1 device type disk;

allocate channel t2 device type disk;

allocate channel t3 device type disk;

allocate channel t4 device type disk;

set until time "to_date('2021-9-29 15:55:00','yyyy-mm-dd hh24:mi:ss')";

set newname for datafile '+DATAC1/jszg/system01.dbf' to '+datac1/JSZG/datafile2/system01.dbf';

set newname for datafile '+DATAC1/jszg/sysaux01.dbf' to '+datac1/JSZG/datafile2/sysaux01.dbf';

set newname for datafile '+DATAC1/jszg/undotbs01.dbf' to '+datac1/JSZG/datafile2/undotbs01.dbf';

set newname for datafile '+DATAC1/jszg/undotbs02.dbf' to '+datac1/JSZG/datafile2/undotbs02.dbf';

........... 此处省略 ...............

set newname for datafile '+DATAC1/jszg/tbs_ac_8.dbf' to '+datac1/JSZG/datafile2/tbs_ac_8.dbf';

set newname for datafile '+DATAC1/jszg/gj05.dbf' to '+datac1/JSZG/datafile2/gj05.dbf';

set newname for datafile '+DATAC1/jszg/gj06.dbf' to '+datac1/JSZG/datafile2/gj06.dbf';

set newname for tempfile  '+DATAC1/jszg/temp01.dbf' to '+datac1/JSZG/datafile2/temp01.dbf';

set newname for tempfile  '+DATAC1/jszg/temp02.dbf' to '+datac1/JSZG/datafile2/temp02.dbf';

restore database;

switch datafile all;

switch tempfile all;

recover database;

#sql 'alter database open resetlogs';

release channel t1;

release channel t2;

release channel t3;

release channel t4;

}

exit;

EOF


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/23732248/viewspace-2887290/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
ITpub论坛高可用版主,擅长研究Oracle 内部原理、新特性、高可用和性能调优等,多年来一直保持着对新事务旺盛的求知欲。热切关注 Oracle 和其它相关技术

注册时间:2011-10-12

  • 博文量
    291
  • 访问量
    1593086