ORACLE Physical Standby 级联备库搭建

Posted elontian

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ORACLE Physical Standby 级联备库搭建相关的知识,希望对你有一定的参考价值。

搭建oracle 级联DG

现在db与dg1是一套DG ,在此基础上搭建级联备库:

数据库版本 11.2.0.4 db_name=prod db为主库,dg1为备库,dg2为级联备库;
DB_UNIQUE_NAME DATABASE_ROLE
db primary 10.100.12.10
dg1 standby1 10.100.12.11
dg2 standby2 10.100.12.12

三个库的LOG_FILE_NAME_CONVERT,DB_FILE_NAME_CONVERT路径一致
############################ 主库db参数文件设置 #########################################

主库db的参数文件如下:
db_name=prod
instance_name=db
db_unique_name=db
*.FAL_CLIENT=‘db‘
*.FAL_SERVER=‘dg1‘
*.LOG_ARCHIVE_CONFIG=‘DG_CONFIG=(db,dg1,dg2)‘;
*.LOG_ARCHIVE_DEST_1=‘LOCATION=/arch VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=db‘
*.LOG_ARCHIVE_DEST_2=‘SERVICE=dg1 SYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=dg1‘
*.LOG_ARCHIVE_DEST_STATE_1=‘ENABLE‘
*.LOG_ARCHIVE_DEST_STATE_2=‘ENABLE‘
*.STANDBY_FILE_MANAGEMENT=‘AUTO‘
*.DB_FILE_NAME_CONVERT=‘db‘,‘dg1‘
*.LOG_FILE_NAME_CONVERT=‘db‘,‘dg1‘


############################### 备库dg1 ####################################################
备库dg1的参数文件如下
db_name=prod
instance_name=dg1
db_unique_name=dg1
*.FAL_CLIENT=‘dg1‘
*.FAL_SERVER=‘db‘
*.LOG_ARCHIVE_CONFIG=‘DG_CONFIG=(db,dg1,dg2)‘;
*.LOG_ARCHIVE_DEST_1=‘LOCATION=/arch VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=dg1‘
*.LOG_ARCHIVE_DEST_2=‘SERVICE=dg2 SYNC VALID_FOR=(STANDBY_LOGFILES,STANDBY_ROLE) DB_UNIQUE_NAME=dg2‘
*.LOG_ARCHIVE_DEST_STATE_1=‘ENABLE‘
*.LOG_ARCHIVE_DEST_STATE_2=‘ENABLE‘
*.STANDBY_FILE_MANAGEMENT=‘AUTO‘
*.DB_FILE_NAME_CONVERT=‘db‘,‘dg1‘
*.LOG_FILE_NAME_CONVERT=‘db‘,‘dg1‘

################################ 备库dg2 参数 ################################################
在主库上做备份,传至备库dg2,源数据库为主库
复制主库db的参数文件至dg2,并做修改,restore standby controlfile并启动备库dg2至mount状态

主库dg2上运行:
rman target sys/[email protected] auxiliary sys/[email protected]
duplicate target database for standby nofilenamecheck from active database;

备库dg2的参数文件如下
db_name=prod
instance_name=dg2
db_unique_name=dg2
*.FAL_CLIENT=‘dg2‘
*.FAL_SERVER=‘dg1‘
*.LOG_ARCHIVE_CONFIG=‘DG_CONFIG=(db,dg1,dg2)‘;
*.LOG_ARCHIVE_DEST_1=‘LOCATION=/arch VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=dg1‘
*.LOG_ARCHIVE_DEST_STATE_1=‘ENABLE‘

*.DB_FILE_NAME_CONVERT=‘dg1‘,‘dg2‘
*.LOG_FILE_NAME_CONVERT=‘dg1‘,‘dg2‘

 

Cascaded Redo Transport Destinations
A cascaded redo transport destination (also known as a terminal destination) receives primary database redo indirectly from a standby database rather than directly from a primary database.
A physical standby database that cascades primary database redo to one or more terminal destinations at the same time it is applying changes to its local database files is known as a cascading standby database.
With cascading, the overhead associated with performing redo transport is offloaded from a primary database to a cascading standby database.
A cascading standby database can cascade primary database redo to up to 30 terminal destinations.

db到dg1是归档日志与在线日志同步,dg1到dg2只能通过归档日志同步,所以必须在dg切换日志,dg2才会接受到日志并同步数据



















































以上是关于ORACLE Physical Standby 级联备库搭建的主要内容,如果未能解决你的问题,请参考以下文章

[Oracle][DATAGUARD] 关于确认PHYSICAL STANDBY的同期状况的方法

Data Guard Physical Standby Setup in Oracle11.2 & 后加 Data Guard Broker 之03 (Maximum Availability

Data Guard Physical Standby Setup Using the Data Guard Broker in Oracle 11.2 之01(安装配置)

Data Guard Physical Standby Setup Using the Data Guard Broker in Oracle 11.2 之01(安装配置)

read write方式打开PHYSICAL STANDBY,闪回和还原测试

DGMGR-TO PHYSICAL STANDBY Failed (ORA12514 )解决方法