一旦载10g的,没有票据。昨天使用duplicate方法一安装11g ADG,过程艰辛,记录:

一、环境配置

主图书馆

IP地址:192.168.233.128/24

操作系统版本号:rhel5.8 64bit

数据库版本号:11.2.0.1 64bit

数据库sid名:orcl

数据库名:orcl

数据库db_unique_name:orcl1

主机名:pr

物理备库

IP地址:192.168.233.129/24

操作系统版本号:rhel5.8 64bit

数据库版本号:11.2.0.1 64bit

数据库sid名:orcl

数据库名:orcl

数据库db_unique_name:orcl2

主机名:st

二、改动主备库listener.ora,tnsnames.ora文件例如以下

[oracle@pr admin]$ more listener.ora

LISTENER =

  (DESCRIPTION_LIST =

    (DESCRIPTION =

      (ADDRESS = (PROTOCOL = TCP)(HOST = pr)(PORT = 1521))

      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))

    )

  )

[oracle@pr admin]$ more tnsnames.ora

orcl1=

  (DESCRIPTION =

    (ADDRESS_LIST =

      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.233.128)(PORT = 1521))

    )

    (CONNECT_DATA =

      (SERVICE_NAME = orcl1)

    )

  )

orcl2=

  (DESCRIPTION =

    (ADDRESS_LIST =

      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.233.129)(PORT = 1521))

    )

    (CONNECT_DATA =

      (SERVICE_NAME = orcl2)

    )

  )

[oracle@st admin]$ more listener.ora

LISTENER =

  (DESCRIPTION_LIST =

    (DESCRIPTION =

      (ADDRESS = (PROTOCOL = TCP)(HOST = st)(PORT = 1521))

      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))

    )

  )

SID_LIST_LISTENER =

 (SID_LIST =

 (SID_DESC =

 (GLOBAL_DBNAME = orcl2)

 (ORACLE_HOME = /export/11g/product)

 (SID_NAME = orcl)

 )

 )

[oracle@st admin]$ more tnsnames.ora

orcl1=

  (DESCRIPTION =

    (ADDRESS_LIST =

      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.233.128)(PORT = 1521))

    )

    (CONNECT_DATA =

      (SERVICE_NAME = orcl1)

    )

  )

orcl2=

  (DESCRIPTION =

    (ADDRESS_LIST =

      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.233.129)(PORT = 1521))

    )

    (CONNECT_DATA =

      (SERVICE_NAME = orcl2)

    )

  )

 

三、改动主库、备库的pfile文件。红色部分为新添加的部分。

[oracle@pr dbs]$ more initorcl.ora

orcl.__db_cache_size=142606336

orcl.__java_pool_size=4194304

orcl.__large_pool_size=4194304

orcl.__oracle_base='/export/11g'#ORACLE_BASE set from environment

orcl.__pga_aggregate_target=167772160

orcl.__sga_target=251658240

orcl.__shared_io_pool_size=0

orcl.__shared_pool_size=92274688

orcl.__streams_pool_size=0

*.audit_file_dest='/export/11g/admin/orcl/adump'

*.audit_trail='db'

*.compatible='11.2.0.0.0'

*.control_files='/export/11g/oradata/orcl/control01.ctl','/export/11g/flash_recovery_area/orcl/control02.ctl'

*.db_block_size=8192

*.db_domain=''

*.db_name='orcl'

*.db_recovery_file_dest='/export/11g/flash_recovery_area'

*.db_recovery_file_dest_size=4070572032

*.diagnostic_dest='/export/11g'

*.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)'

*.log_archive_format='%t_%s_%r.dbf'

*.memory_target=417333248

*.open_cursors=300

*.processes=150

*.remote_login_passwordfile='EXCLUSIVE'

*.undo_tablespace='UNDOTBS1'

*.db_unique_name='orcl1'

*.fal_client='orcl1'

 *.fal_server='orcl2'

 *.log_archive_config='DG_CONFIG=(orcl1,orcl2)'

*.log_archive_dest_1='LOCATION=USE_DB_RECOVERY_FILE_DEST valid_for=(all_logfiles,primary_role) db_unique_name=orcl1'

 *.log_archive_dest_2='SERVICE=orcl2 lgwr async valid_for=(online_logfile,primary_role) db_unique_name=orcl2'

 *.remote_login_passwordfile='EXCLUSIVE'

 *.standby_file_management='AUTO'
