11GR2 Active Duplicate过程(单实例对单实例)

今天做了一下RMAN Active Duplicate实验。归根结底,弄明白了,其实整个过程还是挺简单的。
两台虚拟机IP分别是192.168.13.128, 192.168.13.129, 源端service_name: test01, 目标端service_name:dup01

1. SOURCE端与TARGET端都要有相同的目录结构, 在目标端创建所需的目录结构
   mkdir -p  /u01/app/oracle/fast_recovery_area/dup01 

   mkdir -p  /u01/app/oracle/oradata/dup01/

   mkdir -p  /u01/app/oracle/admin/dup01/adump

2. 将源端的密码文件$ORACLE_HOME/dbs/orapwtest01拷贝至目标端$ORACLE_HOME/dbs/, 改名
    scp [email protected]:/u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapwtest01 /u01/app/oracle/product/11.2.0/dbhome_1/dbs
   mv /u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapwtest01  /u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapwdup01

3. 创建pfile, $ORACLE_HOME/dbs/initdup01.ora, 内容很简单:
   db_name=dup01
4. active需要静态监听, listener.ora文件内容
  # listener.ora Network Configuration File: /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
  # Generated by Oracle configuration tools.
SID_LIST_LISTENER =
  (SID_LIST =
    (
     SID_DESC =
      (GLOBAL_DBNAME = test01)
      (ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
      (SID_NAME = test01)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = dup01)
      (ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
      (SID_NAME = dup01)
    )
  )


LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )


ADR_BASE_LISTENER = /u01/app/oracle


5. 源端配置两个TNS(tnsnames.ora):

  TEST01 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = test01)
    )
  )
dup01 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.13.129)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = dup01)
    )
  )

6. 将目标端启动至nomount状态
  
7.源端登录:
  rman target sys/sys@test01 auxiliary sys/sys@dup01
  DUPLICATE DATABASE TO dup01 FROM ACTIVE DATABASE SPFILE NOFILENAMECHECK;

如果没出现问题,就可以看到如下输出:
此处省略若干行....
sql statement: alter system set  db_name =  ''DUP01'' comment= ''Reset to original value by RMAN'' scope=spfile


sql statement: alter system reset  db_unique_name scope=spfile


Oracle instance shut down


connected to auxiliary database (not started)
Oracle instance started


Total System Global Area     835104768 bytes


Fixed Size                     2257840 bytes
Variable Size                541068368 bytes
Database Buffers             285212672 bytes
Redo Buffers                   6565888 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "DUP01" RESETLOGS ARCHIVELOG 
  MAXLOGFILES     16
  MAXLOGMEMBERS      3
  MAXDATAFILES      100
  MAXINSTANCES     8
  MAXLOGHISTORY      292
 LOGFILE
  GROUP   1  SIZE 50 M ,
  GROUP   2  SIZE 50 M ,
  GROUP   3  SIZE 50 M 
 DATAFILE
  '/u01/app/oracle/oradata/test01/system01.dbf'
 CHARACTER SET ZHS16GBK




contents of Memory Script:
{
   set newname for tempfile  1 to 
 "/u01/app/oracle/oradata/test01/temp01.dbf";
   switch clone tempfile all;
   catalog clone datafilecopy  "/u01/app/oracle/oradata/test01/sysaux01.dbf", 
 "/u01/app/oracle/oradata/test01/undotbs01.dbf", 
 "/u01/app/oracle/oradata/test01/users01.dbf", 
 "/u01/app/oracle/oradata/test01/example01.dbf";
   switch clone datafile all;
}
executing Memory Script


executing command: SET NEWNAME


renamed tempfile 1 to /u01/app/oracle/oradata/test01/temp01.dbf in control file


cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/test01/sysaux01.dbf RECID=1 STAMP=899163477
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/test01/undotbs01.dbf RECID=2 STAMP=899163477
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/test01/users01.dbf RECID=3 STAMP=899163477
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/test01/example01.dbf RECID=4 STAMP=899163477


datafile 2 switched to datafile copy
input datafile copy RECID=1 STAMP=899163477 file name=/u01/app/oracle/oradata/test01/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=899163477 file name=/u01/app/oracle/oradata/test01/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=899163477 file name=/u01/app/oracle/oradata/test01/users01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=4 STAMP=899163477 file name=/u01/app/oracle/oradata/test01/example01.dbf


contents of Memory Script:
{
   Alter clone database open resetlogs;
}
executing Memory Script


database opened
Finished Duplicate Db at 23-DEC-15


RMAN> quit




Recovery Manager complete.




来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/8520577/viewspace-1877360/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/8520577/viewspace-1877360/

你可能感兴趣的:(11GR2 Active Duplicate过程(单实例对单实例))