-
备库
-
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)
阅读(6402) | 评论(0) | 转发(0) |