数据库恢复技术:
Backup-Based Duplication With a Target Connection
1,参数配置文件,启动数据到nomount
DB_NAME=somevalue
SQL> STARTUP NOMOUNT
2,连接数据库
RMAN> CONNECT TARGET SYS/sysdba@prod; # source database
connected to target database: PROD (DBID=39525561)
RMAN> CONNECT AUXILIARY SYS/sysdba@dupdb; # duplicate database instance
connected to auxiliary database: DUPDB (not mounted)
3,数据库复制
DUPLICATE TARGET DATABASE TO dupdb
FROM ACTIVE DATABASE
PASSWORD FILE
SPFILE
NOFILENAMECHECK;
// The PASSWORD FILE option specifies that RMAN should copy the password file to the destination host
// RMAN opens the database with the RESETLOGS option to create the online redo log
DUPLICATE DATABASE prod TO dupdb
DBID 8675309 # DBID of source database
UNTIL TIME "TO_DATE('11/01/2007', 'MM/DD/YYYY')"
SPFILE
NOFILENAMECHECK;
//The FROM ACTIVE DATABASE clause is not specified. By not specifying this clause, you instruct RMAN to perform backup-based duplication