dg in rac service的配置

dg 和 rac
srvctl add database
-r {PRIMARY | PHYSICAL_STANDBY |
 LOGICAL_STANDBY |
 SNAPSHOT_STANDBY}
--------The role of the database in an Oracle Data Guard configuration. 


The default is PRIMARY.


srvctl add service 
-l {[PRIMARY] |
[PHYSICAL_STANDBY] |
[LOGICAL_STANDBY] |
[SNAPSHOT_STANDBY]}
---------The service role.


Use this option to indicate that the service should only be 


automatically started upon database open when the Oracle Data Guard 


database role matches one of the specified service roles.


Using SRVCTL to manually start a service is not affected by the service 


role.


Note: The -l parameter is only used at database startup and by the 


Oracle Data Guard Broker. All manual service startup must specify the 


name of the service to be started by the user.



Database services can be configured to be active in specific database roles on Oracle RAC databases and on single-instance databases managed by Oracle Restart. The broker interacts with Oracle Clusterware or Oracle Restart to ensure that the appropriate database services are active and that the appropriate FAN events are published after a role change.

FAN events are always published through ONS. However, the event notifying a failover is only published for database services that have been configured to be active while the database is in the primary role on the new primary database. Services can also be configured so that FAN events are published through AQ. You must explicitly enable FAN event publication through AQ if you have either OCI or ODP.NET clients because that is the FAN event notification mechanism that those clients use.

Services that must be active in any given database role (primary, physical standby, logical standby, or snapshot standby) must be configured with the SRVCTL utility explicitly on each database where the service must be active. In the following example commands, a service named PAYROLL is configured to be active in the PRIMARY role (-l option) on the primary database NORTH. The service is then configured to be active in the PRIMARY role on the standby database SOUTH, so that it will be active on that database after a role transition. FAN event notification through AQ is also enabled.

Execute the following on primary database NORTH:

srvctl add service –d NORTH –s PAYROLL –l PRIMARY -q TRUE -e SELECT -m BASIC -w 10 -z 150

Execute the following on standby database SOUTH:

srvctl add service –d SOUTH –s PAYROLL –l PRIMARY -q TRUE -e SELECT -m BASIC -w 10 -z 150

Services that are to be active while the database is in the physical standby role must also be created and started on the current primary database regardless of whether the service will be started on that database or not. This is to ensure that the service definition gets propagated to the physical standby database via the redo stream and thus allows for the service to be started on the physical standby database. The service can be started on the physical standby only after the redo generated by starting the service has been applied. It is important that the following SRVCTL add service options are specified and have the same values on all the databases:

Option Description
-B Goal for load balancing advisory
-x Indicates whether distributed transaction processing should be enabled
-q Indicates whether AQ HA notifications should be enabled
-m Failover method
-e Failover type
-z Failover retries
-w Failover delay
-j Goal for connection load balancing
-t Edition name

If all the databases do not have the same values, SRVCTL attempts to override the values, which will fail on the physical standby database because it is open read-only. In the following example, a service named sales is configured to be active in the PHYSICAL_STANDBY role (-l option) on the primary database NORTH. It is then started and stopped on the primary database. It could optionally also be removed from the primary database if there is no intention to ever run this service on the current primary database. It is then configured to be active in the PHYSICAL_STANDBY role on the physical standby database SOUTH.

Execute the following on primary database NORTH:

srvctl add service -d NORTH -s sales -l PHYSICAL_STANDBY -q TRUE -e SELECT -m BASIC -w 10 -z 150
srvctl start service –d NORTH –s sales
srvctl stop service –d NORTH –s sales

Execute the following on the physical standby database SOUTH:

srvctl add service -d SOUTH -s sales -l PHYSICAL_STANDBY -q TRUE -e SELECT -m BASIC -w 10 -z 150

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/20747382/viewspace-2130749/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/20747382/viewspace-2130749/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值