[oracle@st dbs]$ more initorcl.ora

orcl.__db_cache_size=142606336

orcl.__java_pool_size=4194304

orcl.__large_pool_size=4194304

orcl.__oracle_base='/export/11g'#ORACLE_BASE set from environment

orcl.__pga_aggregate_target=167772160

orcl.__sga_target=251658240

orcl.__shared_io_pool_size=0

orcl.__shared_pool_size=92274688

orcl.__streams_pool_size=0

*.audit_file_dest='/export/11g/admin/orcl/adump'

*.audit_trail='db'

*.compatible='11.2.0.0.0'

*.control_files='/export/11g/oradata/orcl/control01.ctl','/export/11g/flash_recovery_area/orcl/control02.ctl'

*.db_block_size=8192

*.db_domain=''

*.db_name='orcl'

*.db_recovery_file_dest='/export/11g/flash_recovery_area'

*.db_recovery_file_dest_size=4070572032

*.diagnostic_dest='/export/11g'

*.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)'

*.log_archive_format='%t_%s_%r.dbf'

*.memory_target=417333248

*.open_cursors=300

*.processes=150

*.remote_login_passwordfile='EXCLUSIVE'

*.undo_tablespace='UNDOTBS1'

*.fal_client='orcl2'

 *.fal_server='orcl1'

 *.log_archive_config='DG_CONFIG=(orcl1,orcl2)'

*.log_archive_dest_1='LOCATION=USE_DB_RECOVERY_FILE_DEST valid_for=(all_logfiles,primary_role) db_unique_name=orcl2'

 *.log_archive_dest_2='SERVICE=orcl1 lgwr async valid_for=(online_logfile,primary_role) db_unique_name=orcl1'

 *.remote_login_passwordfile='EXCLUSIVE'

 *.standby_file_management='AUTO'

 *.db_unique_name='orcl2'

四、在备库上创建对应的文件夹

如udump/,oradate/

五、将备库启动到nomount状态。然后连接主库进行duplicate操作

  1. [oracle@dg2 ~]$ lsnrctl start
  2. [oracle@dg2 ~]$ orapwd file=$ORACLE_HOME/dbs/orapworclpassword=oracle
    entries=5
  3. [oracle@dg2 ~]$ sqlplus /nolog
  4. SQL*Plus: Release 11.2.0.1.0 Production on Sun Apr 22 13:36:53 2012
  5. Copyright (c) 1982, 2011, Oracle.  All rights reserved.
  6. SQL> conn /as sysdba
  7. Connected to an idle instance.
  8. SQL> create spfile frompfile='/export/11g/product/dbs/initorcl.ora';
  9. File created.
  10. SQL> startup nomount
  11. ORACLE instance started.
  12. Total System Global Area  417546240 bytes
  13. Fixed Size                  2228944 bytes
  14. Variable Size             285216048 bytes
  15. Database Buffers          121634816 bytes
  16. Redo Buffers                8466432 bytes

[oracle@st dbs]rman targetsys/oracle@orcl1
auxiliarysys/oracle@orcl2

RMAN> duplicate target database for standby from activedatabase nofilenamecheck;

Starting Duplicate Db at 10-NOV-14

using target databasecontrol file instead of recovery catalog

allocated channel:ORA_AUX_DISK_1

channel ORA_AUX_DISK_1:SID=20 device type=DISK

contents of MemoryScript:

{

backup as copy reuse

targetfile '/export/11g/product/dbs/orapworcl' auxiliary format

'/export/11g/product/dbs/orapworcl'   ;

}

executing Memory Script

Starting backup at 10-NOV-14

allocated channel:ORA_DISK_1

channel ORA_DISK_1:SID=43 device type=DISK

Finished backup at10-NOV-14

contents of MemoryScript:

{

backup as copy current controlfile forstandby auxiliary format '/export/11g/oradata/orcl/control01.ctl';

restore clone controlfile to '/export/11g/flash_recovery_area/orcl/control02.ctl' from

'/export/11g/oradata/orcl/control01.ctl';

}

executing Memory Script

Starting backup at 10-NOV-14

