contents of Memory Script:
{
set newname for tempfile 1 to
"/DBSoft/oracle/oradata/woo/temp01.dbf";
switch clone tempfile all;
catalog clone datafilecopy "/DBSoft/oracle/oradata/woo/sysaux01.dbf",
"/DBSoft/oracle/oradata/woo/undotbs01.dbf",
"/DBSoft/oracle/oradata/woo/users01.dbf";
switch clone datafile all;
}
executing Memory Script
executing command: SET NEWNAME
renamed tempfile 1 to /DBSoft/oracle/oradata/woo/temp01.dbf in control file
cataloged datafile copy
datafile copy file name=/DBSoft/oracle/oradata/woo/sysaux01.dbf RECID=1 STAMP=881437718
cataloged datafile copy
datafile copy file name=/DBSoft/oracle/oradata/woo/undotbs01.dbf RECID=2 STAMP=881437718
cataloged datafile copy
datafile copy file name=/DBSoft/oracle/oradata/woo/users01.dbf RECID=3 STAMP=881437718
datafile 2 switched to datafile copy
input datafile copy RECID=1 STAMP=881437718 file name=/DBSoft/oracle/oradata/woo/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=881437718 file name=/DBSoft/oracle/oradata/woo/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=881437718 file name=/DBSoft/oracle/oradata/woo/users01.dbf
contents of Memory Script:
{
Alter clone database open resetlogs;
}
executing Memory Script
database opened
Reenabling controlfile options for auxiliary database
Executing: alter database flashback on
Finished Duplicate Db at 03-JUN-15
RMAN>
至此,duplicate已经完成,standby数据库已经起来了。
[oracle@db02 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Wed Jun 3 19:53:02 2015
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real Application Testing options
SQL> col host_name format a15
SQL> col file_name format a40
SQL> set line 150
SQL> select host_name,instance_name,status from gv$instance;
HOST_NAME INSTANCE_NAME STATUS
--------------- ---------------- ------------
db02 woo OPEN
SQL> select tablespace_name,file_name from dba_data_files;
TABLESPACE_NAME FILE_NAME
------------------------------ ----------------------------------------
SYSTEM /DBSoft/oracle/oradata/woo/system01.dbf
SYSAUX /DBSoft/oracle/oradata/woo/sysaux01.dbf
UNDOTBS1 /DBSoft/oracle/oradata/woo/undotbs01.dbf
USERS /DBSoft/oracle/oradata/woo/users01.dbf
注意:这里的nofilenamecheck参数需要解释下:
如果在复制时,位置不同时,我们会用参数db_file_name_convert 对文件位置进行转换。 但是在这个复制示例中我们用的是相同的位置。 所以这里必须加上nofilenamecheck参数。 该参数通知复制操作不必在执行还原操作前确认文件名是不同的。如果没有指定nofilenamecheck参数,rman会给出如下错误:
RMAN-05001: auxiliary filename /DBSoft/oracle/oradata/woo/users01.dbf conflicts with a file used by the target database