10g Data Guard Observer [message #166973] |
Mon, 10 April 2006 11:06  |
Zakkhalid
Messages: 47 Registered: April 2005
|
Member |
|
|
Hi All,
I'm wanting to setup my servers to use 10g data guard Observer. However not sure how to setup the tnsnames.ora for the auto failover...
any doc's, examples would be greatly appreicated
Thanking you all inadvance
|
|
|
Re: 10g Data Guard Observer [message #168018 is a reply to message #166973] |
Tue, 18 April 2006 07:57   |
tchaudhr
Messages: 2 Registered: April 2006 Location: Allentown, PA
|
Junior Member |
|
|
Following is an example of tnsnames.ora file
DGT1_TAF =
(DESCRIPTION=
(FAILOVER=ON)
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=tcp)(PORT=1521)(HOST=rp5450-d))
(ADDRESS=(PROTOCOL=tcp)(PORT=1521)(HOST=l2000-u))
)
(CONNECT_DATA= (SERVICE_NAME=TEST_DG.papl.com)
(FAILOVER_MODE=(TYPE=SELECT)(METHOD=BASIC))
)
)
|
|
|
Re: 10g Data Guard Observer [message #168024 is a reply to message #166973] |
Tue, 18 April 2006 08:05   |
tchaudhr
Messages: 2 Registered: April 2006 Location: Allentown, PA
|
Junior Member |
|
|
Following are some tips - which might help you...
Regards,
Tahir
610-774-4856
First, let's list some of the client side requirements that must be met in order to receive HA events. You might have to consult with your application vendor about some of this.
a. Initialize the environment with the OCI_EVENTS parameter to enable OCI clients to receive FAN notifications. For example:
OCIEnvCreate(...OCI_EVENTS...)
See the follow doc for more info:
http://download-west.oracle.com/docs/cd/B19306_01/appdev.102/b14250/toc.htm
b. Link the OCI client applications with the thread library (libthread or libpthread).
Once the client has met those requirements proceed with the following configuration steps:
1. Using the dbms_service package create a primary database specific service name that the OCI client will use in it's connection. Do not include this service name in the init.ora service_names parameter as it will be completely managed using dbms_service. In addition to creating the service we need to configure server side TAF and enable the service for HA notification. For example, on the primary database perform the
following:
exec DBMS_SERVICE.CREATE_SERVICE(
service_name => 'sales',
network_name => 'sales',
aq_ha_notifications => true,
failover_method => 'BASIC',
failover_type => 'SELECT',
failover_retries => 180,
failover_delay => 1);
Once created start the service using DBMS_SERVICE.START_SERVICE.
exec DBMS_SERVICE.START_SERVICE('sales');
You can reference dbms_service along with examples at the following URL:
http://download-west.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_serv.htm#sthref6953
2. On the client, configure an Oracle Net alias that has a single host in the address_list that points to the primaryhost. In addition, include the backup attribute that points to an Oracle Net alias that has a single address in the address_list that points to the standby host.
For example:
3. Create a trigger around the db_role_change system event that checks the role of the database and either starts or stops that service depending on the role. For example perform the following on the primary
database:
CREATE OR REPLACE TRIGGER set_rc_svc AFTER DB_ROLE_CHANGE ON DATABASE DECLARE
role VARCHAR(30);
BEGIN
SELECT DATABASE_ROLE INTO role FROM V$DATABASE;
IF role = 'PRIMARY' THEN
DBMS_SERVICE.START_SERVICE('sales');
ELSE
DBMS_SERVICE.STOP_SERVICE('sales');
END IF;
END;
4. Archive the current log once the above database changes have been made to get the redo changes recovered on the physical standby.
ALTER SYSTEM ARCHIVE LOG CURRENT;
|
|
|
|