博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
使用duplicate创建dataguard
阅读量:6486 次
发布时间:2019-06-23

本文共 7963 字,大约阅读时间需要 26 分钟。

   晚上花了很长时间用duplicate创建了一个DG。其实真个过程都是比较容易的,只是自己有些地方因为经常不小心搞错,导致花了比较久,简单记录下:

   要注意db_name必须要一样。其中主库是orcl,备库是orcm。

主库的listener.ora设置

LISTENER =  (DESCRIPTION_LIST =    (DESCRIPTION =      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.21)(PORT = 1521))    )  )                                                                                                                                                                                        ADR_BASE_LISTENER = /u01/app/oracle                                                                                                                                                                                        SID_LIST_LISTENER =  (SID_LIST =    (SID_DESC =      (GLOBAL_DBNAME = orcl)      (ORACLE_HOME = /u01/app/oracle/product/11.2.0/db_1)      (SID_NAME = orcl)    )  )

主库的initorcl.ora增加的内容

*.db_name='orcl'*.db_unique_name='orcl_pd'*.log_archive_config='dg_config=(orcl_pd,orcl_st)'*.log_archive_dest_1='location=/u01/archivelog valid_for=(all_logfiles,all_roles) db_unique_name=orcl_pd'*.log_archive_dest_2='service=orcl_st reopen=120 lgwr async valid_for=(online_logfiles,primary_role) db_unique_name=orcl_st'*.log_archive_dest_state_1=enable*.log_archive_dest_state_2=enable*.standby_file_management='auto'*.fal_server='orcl_st'*.fal_client='orcl_pd'

备库的listener.ora设置

STENER =  (DESCRIPTION_LIST =    (DESCRIPTION =      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.22)(PORT = 1521))    )  )                                                                                                                                                                       ADR_BASE_LISTENER = /u01/app/oracle                                                                                                                                                                       SID_LIST_LISTENER =  (SID_LIST =    (SID_DESC =      (GLOBAL_DBNAME = orcm)      (ORACLE_HOME = /u01/app/oracle/product/11.2.0/db_1)      (SID_NAME = orcm)    )  )

备库的initorcm.ora的设置

*.db_name=orcl*.control_files='/u01/app/oracle/oradata/orcm/control01.ctl', '/u01/app/oracle/oradata/orcm/control02.ctl','/u01/app/oracle/oradata/orcm/control03.ctl'*.db_unique_name='orcl_st'*.log_archive_config='dg_config=(orcl_pd,orcl_st)'*.log_archive_dest_1='location=/u01/archivelog valid_for=(all_logfiles,all_roles) db_unique_name=orcl_st'*.log_archive_dest_2='service=orcl_pd reopen=120 lgwr async valid_for=(online_logfiles,primary_role) db_unique_name=orcl_pd'*.log_archive_dest_state_1=enable*.log_archive_dest_state_2=enable*.standby_file_management='auto'*.fal_server='orcl_pd'*.fal_client='orcl_st'*.log_file_name_convert='/u01/app/oracle/oradata/orcl','/u01/app/oracle/oradata/orcm'*.db_file_name_convert='/u01/app/oracle/oradata/orcl','/u01/app/oracle/oradata/orcm'

主库和备库的tnsnames.ora设置

ORCL_ST =  (DESCRIPTION =    (ADDRESS_LIST =      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.22)(PORT = 1521))    )    (CONNECT_DATA =      (SERVICE_NAME = orcm)    )  )                                                                                                                                                                                                               ORCL_PD =  (DESCRIPTION =    (ADDRESS_LIST =      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.21)(PORT = 1521))    )    (CONNECT_DATA =      (SERVICE_NAME = orcl)    )  )

最后贴一下成功的喜悦,希望可以帮助到大家:

