-
备库
-
recover managed standby database cancel;
-
select min(s) min_scn from(select current_scn s from v$database
-
union select min(checkpoint_change#)from v$datafile_header);
-
假设这里的{banned}最佳小scn是3162298
-
-
主库识别这些新增的文件
-
select file#, name from v$datafile where creation_change# >3162298;
-
假设这里有678三个新增文件
-
-
backup datafile 6,7,8 format '/tmp/forstandby_%u' tag 'forstandby';
-
backup incremental from scn 3162298 database format '/tmp/forstandby_%u' tag 'forstandby';
-
backup current controlfile for standby format '/tmp/forstandbyctrl.bck';
-
scp /tmp/forstandby* 备库:/tmp
-
-
备库
-
shutdown immediate;
-
startup nomount;
-
restore standby controlfile from '/tmp/forstandbyctrl.bck';
-
alter database mount;
-
catalog start with '/tmp/forstandby';
-
-
run
-
{
-
allocate channel c1 type disk;
allocate channel c2 type disk;
allocate channel c3 type disk;
allocate channel c4 type disk;
set newname for datafile 6 to' diskgroup';
-
set newname for datafile 7 to ' diskgroup';
-
set newname for datafile 8 to ' diskgroup';
-
restore datafile 6,7,8;
-
}
-
-
catalog start with '备库文件位置'; --例如: data/orcldg/datafile/
-
switch database to copy;
-
-
run
-
{
-
allocate channel c1 type disk;
allocate channel c2 type disk;
allocate channel c3 type disk;
allocate channel c4 type disk;
-
recover database noredo;
-
-
}
-
alter database flashback off; --根据需要
-
alter database flashback on;
-
备库
-
sqplus / as sysdba
-
alter database clear logfile group 1;
-
alter database clear logfile group 2;
-
alter database clear logfile group 3;
-
recover managed standby database disconnect;
-
参考:
将数据文件添加到主数据库时使用 rman 增量备份前滚备用数据库的步骤(文档 id 1531031.1)
阅读(6238) | 评论(0) | 转发(0) |