Using RMAN DUPLICATE DATABASE(操作笔记)


1、在auxiliary 服务器上安装oracle 软件,(不要创建数据库)


2.从target 数据库上得到pfile ,拷贝到auxiliary 相对应的位置,(修改相应的参数)


3.auxiliary服务器:根据pfile 和需要创建相应的目录。

 

(目录结构不同的,应在pfile 后面加)

*.db_file_name_convert=('/u01/app/oracle/oradata/hanmi/','/u01/oracle/oradata/hanmi')
*.log_file_name_convert=('/u01/app/oracle/oradata/hanmi/','/u01/oracle/oradata/hanmi')

/u01/app/oracle/oradata/hanmi/  是target 数据库 temp 表空间目录

/u01/oracle/oradata/hanmi           是auxiliary 数据库 temp 表空间的目录


4.创建网络配制文件listener.ora sqlnet.ora  tnsnames.ora 使能连上target 数据库

 


5.备份target 数据库,并且与archive log 一起 拷贝到auxiliary 服务器上相同的目录


6.设置sys密码文体:

orapwd file=/u01/oracle/product/10.2.0/db_1/dbs/orapwhanmi password=hanmihanmi  entries=4

 

7. auxiliary服务器启动到nomount 状态。


8.连接两个数据库,clone数据库:

  [oracle@oracle ~]$ rman target sys/hanmiit@hanmi35 auxiliary sys/hanmihanmi

      rman> run{

  DUPLICATE TARGET DATABASE TO dupdb
  # specify client-side parameter file (on same host as RMAN client) for
  # auxiliary instance if necessary
  PFILE = /dup/oracle/dbs/initDUPDB.ora
  NOFILENAMECHECK;   (目录结构相同)
}

 


目录结构不同用下面的脚本:


RUN
{
  # set new filenames for the datafiles
 set newname for datafile 1 to '/u01/oracle/oradata/hanmi/system01.dbf';

set newname for datafile 2 to '/u01/oracle/oradata/hanmi/undotbs01.dbf';
set newname for datafile 3 to '/u01/oracle/oradata/hanmi/sysaux01.dbf';
set newname for datafile 4 to '/u01/oracle/oradata/hanmi/users01.dbf';
set newname for datafile 5 to '/u01/oracle/oradata/hanmi/bjhanmi01.dbf';
set newname for datafile 6 to '/u01/oracle/oradata/hanmi/gsp01.dbf';
set newname for datafile 7 to '/u01/oracle/oradata/hanmi/unia01.dbf';
set newname for datafile 8 to '/u01/oracle/oradata/hanmi/sfa01.dbf';
set newname for datafile 9 to '/u01/oracle/oradata/hanmi/rmkunia01.dbf';
set newname for datafile 10 to '/u01/oracle/oradata/hanmi/hmp01.dbf';

duplicate target DATABASE TO hanmi LOGFILE
'/u01/oracle/oradata/redo01' size 200m,
'/u01/oracle/oradata/redo02' size 200m,
'/u01/oracle/oradata/redo03' size 200m;

}

参考:

 source:http://download.oracle.com/docs/cd/B19306_01/backup.102/b14191/rcmdupdb.htm#i1006672


source:http://download.oracle.com/docs/cd/B19306_01/backup.102/b14191/rcmdupdb.htm#i1006474

source:http://download.oracle.com/docs/cd/B19306_01/backup.102/b14191/rcmdupdb.htm#BRADV169


 

你可能感兴趣的:(职场,using,rman,database,DUPLICATE,休闲)