暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

dataguard 增量恢复,遇到新添加数据文件

原创 许玉冲 2022-08-20
725

主备份增量数据和控制文件:

backup as compressed backupset incremental from scn 142237796 database format '/home/oracle/rman_backup/inc_%u.bak' ;

backup current controlfile for standby format '/home/oracle/rman_backup/standby_ctl.bak';


恢复控制文件并注册备份集:

shutdown immediate;
startup nomount;
restore standby controlfile from '/tmp/rman_bak/standby_ctl.bak';
alter database mount;
catalog start with '/tmp/rman_bak';



#在此次增量期间,数据新添加数据文件,需要先执行数据文件恢复在,执行recover;

Release 11.2.0.4.0 Production on Sat Aug 20 13:07:57 2022



使用增量recover备库
RMAN> recover database noredo; Starting recover at 20-AUG-22 using channel ORA_DISK_1 RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure of recover command at 08/20/2022 13:02:40 RMAN-06094: datafile 381 must be restored
复制


从库还原新增的数据文件
RMAN> restore datafile 381;

Starting restore at 20-AUG-22
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00381 to /dgoradata/tblspace_prp157.dbf
channel ORA_DISK_1: reading from backup piece /tmp/tp/arch/ForStandby_gk15iv25_1_1
复制





#手动新旧数据文件:

SQL> alter system set standby_file_management='MANUAL';
System altered.
SQL> alter database create datafile '/zmsft/tblspace_prp157.dbf' as '/zmsft/tblspace_prp157.dbf';
Database altered.
SQL> alter system set standby_file_management='AUTO';
System altered.
复制


#执行recover:

RMAN> recover database noredo;

Starting recover at 2022-08-20 12:37:13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1 device type=DISK
channel ORA_DISK_1: starting incremental datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
destination for restore of datafile 00381: /zmsft/tblspace_prp157.dbf
channel ORA_DISK_1: reading from backup piece /oraback/arch/ForStandby_gk15iv25_1_1
channel ORA_DISK_1: piece handle=/oraback/arch/ForStandby_gk15iv25_1_1 tag=FORSTANDBY
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:13:05
Finished recover at 2022-08-20 12:50:20

复制


最后修改时间:2022-08-20 13:45:39
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论