using channel ORA_DISK_1

channel ORA_DISK_1:starting datafile copy

copying standby controlfile

output filename=/export/11g/product/dbs/snapcf_orcl.f tag=TAG20141110T094600 RECID=5STAMP=863257560

channel ORA_DISK_1:datafile copy complete, elapsed time: 00:00:03

Finished backup at10-NOV-14

Starting restore at 10-NOV-14

using channelORA_AUX_DISK_1

channel ORA_AUX_DISK_1:copied control file copy

Finished restore at10-NOV-14

contents of MemoryScript:

{

sql clone 'alter database mount standbydatabase';

}

executing Memory Script

sql statement: alterdatabase mount standby database

contents of MemoryScript:

{

set newname for tempfile  1 to

"/export/11g/oradata/orcl/temp01.dbf";

switch clone tempfile all;

set newname for datafile  1 to

"/export/11g/oradata/orcl/system01.dbf";

set newname for datafile  2 to

"/export/11g/oradata/orcl/sysaux01.dbf";

set newname for datafile  3 to

"/export/11g/oradata/orcl/undotbs01.dbf";

set newname for datafile  4 to

"/export/11g/oradata/orcl/users01.dbf";

set newname for datafile  5 to

"/export/11g/oradata/orcl/example01.dbf";

backup as copy reuse

datafile 1 auxiliary format

"/export/11g/oradata/orcl/system01.dbf"   datafile

2 auxiliary format

"/export/11g/oradata/orcl/sysaux01.dbf"   datafile

3 auxiliary format

"/export/11g/oradata/orcl/undotbs01.dbf"   datafile

4 auxiliary format

"/export/11g/oradata/orcl/users01.dbf"   datafile

5 auxiliary format

"/export/11g/oradata/orcl/example01.dbf"   ;

sql 'alter system archive log current';

}

executing Memory Script

executing command: SETNEWNAME

renamed tempfile 1 to/export/11g/oradata/orcl/temp01.dbf in control file

executing command: SETNEWNAME

executing command: SETNEWNAME

executing command: SETNEWNAME

executing command: SETNEWNAME

executing command: SETNEWNAME

Starting backup at 10-NOV-14

using channel ORA_DISK_1

channel ORA_DISK_1:starting datafile copy

input datafile filenumber=00001 name=/export/11g/oradata/orcl/system01.dbf

output filename=/export/11g/oradata/orcl/system01.dbf tag=TAG20141110T094610

channel ORA_DISK_1:datafile copy complete, elapsed time: 00:00:56

channel ORA_DISK_1: startingdatafile copy

input datafile filenumber=00002 name=/export/11g/oradata/orcl/sysaux01.dbf

output filename=/export/11g/oradata/orcl/sysaux01.dbf tag=TAG20141110T094610

channel ORA_DISK_1:datafile copy complete, elapsed time: 00:00:35

channel ORA_DISK_1:starting datafile copy

input datafile filenumber=00005 name=/export/11g/oradata/orcl/example01.dbf

output filename=/export/11g/oradata/orcl/example01.dbf tag=TAG20141110T094610

channel ORA_DISK_1:datafile copy complete, elapsed time: 00:00:16

channel ORA_DISK_1:starting datafile copy

input datafile filenumber=00003 name=/export/11g/oradata/orcl/undotbs01.dbf

output filename=/export/11g/oradata/orcl/undotbs01.dbf tag=TAG20141110T094610

channel ORA_DISK_1:datafile copy complete, elapsed time: 00:00:07

channel ORA_DISK_1:starting datafile copy

input datafile filenumber=00004 name=/export/11g/oradata/orcl/users01.dbf

output filename=/export/11g/oradata/orcl/users01.dbf tag=TAG20141110T094610

channel ORA_DISK_1:datafile copy complete, elapsed time: 00:00:07

Finished backup at10-NOV-14

sql statement: altersystem archive log current

contents of MemoryScript:

{

switch clone datafile all;

}

executing Memory Script

datafile 1 switched todatafile copy

input datafile copyRECID=5 STAMP=863257693 file name=/export/11g/oradata/orcl/system01.dbf

datafile 2 switched todatafile copy

input datafile copyRECID=6 STAMP=863257694 file name=/export/11g/oradata/orcl/sysaux01.dbf

