dg归档gap,主备库归档已清理,增量备份恢复

dg库和主库归档都已经不存在,除了重新拉dg,还可以通过增量备份恢复方式快速恢复dg。

先在dg库查看scn,x$kcvfh和V$DATABASE种的scn都要查,选择小的scn去主库备份。

SYS@zjyyhis2> select min(fhscn) from x$kcvfh;

MIN(FHSCN)
--------------------------------
123567355330

SYS@zjyyhis2> SELECT to_char(CURRENT_SCN) FROM V$DATABASE;

TO_CHAR(CURRENT_SCN)
--------------------------------------------------------------------------------
123567355329

主库备份:

rman target /  > /rman/dg/bak.log << EOF
run{
allocate channel t1 type disk;
allocate channel t2 type disk;
allocate channel t3 type disk;
allocate channel t4 type disk;
allocate channel t5 type disk;
allocate channel t6 type disk;
allocate channel t7 type disk;
allocate channel t8 type disk;
BACKUP INCREMENTAL FROM SCN 123567355329 DATABASE FORMAT '/rman/dg/inc_%M%D_%U.bak';
release channel t1;
release channel t2;
release channel t3;
release channel t4;
release channel t5;
release channel t6;
release channel t7;
release channel t8;
}
EOF

备份数据在dg库上通过“catalog start with '差异备份数据路径';”加到控制文件中。

通过查询视图转换数据存放路径:

select 'set newname for datafile '||file#|| ' to '||''''||'/oracle/oradata/easdb/'||substr(name,instr(name,'/',-1)+1)||''''||';' from v$datafile;
select 'ALTER DATABASE RENAME FILE '||''''||name||''''|| ' to '||''''||'/oracle/oradata/easdb/'||substr(name,instr(name,'/',-1)+1)||''''||';' from v$datafile;

个别数据文件转换:

run{
set newname for datafile 237 to '+DATA/zjyyhisstb/datafile/o1_mf_sde_lob237.dbf';
restore datafile 237;
set newname for datafile 238 to '+DATA/zjyyhisstb/datafile/o1_mf_sde_lob238.dbf';
restore datafile 238;
switch datafile 237;
switch datafile 238;
}

数据文件比较多的转换方式:

run{
set newname for datafile 1 to '+DATA/zjyyhisstb/datafile/system.35126.1110977203';
……………………
set newname for datafile 235 to '+DATA/zjyyhisstb/datafile/sde_lob_data.99225.1139312005';
switch datafile all;
}

转换完成后进行recover database操作恢复的较新的数据,然后重启dg归档应用

  • 15
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值