On the primary node, perform. an RMAN backup of the primary database that places the backup pieces into the staging directory. For example:
[oracle@chicago_host1 stage]$ rman target /
RMAN> BACKUP DEVICE TYPE DISK FORMAT '/u01/backup/%U' DATABASE PLUS ARCHIVELOG;
RMAN> BACKUP DEVICE TYPE DISK FORMAT '/u01.backup/%U' CURRENT CONTROLFILE FOR STANDBY;
Standby要置为 SQL> startup nomount
rac01sty$cd backup/
rac01sty$ls
01l277gl_1_1 03l277i0_1_1 05l277jq_1_1 listener.ora
02l277h6_1_1 04l277i9_1_1 initORCL.ora tnsnames.ora
rac01sty$rman target sys/oracle@orcl_pri auxiliary /
Recovery Manager: Release 10.2.0.4.0 - Production on Wed Dec 30 05:40:07 2009
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: ORCL (DBID=1234616916)
connected to auxiliary database: ORCL (not mounted)
RMAN> duplicate target database for standby ;
Starting Duplicate Db at 30-DEC-09
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: sid=149 instance=orcl1 devtype=DISK
contents of Memory Script.:
{
restore clone standby controlfile;
sql clone 'alter database mount standby database';
}
executing Memory Script
Starting restore at 30-DEC-09
using channel ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: starting datafile backupset restore
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: reading from backup piece /u01/backup/05l277jq_1_1
channel ORA_AUX_DISK_1: restored backup piece 1
piece handle=/u01/backup/05l277jq_1_1 tag=TAG20091230T143642
channel ORA_AUX_DISK_1: restore complete, elapsed time: