---adg 搭建备库,归档缺失,主库归档有备份
--主库RAC,备库单机
---adg 搭建备库,归档缺失
alter system set log_archive_config='dg_config=(ssdb,ssadg,ssbak)';
alter system set fal_server='ssadg,ssbak';
alter system set LOG_ARCHIVE_DEST_10='service=ssbak db_unique_name=ssbak reopen=30 compression=enable valid_for=(all_logfiles, primary_role)';
alter system set log_archive_dest_state_10=defer;
----搭建
nuhup rman target sys/123456 auxiliary sys/123456@ssbak @qb_bak.rman &
vi qb_bak.rman
run{
allocate channel ch01 type disk rate 10M;
allocate channel ch02 type disk rate 10M;
allocate channel ch03 type disk rate 10M;
allocate channel ch04 type disk rate 10M;
allocate auxiliary channel ch05 type disk;
duplicate target database for standby from active database DORECOVER;
release channel ch01;
release channel ch02;
release channel ch03;
release channel ch04;
release channel ch05;
}
--登陆数据库,杀掉通道进程
Select s.sid, s.serial#,s.status, p.spid, s.client_info
from v$process p, v$session s
where p.addr = s.paddr
and s.program like '%rman%'
--批量杀死rman会话
SELECT 'alter system kill session '''||SID||','||serial#||''' immediate;'
FROM V$SESSION t
WHERE T.client_info like 'rman channel=%' and status='ACTIVE';
--操作系统批量kill rman进程
ps -ef|grep rman |grep -v grep|awk '{print $2}' |xargs kill -9
---根据主库的备份归档文件,把归档传递过了;然后在北京进行恢复;
---缺少归档
Tue Jun 11 17:12:14 2019
FAL[client]: Failed to request gap sequence
GAP - thread 2 sequence 25196-25206
DBID 1476960055 branch 992196795
--查询归档对应备份集
list backup of archivelog from logseq 25196 until logseq 25206 thread 2;
--从主库传递归档
---注册
catalog start with '/archive/archive1/arch/';
---恢复
restore archivelog from logseq 25196 thread 2;
---应用
alter database recover managed standby database using current logfile disconnect;