oper-O11gR2+ASM+RAC使用duplicate快速复制一个库到单实例

Posted 进无止境,前方是谁的身影

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了oper-O11gR2+ASM+RAC使用duplicate快速复制一个库到单实例相关的知识,希望对你有一定的参考价值。

环境:

源库:O11gR2+ASM+RAC+rhel6.4

目标库:O11gR2+rhel6.4单实例

步骤

1、配置静态监听

源库:/u01/app/11.2.0/grid_1/network/admin/listener.ora

SID_LIST_LISTENER =
  (SID_LIST =
     (SID_DESC =
        (GLOBAL_DBNAME = bpm)
        (ORACLE_HOME = /u01/app/oracle/product/11.2.0/db_1)
        (SID_NAME = bpm1)
      )
  )

目标库:/u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora

SID_LIST_LISTENER =
  (SID_LIST =
     (SID_DESC =
        (GLOBAL_DBNAME = bpm)
        (ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
        (SID_NAME = bpm)
      )
  )

2、配置别名tnsname.ora

源库:/u01/app/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora

bpm =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.25.2)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = bpm)
    )
  )
  
bpmt =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.27.32)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = bpm)
    )
  )

目标库:/u01/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsname.ora

bpm =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.25.2)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = bpm)
    )
  )
  
bpmt =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.27.32)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = bpm)
    )
  )

3、配置口令文件

    3.1 直接从源库复制口令文件至备库

    3.2 创建新的口令文件

    orapwd file=orapwbpm password=xxxx entries=5

4、编写复制脚本

run {
 set newname for datafile 1 to /u01/app/oracle/oradata/bpm/system01.dbf;
 set newname for datafile 2 to /u01/app/oracle/oradata/bpm/sysaux01.dbf;
 set newname for datafile 3 to /u01/app/oracle/oradata/bpm/undotbs1.dbf;
 set newname for datafile 4 to /u01/app/oracle/oradata/bpm/users01.dbf;
 set newname for datafile 5 to /u01/app/oracle/oradata/bpm/undotbs2.dbf;
 set newname for datafile 6 to /u01/app/oracle/oradata/bpm/bpm01.dbf;
 set newname for tempfile 1 to /u01/app/oracle/oradata/bpm/temp01.dbf;
 set newname for tempfile 2 to /u01/app/oracle/oradata/bpm/bpm_t_tbs01.dbf; 
duplicate target database to bpm from active database
 spfile  
 set db_unique_name=bpmt
 set control_files=/u01/app/oracle/oradata/bpm/control01.ctl,/u01/app/oracle/oradata/bpm/control02.ctl
 set log_file_name_convert=+DATA,/u01/app/oracle/oradata/
 set log_archive_dest_1=LOCATION=/u01/app/oracle/fast_recovery_area
 set db_recovery_file_dest=/u01/app/oracle/fast_recovery_area
 set DB_RECOVERY_FILE_DEST_SIZE=3G
 set db_create_file_dest=/u01/app/oracle/oradata/bpm
 set cluster_database=false
 set audit_file_dest=/u01/app/oracle/admin/bpm/adump
 set MEMORY_TARGET=2G
 nofilenamecheck;
}

实际测试过程中

db_file_name_convert=‘+DATA’,‘/u01/app/oracle/oradata/‘ 没有生效导致报错,使用set newname代替...后期再测试

5、执行数据库复制(在源库或者目标库执行都可以)

rman target backup/[email protected] auxiliary backup/[email protected]

   执行上诉编写好的脚本

6、复制完处理

  6.1 清除thread 2信息  

alter database disable thread 2;
alter database drop logfile group
3; alter database drop logfile group 4;
drop tablespace  undotbs2 including contents and datafiles;

7、测试

   select * from dual;

 

以上是关于oper-O11gR2+ASM+RAC使用duplicate快速复制一个库到单实例的主要内容,如果未能解决你的问题,请参考以下文章

11gR2 RAC环境重建ASM SPFILE

求助,11gr2 rac asm磁盘挂载不了,报ora-00600错误

Oracle RAC + ASM + Grid安装

完美解决oracle11gR2安装grid检查ASM报错PRVG-10122

通过udev创建ASM共享磁盘(RAC)

ORACLE11g R2RAC+ASM→RAC+ASM