Create a physical standby from the active database with RMAN DUPLICATE
OracleRMANCommand
# Prerequisites: standby instance in NOMOUNT with a pfile containing only db_name,
# primary password file copied, static listener entries and tnsnames on both sides.
rman target sys@<primary_tns> auxiliary sys@<standby_tns>
RUN {
ALLOCATE CHANNEL p1 DEVICE TYPE DISK;
ALLOCATE CHANNEL p2 DEVICE TYPE DISK;
ALLOCATE AUXILIARY CHANNEL s1 DEVICE TYPE DISK;
ALLOCATE AUXILIARY CHANNEL s2 DEVICE TYPE DISK;
DUPLICATE TARGET DATABASE FOR STANDBY FROM ACTIVE DATABASE
USING COMPRESSED BACKUPSET SECTION SIZE 32G
DORECOVER
SPFILE
SET db_unique_name='<standby_db_unique_name>'
SET control_files='+DATA','+FRA'
SET db_create_file_dest='+DATA'
SET db_recovery_file_dest='+FRA'
SET fal_server='<primary_tns>'
SET log_archive_dest_2=''
SET dg_broker_start='FALSE'
NOFILENAMECHECK;
}What it does
Copies the primary datafiles over the network to the standby server (without intermediate backup files), creates the spfile adapted for the standby, and applies the available archivelogs with DORECOVER.
When to use it
When building a new Data Guard standby or rebuilding a standby that cannot be reinstated.
Caution
Generates network and I/O load on the primary; do not run it at peak hours, or limit the number of channels. NOFILENAMECHECK is safe only when the standby is on a SEPARATE server; on the same server it can overwrite the primary files. Add standby redo logs (same size as the primary online redo, one extra group per thread) before or after, then configure the broker.
Related
- Create an RMAN recovery catalog and register the database
- Validate and clean up RMAN backup records (CROSSCHECK, EXPIRED, OBSOLETE)
- Validate the database and backups against corruption (VALIDATE)
- See which backups a restore would use and validate them (PREVIEW / VALIDATE)
- Repair corrupt blocks online (block media recovery, RECOVER CORRUPTION LIST)
- Return a tablespace to a point in the past (TSPITR)