RE: dataguard connection question

From: Mathias Zarick <Mathias.Zarick_at_trivadis.com>
Date: Tue, 9 Jun 2009 19:13:45 +0200
Message-ID: <370BF313301A024C962B05768686368301B753D9_at_MSXVS04.trivadis.com>



Hi Joan,

yes this is okay.
I prefer setting it without the need of configuring listeners in a tnsnames.ora.
so i would use
alter system set local_listener =
'(ADDRESS=(PROTOCOL=TCP)(HOST=test-xythdb-01)(PORT=11003))'; on the other node
alter system set local_listener =
'(ADDRESS=(PROTOCOL=TCP)(HOST=test-xythdb-02)(PORT=11003))';

u can also use
alter system set local_listener =
'(ADDRESS=(PROTOCOL=TCP)(HOST=)(PORT=11003))'; on both nodes, this is more generic

HTH Mathias

-----Original Message-----
From: Joan Hsieh [mailto:joan.hsieh_at_tufts.edu] Sent: Tuesday, June 09, 2009 5:17 PM
To: Mathias Zarick
Cc: oracle_l
Subject: Re: dataguard connection question

Thank you Mathias,

Our local listener set different on both servers as below, is that right? should I change it the same "LISTENER_XYTHT"?

Thanks so much for your help. we scheduled go live on July. I am toasted.

  On test-02

  LISTENER_XYTHT2 =
    (ADDRESS = (PROTOCOL = TCP)(HOST =
test-xythdb-02.uit.tufts.edu)(PORT = 11003))

  On test-01

  LISTENER_XYTHT1 =
    (ADDRESS = (PROTOCOL = TCP)(HOST =
test-xythdb-01.uit.tufts.edu)(PORT = 11003))

Mathias Zarick wrote:
> Hi Joan,
>
> the trick is like this:
> It should also be described in on of the MAA White Papers.
> Use an after startup on database trigger that starts up a service
after
> opening read write.
> Use this service and both host in jdbc connect url.
> It is important that dynamic service registration is able to connect
to
> local listener,
> so local_listener init.ora Parameter has to be adapted correctly...
>
>
> alter system set local_listener =
> '(ADDRESS=(PROTOCOL=TCP)(HOST=test-xythdb-01)(PORT=11003))';
>
>
> examples:
>
> exec DBMS_SERVICE.CREATE_SERVICE ( -
> service_name => 'XYTHT_RW', -
> network_name => 'XYTHT_RW', -
> failover_method => 'BASIC', -
> failover_type => 'SESSION', -
> failover_retries => 3600, -
> failover_delay => 1);
>
> exec DBMS_SERVICE.CREATE_SERVICE ( -
> service_name => 'XYTHT_RO', -
> network_name => 'XYTHT_RO', -
> failover_method => 'BASIC', -
> failover_type => 'SESSION', -
> failover_retries => 3600, -
> failover_delay => 1);
>
>
> CREATE OR REPLACE TRIGGER service_trigger
> after startup on database
> DECLARE
> db_name VARCHAR(9);
> db_domain VARCHAR(128);
> database_role VARCHAR(30);
> BEGIN
> SELECT value
> INTO db_name
> FROM v$parameter
> WHERE name = 'db_name';
>
> SELECT value
> INTO db_domain
> FROM v$parameter
> WHERE name = 'db_domain';
>
> SELECT database_role
> INTO database_role
> FROM v$database;
>
> IF database_role = 'PRIMARY' THEN
> dbms_service.start_service(rtrim(db_name||'_RW.'||db_domain,'.'));
> ELSE
> dbms_service.start_service(rtrim(db_name||'_RO.'||db_domain,'.'));
> END IF;
> END;
> /
>
> jdbc snippets:
> String url =
> "jdbc:oracle:thin:_at_(DESCRIPTION=(FAILOVER=ON)(LOADBALANCE=OFF)"
> + "(ADDRESS_LIST="
> + "(ADDRESS=(PROTOCOL=TCP)(HOST=test-xythdb-01)(PORT=11003))"
> + "(ADDRESS=(PROTOCOL=TCP)(HOST=test-xythdb-02)(PORT=11003))"
> + ")"
> + "(CONNECT_DATA=(SERVICE_NAME=XYTHT_RW)))";
> ds = new oracle.jdbc.pool.OracleDataSource();
> ds.setURL(url);
> conn = ds.getConnection(user, password);
>
> HTH Mathias
>
>
>
> -----Original Message-----
> From: oracle-l-bounce_at_freelists.org
> [mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Joan Hsieh
> Sent: Tuesday, June 09, 2009 1:35 AM
> To: oracle_l
> Subject: dataguard connection question
>
> Hi List,
>
> I have question regarding dataguard, the primary database is xytht1,
the
> standby is xytht2. the oracle is 11.1.0.7. Our client is using jdbc
thin
> client to connect the primary database. the connection string is
>

>
jdbc:oracle:thin:_at_(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=test-xythdb-
> 01.uit.tufts.edu)(PORT=11003))(CONNECT_DATA=(SERVICE_NAME=XYTHT1)))
> JDBCConnectionPool:395
>
> After I tested switchover, the client lost connection, and have to
> manually reconfigure to change the HOST and service name. This is not
> acceptable to our client. I have no knowledge on how to automatically
> switchover/failover for the client jdbc connection. Do you have any
> ideas on this? Thank you for any helps.
>
> Joan
>
> --
> http://www.freelists.org/webpage/oracle-l
>
>
>

--
http://www.freelists.org/webpage/oracle-l
Received on Tue Jun 09 2009 - 12:13:45 CDT

Original text of this message