暂无图片
暂无图片
暂无图片
暂无图片
暂无图片
DG-增量恢复同步.pdf
194
6页
1次
2024-10-16
10墨值下载
一、查看延迟
SQL> select value from v$dataguard_stats where name in ('apply lag'); 1
VALUE 2
---------------------------------------------------------------- 3
+5 04:33:48 4
二、查看Standby Scn
如果scn相同直接使用,如果有差异则选最小:10789509259
SQL> SELECT to_char(CURRENT_SCN) CURRENT_SCN from V$DATABASE;1
CURRENT_SCN2
----------------------------------------3
107895092594
5
SQL> select to_char(min(checkpoint_change#)) min_scn from v$datafile_header;6
MIN_SCN7
----------------------------------------8
107895092609
查看Primary有新增数据文件:3132
SQL> col NAME for a501
SQL> select file# , NAME from v$datafile where creation_change# > =10789509259;2
FILE# NAME3
---------- --------------------------------------------------4
31 /u01/oradata/two/two_dat12.dbf5
32 /u01/oradata/two/two_dat13.dbf6
Primary:<SCN:10789509259>,3132
要备份
rman target /1
run{2
allocate channel c1 type disk;3
allocate channel c2 type disk;4
allocate channel c3 type disk;5
allocate channel c4 type disk;6
crosscheck archivelog all;7
delete expired archivelog all; -- 删除所有已过期的归档日志文件8
delete noprompt archivelog all completed before 'sysdate' ; -- 删除归档9
-- 备份3132数据文件(为断档后新增文件)10
backup datafile 31,32 format '/home/oracle/rman/ForStandbyDat_%U' tag 'FORSTANDBY';11
backup INCREMENTAL from scn 10789509259 database format
'/home/oracle/rman/dat_incre_%U';
12
backup current controlfile for standby reuse format
'/home/oracle/rman/standby_controlfile.ctl';
13
release channel c1;14
release channel c2;15
release channel c3;16
release channel c4;17
}18
查看备份进度:
col opname format a351
col target_desc format a152
col perwork format a123
set lines 1314
select sid,OPNAME,TARGET_DESC,sofar,TOTALWORK,trunc(sofar/totalwork*100,2)||'%' as
perwork
5
from v$session_longops where sofar!=totalwork and totalwork!=0;6
四、压缩并传输:
[oracle@two_db ~]$ tar -zcvf rman.tar.gz rman/1
[oracle@two_db ~]$ scp -r rman.tar.gz two_standby:/home/oracle/2
五、Standby 恢复
关库并恢复controlfile
SQL> shutdown immediate;1
SQL> startup nomount2
RMAN> restore standby controlfile from '/home/oracle/rman/standby_controlfile.ctl';3
SQL> alter database mount;4
注册catalog
RMAN> catalog start with '/home/oracle/rman';1
RMAN恢复3132号数据文件
RMAN> run1
{2
set newname for datafile 31 to '/u01/oradata/two/two_dat12.dbf'; 3
set newname for datafile 32 to '/u01/oradata/two/two_dat13.dbf';4
restore datafile 31;5
restore datafile 32;6
switch datafile all;7
}8
of 6
10墨值下载
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文档的来源(墨天轮),文档链接,文档作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

文档被以下合辑收录

评论