Focus On Oracle

Installing, Backup & Recovery, Performance Tuning,
Troubleshooting, Upgrading, Patching

Oracle Engineered System


当前位置: 首页 » 技术文章 » Oracle 12c+

12c DG Broker RedoRoutes

RedoRoutes是12c Dataguard Broker中新增加的参数。默认情况下,一个主库会把他产生的redo传送到配置中的任何一个redo目标位置。有了这个新参数,我们可以根据实际情况设置比较复杂的传输路线。比如我们可以设置physical standby或far_sync实例将从主数据库接收的重做转发到一个或多个目的地。

RedoRoutes可以包含一个或多个Redo Routing Rule。Redo Routing Rule的格式如下,中间用冒号隔开
(redo source : redo destination)
redo source
必须包含任意一个个关键字,这个词可以为LOCAL,ANY或用多个逗号隔开的DB_UNIQUE_NAME名字
{LOCAL | ANY | db_unique_name_1,[,db_unique_name_n]}

LOCAL关键字是本地数据库的别名。这个关键字不能用于far_sync实例
ANY关键字是db broker配置中的任何一个数据库的别名

redo destination
必须包含关键字ALL或多个用逗号隔开的DB_UNIQUE_NAME名字
{ALL [attribute] | db_unique_name_1 [attribute] [,db_unique_name_n [attribute]]}

其中attribute可以使用下面的选项
[ASYNC | SYNC | FASTSYNC]
如果redo传输的属性没有设置,redo传输模式将会使用LogXptMode指定的值

通过RedoRoutes我们还可以设置一个远端备用的位置。Oracle建议将ALT的参数设置为fallback,意思为如果非备用可用的时候,继续使用非备用的。
[ALT=(alternate db_unique_name [ASYNC | SYNC | FASTSYNC] [FALLBACK])]

edit database prod set property redoroutes='(local:prodfs sync alt=(stdby async fallback))';


RedoRoutes的用法注意事项:

1.The RedoRoutes property has a default value of NULL, which is treated as (LOCAL : ALL) at a primary database.

2.A redo routing rule is active if its redo source field specifies the current primary database. If a rule is active, primary database redo is sent by the database at which the rule is defined to each destination specified in the redo destination field of that rule.

3.The ASYNC redo transport attribute must be explicitly specified for a cascaded destination to enable real-time cascading to that destination.

4.The RedoRoutes property cannot be set on a logical or snapshot standby database.

5.The RedoRoutes property can be set for a logical standby database only if the redo destination field is set to LOCAL.

6.The non-alternate member must have a non-zero value for its MaxFailure configurable property in order for an alternate to be specified.


下面给出了3个配置的例子
A.下面的redoroutes配置的意思为,在生产数据中心有一个主库和一个far_sync实例,在灾备数据中心有一个备库和一个far_sync实例。当生产数据中心的数据库为主库时,使用距离生产数据中心较近的far_sync实例。当灾备数据中心的数据库为主库时,使用距离灾备中心较近的far_sync实例
DGMGRL> create configuration dg_ohs as primary database is prod connect identifier is prod;
DGMGRL> add database stdby as connect identifier is stdby;
DGMGRL> add far_sync prodfs as connect identifier is prodfs;
DGMGRL> add far_sync stdbyfs as connect identifier is stdbyfs;
DGMGRL> edit database prod set property redoroutes='(LOCAL : prodfs SYNC)';
DGMGRL> edit database stdby set property redoroutes='(LOCAL : stdbyfs SYNC)';
DGMGRL> edit far_sync prodfs set property redoroutes='(prod : stdby)';
DGMGRL> edit far_sync stdbyfs set property redoroutes='(stdby : prod)';
DGMGRL> edit configuration set protection mode as maxavailability;
DGMGRL> enable configuration;

B.下面的redoroutes配置的意思为,有3个库,包括生产库prod,灾备库stdby,一个距离生产和灾备同等距离切满足SYNC传输的中间灾备库。
当中间库transfer为主时,通过SYNC把redo传到prod和stdby。
当prod,stdby任何一个为主时,中间库transfer将redo通过ASYNC方式传到到其他剩余的备库
DGMGRL> create configuration dg_ohs as primary database is prod connect identifier is prod;
DGMGRL> add database stdby as connect identifier is stdby;
DGMGRL> add database transfer as connect identifier is transfer;
DGMGRL> edit database prod set property redoroutes='(LOCAL : transfer SYNC)';
DGMGRL> edit database transfer set property redoroutes='(LOCAL : prod SYNC, stdby SYNC)(prod : stdby ASYNC)(stdby : prod ASYNC)';
DGMGRL> edit database stdby set property redoroutes='(LOCAL : transfer SYNC)';
DGMGRL> edit configuration set protection mode as maxavailability;
DGMGRL> enable configuration;

C.下面的redoroutes配置的意思为,有四个库,分别部署在生产数据中心和灾备数据中心,每个数据中心有2个数据库。
当生产数据中心为主库时,生产数据中心的数据通过sync传输到生产数据中心的另一个备库,然后通过ASYNC方式,把redo传输到灾备数据中心的备库。
当灾备数据中心为主库时,灾备数据中心的数据通过sync传输到灾备数据中心的另一个备库,然后通过ASYNC方式,把redo传输到生产数据中心的备库。
DGMGRL> create configuration dg_ohs as primary database is prod1 connect identifier is prod1;
DGMGRL> add database prod2 as connect identifier is prod2;
DGMGRL> add database prod3 as connect identifier is prod3;
DGMGRL> add database prod4 as connect identifier is prod4;
DGMGRL> edit database prod1 set property redoroutes='(LOCAL : prod2 SYNC)(prod2 : prod3 ASYNC, prod4 ASYNC)';
DGMGRL> edit database prod2 set property redoroutes='(LOCAL : prod1 SYNC)(prod1 : prod3 ASYNC, prod4 ASYNC)';
DGMGRL> edit database prod3 set property redoroutes='(LOCAL : prod4 SYNC)(prod4 : prod1 ASYNC, prod2 ASYNC)';
DGMGRL> edit database prod4 set property redoroutes='(LOCAL : prod3 SYNC)(prod3 : prod1 ASYNC, prod2 ASYNC)';
DGMGRL> edit configuration set protection mode as maxavailability;
DGMGRL> enable configuration; 


Reference
http://docs.oracle.com/database/121/DGBKR/dbpropref.htm#DGBKR3657

http://docs.oracle.com/database/122/DGBKR/oracle-data-guard-broker-properties.htm#DGBKR3657



关键词:dgbroker far_sync dg 

相关文章

Oracle 19c新特性之Automatic Flashback
PDB Migration/Failover in Dataguard
Oracle Exadata ADG & GDS
Convert Snapshot Standby to Physical Standby
How to Convert Physical Standby to Snapshot Standby
How to create single physical standby for RAC
12c 如何通过DG Broker配置far_sync
12c DG Broker RedoRoutes
Upgrade 11gR2 RAC Grid Infrastructure to 12.1.0.2
如何配置11g DG Broker
Top