datafile 3 switched todatafile copy

input datafile copyRECID=7 STAMP=863257694 file name=/export/11g/oradata/orcl/undotbs01.dbf

datafile 4 switched todatafile copy

input datafile copyRECID=8 STAMP=863257694 file name=/export/11g/oradata/orcl/users01.dbf

datafile 5 switched todatafile copy

input datafile copyRECID=9 STAMP=863257694 file name=/export/11g/oradata/orcl/example01.dbf

Finished Duplicate Db at10-NOV-14

RMAN> exit

Recovery Managercomplete.

至此备库创建完毕。

期间遇到非常多的问题,如今总结例如以下:

1、运行[oracle@st dbs]rman target
sys/oracle@orcl1 auxiliarysys/oracle@orcl2时候,提示不能连接到orcl1。可是能ping同pr。原来是防火墙没有开通过

2、tnsname.ora文件里service_name 与连接对端的监听中的service_name相相应。

3、备库中的配置了静态监听。详细原因參见:http://blog.itpub.net/23135684/viewspace-692707

4、执行duplicate target database for standby from active database nofilenamecheck;执行过程中出现了下面错误,是由于缺少文中的第四步。没有在备库上创建对应的文件夹。

RMAN> duplicate target database for standby from active database;

Starting Duplicate Db at 10-NOV-14

using target database control file instead of recovery catalog

allocated channel: ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: SID=19 device type=DISK

……省略

contents of Memory Script:

{

   backup as copy current controlfile for standby auxiliary format  '/export/11g/oradata/orcl/control01.ctl';

   restore clone controlfile to  '/export/11g/flash_recovery_area/orcl/control02.ctl' from

 '/export/11g/oradata/orcl/control01.ctl';

}

executing Memory Script

Starting backup at 10-NOV-14

using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile copy

copying standby control file

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03002: failure of Duplicate Db command at 11/10/2014 09:24:29

RMAN-03015: error occurred in stored script Memory Script

RMAN-03009: failure of backup command on ORA_DISK_1 channel at 11/10/2014 09:24:29

ORA-17628: Oracle error 19505 returned by remote Oracle server

5、执行duplicate target database for standby from active database nofilenamecheck;。执行过程中出现了下面错误,是由于没有使用nofilenamecheck。

RMAN> duplicate target database for standby from active database;

Starting Duplicate Db at 10-NOV-14

using channel ORA_AUX_DISK_1

…… …… 省略

contents of Memory Script:

{

   sql clone 'alter database mount standby database';

}

executing Memory Script

sql statement: alter database mount standby database

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03002: failure of Duplicate Db command at 11/10/2014 09:33:14

RMAN-05501: aborting duplication of target database

RMAN-05001: auxiliary file name /export/11g/oradata/orcl/example01.dbf conflicts with a file used by the target database

RMAN-05001: auxiliary file name /export/11g/oradata/orcl/users01.dbf conflicts with a file used by the target database

RMAN-05001: auxiliary file name /export/11g/oradata/orcl/undotbs01.dbf conflicts with a file used by the target database

RMAN-05001: auxiliary file name /export/11g/oradata/orcl/sysaux01.dbf conflicts with a file used by the target database

RMAN-05001: auxiliary file name /export/11g/oradata/orcl/system01.dbf conflicts with a file used by the target database