Starting Duplicate Db at 18-JUN-13using target database control file instead of recovery catalogallocated channel: ORA_AUX_DISK_1channel ORA_AUX_DISK_1: SID=20 device type=DISKcontents of Memory Script:{   backup as copy reuse   targetfile  '/u01/app/oracle/product/11.2.0/db_1/dbs/orapworcl' auxiliary format '/u01/app/oracle/product/11.2.0/db_1/dbs/orapworcm'   ;}executing Memory ScriptStarting backup at 18-JUN-13allocated channel: ORA_DISK_1channel ORA_DISK_1: SID=41 device type=DISKFinished backup at 18-JUN-13contents of Memory Script:{   backup as copy current controlfile for standby auxiliary format  '/u01/app/oracle/oradata/orcm/control01.ctl';   restore clone controlfile to  '/u01/app/oracle/oradata/orcm/control02.ctl' from '/u01/app/oracle/oradata/orcm/control01.ctl';   restore clone controlfile to  '/u01/app/oracle/oradata/orcm/control03.ctl' from '/u01/app/oracle/oradata/orcm/control01.ctl';}executing Memory ScriptStarting backup at 18-JUN-13using channel ORA_DISK_1channel ORA_DISK_1: starting datafile copycopying standby control fileoutput file name=/u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_orcl.f tag=TAG20130618T051238 RECID=2 STAMP=818399559channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03Finished backup at 18-JUN-13Starting restore at 18-JUN-13using channel ORA_AUX_DISK_1channel ORA_AUX_DISK_1: copied control file copyFinished restore at 18-JUN-13Starting restore at 18-JUN-13using channel ORA_AUX_DISK_1channel ORA_AUX_DISK_1: copied control file copyFinished restore at 18-JUN-13contents of Memory Script:{   sql clone 'alter database mount standby database';}executing Memory Scriptsql statement: alter database mount standby databasecontents of Memory Script:{   set newname for tempfile  1 to "/u01/app/oracle/oradata/orcm/temp01.dbf";   switch clone tempfile all;   set newname for datafile  1 to "/u01/app/oracle/oradata/orcm/system01.dbf";   set newname for datafile  2 to "/u01/app/oracle/oradata/orcm/sysaux01.dbf";   set newname for datafile  3 to "/u01/app/oracle/oradata/orcm/undotbs01.dbf";   set newname for datafile  4 to "/u01/app/oracle/oradata/orcm/users01.dbf";   backup as copy reuse   datafile  1 auxiliary format "/u01/app/oracle/oradata/orcm/system01.dbf"   datafile 2 auxiliary format "/u01/app/oracle/oradata/orcm/sysaux01.dbf"   datafile 3 auxiliary format "/u01/app/oracle/oradata/orcm/undotbs01.dbf"   datafile 4 auxiliary format "/u01/app/oracle/oradata/orcm/users01.dbf"   ;   sql 'alter system archive log current';}executing Memory Scriptexecuting command: SET NEWNAMErenamed tempfile 1 to /u01/app/oracle/oradata/orcm/temp01.dbf in control fileexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEStarting backup at 18-JUN-13using channel ORA_DISK_1channel ORA_DISK_1: starting datafile copyinput datafile file number=00001 name=/u01/app/oracle/oradata/orcl/system01.dbfoutput file name=/u01/app/oracle/oradata/orcm/system01.dbf tag=TAG20130618T051251channel ORA_DISK_1: datafile copy complete, elapsed time: 00:02:02channel ORA_DISK_1: starting datafile copyinput datafile file number=00002 name=/u01/app/oracle/oradata/orcl/sysaux01.dbfoutput file name=/u01/app/oracle/oradata/orcm/sysaux01.dbf tag=TAG20130618T051251channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:37channel ORA_DISK_1: starting datafile copyinput datafile file number=00003 name=/u01/app/oracle/oradata/orcl/undotbs01.dbfoutput file name=/u01/app/oracle/oradata/orcm/undotbs01.dbf tag=TAG20130618T051251channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:36channel ORA_DISK_1: starting datafile copyinput datafile file number=00004 name=/u01/app/oracle/oradata/orcl/users01.dbfoutput file name=/u01/app/oracle/oradata/orcm/users01.dbf tag=TAG20130618T051251channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03Finished backup at 18-JUN-13sql statement: alter system archive log currentcontents of Memory Script:{   switch clone datafile all;}executing Memory Scriptdatafile 1 switched to datafile copyinput datafile copy RECID=2 STAMP=818401498 file name=/u01/app/oracle/oradata/orcm/system01.dbfdatafile 2 switched to datafile copyinput datafile copy RECID=3 STAMP=818401498 file name=/u01/app/oracle/oradata/orcm/sysaux01.dbfdatafile 3 switched to datafile copyinput datafile copy RECID=4 STAMP=818401498 file name=/u01/app/oracle/oradata/orcm/undotbs01.dbfdatafile 4 switched to datafile copyinput datafile copy RECID=5 STAMP=818401498 file name=/u01/app/oracle/oradata/orcm/users01.dbfFinished Duplicate Db at 18-JUN-13

转载地址:http://ahnuo.baihongyu.com/

你可能感兴趣的文章
HTML5新特性教程
查看>>
ImageOptim-无损图片压缩Mac版
查看>>
传统运维团队转型应该注意哪些问题?
查看>>
JavaScript函数(二)
查看>>
Airbnb改进部署管道安全性,规范部署顺序
查看>>
腾讯最大规模裁撤中层干部,让贤年轻人
查看>>
蔡超:入门 Go 语言必须跨越的五个思维误区
查看>>
使用Akka Actor和Java 8构建反应式应用
查看>>
curl常用命令详解
查看>>
saltstack 添加计划任务
查看>>
Puppet module命令参数介绍(六)
查看>>
《UNIX网络编程》中第一个timer_server的例子
查看>>
CISCO 路由器(4)
查看>>
网络服务搭建、配置与管理大全(Linux版)
查看>>
Silverlight 5 Beta新特性[4]文本缩进控制
查看>>
springMVC多数据源使用 跨库跨连接
查看>>
Git服务端和客户端安装笔记
查看>>
【iOS-cocos2d-X 游戏开发之十三】cocos2dx通过Jni调用Android的Java层代码(下)
查看>>
MongoDB的基础使用
查看>>
进程间通信——命名管道
查看>>