1、主库生成RMAN备份
注意:要运用backup as compressed backupset,可以节省相当的空间
run
{
allocate channel c1 device type disk;
backup as compressed backupset format ' /u01/rmanbak/nfs/bk_%U' database;
sql 'alter system archive log current';
release channel c1;
}
2、主库生成从库的控制文件
SQL> alter database create standby controlfile as '/tmp/control01.ctl';
Database altered.
3、主库生成的RMAN备份和控制文件放置到从库制定的位置
因为RMAN备份直接放置到了用从库建立了NFS上,所以无需额外的传输,但控制文件需要移动到备库的相应目录
[oracle@dgserver standby]$ mv /u01/rmanbak/nfs/control01.ctl control01.ctl
[oracle@dgserver standby]$ cp control01.ctl control03.ctl
[oracle@dgserver standby]$ cp control01.ctl control02.ctl
4、从库RMAN恢复
[oracle@dgserver standby]$ rman target /
Recovery Manager: Release 10.2.0.5.0 - Production on Sun May 5 09:38:16 2013
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: PRIMARY (DBID=1656746419, not open)
RMAN> run {
allocate channel c1 device type disk;
allocate channel c2 device type disk;
allocate channel c3 device type disk;
allocate channel c4 device type disk;
restore database;
switch datafile all;
release channel c1;
release channel c2;
release channel c3;
release channel c4;
}