组态ORACLE 11G ADG的更多相关文章

  1. 转载:oracle 11g ADG实施手册(亲测,已成功部署多次)

    https://www.cnblogs.com/yhfssp/p/7815078.html 一:实验环境介绍 虚拟机系统: RHEL Linux 6.4(64位) 数据库版本: Oracle 11gR ...

  2. oracle 11g ADG实施手册(亲测,已成功部署多次)

    一:实验环境介绍 虚拟机系统:    RHEL Linux 6.4(64位) 数据库版本:    Oracle 11gR2 11.2.0.4 (64位) IP地址规划: 主数据库 192.168.11 ...

  3. CentOS 7 下oracle 11G R2 ADG 搭建

    本文记录ADG搭建操作步骤,首先在虚拟机CentOS中安装并配置好oracle 11g R2(具体安装步骤在我的另一篇博客中),然后拷贝一份虚拟机,修改新虚拟机的主机名和ip配置,这时候主库和备库是一 ...

  4. 11g adg 环境搭建实施手册-0908

    11g adg 环境搭建实施手册-0908 2017年8月30日 9:16 11g adg 环境搭建实施手册-0824 2017年8月24日 10:18 ####################### ...

  5. Red Hat Enterprise Linux 6上安装Oracle 11G(11.2.0.4.0)缺少pdksh包的问题

    RHEL 6上安装Oracle 11G警告缺少pdksh包 前言 相信很多刚刚接触学习Oracle的人,在RHEL6上安装11.2.0.3 or 11.2.0.4这两个版本的时候, 都遇到过先决条件检 ...

  6. Oracle 11g必须开启的服务及服务详细介绍

    转自:http://www.educity.cn/shujuku/404120.html 成功安装Oracle  11g数据库后,你会发现自己电脑运行速度会变慢,配置较低的电脑甚至出现非常卡的状况,通 ...

  7. 【Oracle 集群】Oracle 11G RAC教程之集群安装(七)

    Oracle 11G RAC集群安装(七) 概述:写下本文档的初衷和动力,来源于上篇的<oracle基本操作手册>.oracle基本操作手册是作者研一假期对oracle基础知识学习的汇总. ...

  8. Linux平台oracle 11g单实例 安装部署配置 快速参考

    1.重建主机的Oracle用户 组 统一规范 uid gid 以保证共享存储挂接或其他需求的权限规范 userdel -r oracle groupadd -g 7 oinstall groupadd ...

  9. Linux平台oracle 11g单实例 + ASM存储 安装部署 快速参考

    操作环境:Citrix虚拟化环境中申请一个Linux6.4主机(模板)目标:创建单机11g + ASM存储 数据库 1. 主机准备 2. 创建ORACLE 用户和组成员 3. 创建以下目录并赋予对应权 ...

随机推荐

  1. 大约apache 2.4.X虚拟主机配置问题的版本号后,

    重装系统,习惯性下载最新的wamp2.5,在各种配置,然后一切正常反应.数据库,代码. 然后打开浏览器,尼嘛,幸运的是,昨天,与虚拟域,其实403该. apache error log的信息是:AH0 ...

  2. Java模式(适配器型号)

    今天阅读Java该适配器模式,这里有一个小的总结和下谈感受.对于将来使用. 首先.让我们有关适配器先说说. 适应是“来源”至“目标”适应.其中连接这两个的关系是适配器.它负责“源”过度到“目标”. 举 ...

  3. Flappy bird源代码(略吊)

    #include<stdio.h> #include<stdlib.h> #include<conio.h> #include<time.h> #inc ...

  4. 为什么MVC不是一种设计模式(转)

    MVC(Model-View-Controller)是处理界面应用程序时常用的解决方案,构成了表示层. MVC通过分离模型.视图.控制器在应用程序中的角色,实现界面和业务逻辑的解耦.Model(是OO ...

  5. DMA为什么比轮询、中断方式性能要卓越非常多?(你不懂)

    本文原创为freas_1990,转载请标明出处:http://blog.csdn.net/freas_1990/article/details/35735397 假设是计算机专业出身的同学,都听过一个 ...

  6. HDU 2012 素性

    素性 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submiss ...

  7. Linux高性能server规划——处理池和线程池

    进程池和线程池 池的概念 由于server的硬件资源"充裕".那么提高server性能的一个非常直接的方法就是以空间换时间.即"浪费"server的硬件资源.以 ...

  8. linux 下安装mysql

    看以下这篇文章就够了   http://www.cnblogs.com/xiaoluo501395377/archive/2013/04/07/3003278.html 查看有没有安装过:       ...

  9. LinuxDLL加载优化方案

    作者:zhanhailiang 日期:2014-10-26 linux程序动态库载入流程简单介绍 linux从程序(program或对象)变成进程(process或进程),简单说来须要经过三步: fo ...

  10. BZOJ 2588 Count on a tree (COT) 是持久的段树

    标题效果:两棵树之间的首次查询k大点的权利. 思维:树木覆盖树,事实上,它是正常的树木覆盖了持久段树. 由于使用权值段树可以寻求区间k大,然后应用到持久段树思想,间隔可以做减法.详见代码. CODE: ...