recover standby when lost archive log

1 备库停止应用
alter database recover managed standby database cancel;
 
2.备库查询scn:
select current_scn from v$database;
 
3.主库备份:
backup incremental from scn <scn> database format '/diaglog/bk/full_%u_%p_%s' tag 'dg_gap';
 
4.拷贝到备库:
scp -p 
 
5.catalog 备份
catalog start with '/diaglog/bk/'; 
 
6.recover db(备库)
recover database <dbname>;
 
7 主库备份控制文件
alter database create standby controlfile as '/diaglog/bk/dg_gap_standby.ctl'
 
8.scp 控制文件
scp
 
9, 记录备库数据文件信息
 
spool datafile_names_step9.txt
set   lines 200
col   name format a100
select file#, name from v$datafile order by file# ;
spool off
 
10.恢复控制文件
shutdown immediate ;
startup nomount; 
restore standby controlfile from '/diaglog/bk/dg_gap_standby.ctl';
 
11,重新mount备库
shutdown; 
startup mount;
 
12.catalog datafiles in standby if location/name of datafiles is different
查询数据文件,如果数据文件目录和9步骤一致,该步骤可以跳过
spool  datafile_names_step12.txt
set    lines 200
col    name format a100
select file#, name from v$datafile order by file#;
spool off
如果不一致,需要重新命名数据文件
 
 
重命名方法:
catalog start with '+datadg/<db_unine_name>';  
switch  database to copy;
 
13.备库重设flashback
 
alter database flashback off;
alter database flashback on;
 
14, 备库,清空所有standby logfile
alter database clear logfile group &; 
 
15. 备库启动应用
alter database recover managed standby database disconnect;
 
参考文档:
steps to perform for rolling forward a physical standby database using rman incremental backup. (doc id 836986.1)
</db_unine_name></dbname></scn>
This entry was posted in adg. Bookmark the permalink.