Yann Neuhaus Blog

All around Open Source and High Availability

Are Virtual IPs required for Data Guard?

Until 10.2.0.3, the Data Guard (and broker) technology suffered from several weaknesses. One of the "highlights" was that no Virtual IP management was provided by Oracle. This has quite important consequences for the clients as soon as the primary server is down (no IP responding to the TCP requests e.g. of a connection build up). In this case, the failover from the first to the second address (in the address list of the TNS entry used by the client) could take a long time, depending on network/TCP timeouts. The RAC/Clusterware architecture solved this issue by introducing the Virtual IPs (VIP) which where always available (maybe moved to a surviving node).

 

Of course several solutions are available to overcome that problem, for instance managing your own VIP with self-made scripts (and all the subsequent risks, you try to fake a failover cluster!), combine Data Guard with  Failover Cluster technology (e.g. Heartbeat under Linux, Veritas Cluster Services), and so on ...

 

All that solutions have as almost as many  drawbacks as advantages, the most important are:

 

- How can we garantee that the VIP is always started on the Primary database side?

- How is it possible to prevent two Virtual IP running in parallel in the cluster?

 

However, one of the mentioned solutions is almost "mandatory" for Oracle clients before 10.2.0.3.

 

Starting with 10.2.0.3 on client and server side, Oracle proposes the OUTBOUNT_CONNECT_TIMEOUT parameter (not very well documented though). This option must be set in the sqlnet.ora file and defines the maximum number of seconds to be waited before trying to access the second, third etc. address in the ADDRESS_LIST, independent of TCP/IP timeouts. Examples:

 

In sqlnet.ora:

OUTBOUND_CONNECT_TIMEOUT=5

 

In tnsnames.ora on the client side or in the LDAP server:

PCMDB =

  (DESCRIPTION =

   (ADDRESS_LIST=

    (ADDRESS = (PROTOCOL = TCP)(HOST = server1 )(PORT = 1521))

    (ADDRESS = (PROTOCOL = TCP)(HOST = server2 )(PORT = 1521))

   )

    (CONNECT_DATA =

      (SERVICE_NAME = PCMDB_RW )

    )

  )

 

PCMDB_RW is a service created beforehand and activated through a "startup database" trigger (see end of the post). This makes sure, that the client can only connect to the primary side. If after 5 seconds (in our case), server1 is still unreachable, the client will try to connect to server2 (ignoring existing TCP/IP parameters).

 

Unfortunately, during our tests we observed that this parameter requires the remote_listener parameter to be set on the server side, at least for Linux/Sun(/... ?) clients. This for the non-error situation that a client first tries the standby database (and therefore should failover to the primary). For windows clients, patch 6038241 (10.2.0.3.7P) can be installed (only available for 32 Bit), see metalink note 342443.1. With this patch, the remote_listener parameter does not have to be.

 

So the Windows clients have a valid/stable solution using the patch.

 

The Linux clients however suffer from the side effects of the remote_listener parameter: The remote_listener parameter is used to register to other (remote) listeners in order to inform them about the current instance load. This means that in case of crash of the primary server and activation of the standby database, the service PCMDB_RW is known by the listener of the standby side as being offered by the new primary (ok) and the old primary (not ok)!

 

This situation may result in "ORA-12560: TNS:protocol adapter error" errors.

 

The solution is quite simple: the listener should be "reloaded" on the new primary side (old standby) when the standby database becomes the primary. This could be easily automated with a script and a DB_CHANGE_ROLE trigger. See the code below :

 

Script to reload the listener:

#!/bin/ksh

# Set the ORACLE environment variables (ORACLE_HOME, PATH, aso ...)

lsnrctl reload LISTENER_PCMDB

 

Below the trigger to reload the listener:

CREATE OR REPLACE TRIGGER RELOAD_LISTENER AFTER DB_ROLE_CHANGE ON DATABASE

BEGIN

dbms_scheduler.create_job(job_name=>'reload_lsn',

job_type=>'executable',job_action=>

'/u00/app/oracle/local/custom/bin/reload_lsn_PCMDB.ksh',

enabled=>TRUE);

END;

/

 

With this solution, both Linux and Windows clients do not require any VIP or Failover Cluster anymore to fully benefit from a Data Guard architecture. The only 'restriction' is to use 10.2.0.3 Oracle client releases. Even 10.2.0.2 does not work properly. Of course, wait for 10.2.0.4 and hope that the "problem" is fixed could be another solution :-)

 

Appendix : startup trigger for "_RW" service :

create or replace trigger service_trigger after

startup on database

declare

db_name       varchar(512);

db_domain     varchar(512);

database_role varchar(16);

service_names varchar(512);

instance_name varchar2(16);

begin

  select value into service_names from v$parameter where name = 'service_names';

  select value into instance_name from v$parameter where name = 'instance_name';

  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

    service_names := rtrim(service_names || ', ' || db_name || '_RW.' || db_domain, '.');

  else

  service_names := rtrim(service_names || ', ' || db_name || '_RO.' || db_domain, '.');

  end if;

  execute immediate 'alter system set service_names = ''' || service_names || ''' scope=memory sid=''' || instance_name || '''';

end;

/

 

Kommentare

dulox sagte:

[url=einstein.phys.uwm.edu/view_profile.php]

cymbalta chemical structure

[/url]

# Oktober 24, 2008 3:19

rtydgvtzc sagte:

psL0rX  <a href="kvcggbdpvbog.com/.../a>, [url=http://yhgnlggqlajf.com/]yhgnlggqlajf[/url], [link=http://tqbvyiuxdnsg.com/]tqbvyiuxdnsg[/link], http://xdhdnaugwzqe.com/

# Oktober 25, 2008 4:46

tadacia sagte:

[url=tadalafil-cialis.wikispaces.com]ceebis tadalafil

[/url]

# Oktober 25, 2008 4:22

Pharm40 sagte:

Very nice site!

[url=training.cvc4.org/.../2.html]cheap cialis[/url]

# Oktober 25, 2008 11:47

Pharm33 sagte:

Very nice site!

[LINK training.cvc4.org/.../3.html]cheap tramadol[/LINK]

# Oktober 25, 2008 11:47

Pharm19 sagte:

# Oktober 25, 2008 11:47

Pharm33 sagte:

Very nice site!

# Oktober 25, 2008 11:47

Pharm26 sagte:

Very nice site!

[url=training.cvc4.org/.../2.html]cheap cialis[/url]

# Oktober 25, 2008 11:48

Pharm79 sagte:

# Oktober 25, 2008 11:48

wregabbeque sagte:

Hmmm... Do you want to improve my   sleepy  spokesman  I have a good fresh joke for you!   What did the painter say to the wall? One more crack and I'll plaster you!

# Oktober 26, 2008 9:57

Tausabsopay sagte:

http://gooljhnghwppilkoo.com gooljhnghwppilkoo

<a href="http://gooljhnghwppilkoo.com ">gooljhnghwppilkoo</a>

[url=http://gooljhnghwppilkoo.com]gooljhnghwppilkoo[/url]

# November 2, 2008 3:43

acislizclorse sagte:

http://yahggweppuiloo.com yahggweppuiloo

<a href="http://yahggweppuiloo.com ">yahggweppuiloo</a>

[url=http://yahggweppuiloo.com]yahggweppuiloo[/url]

# November 3, 2008 5:08

ligdogoppomia sagte:

http://jajajkhptlikilop.com jajajkhptlikilop

<a href="http://jajajkhptlikilop.com ">jajajkhptlikilop</a>

[url=http://jajajkhptlikilop.com]jajajkhptlikilop[/url]

# November 4, 2008 7:24

Pharm22 sagte:

Very nice site!

[url=training.cvc4.org/.../2.html]cheap cialis[/url]

# November 6, 2008 1:26

Pharm25 sagte:

Very nice site!

[LINK training.cvc4.org/.../3.html]cheap tramadol[/LINK]

# November 6, 2008 1:26

Pharm80 sagte:

Very nice site!

# November 6, 2008 1:27

dvlonjwbkw sagte:

Ts43SP  <a href="aimknwxkmikn.com/.../a>, [url=http://lleqipprrqmq.com/]lleqipprrqmq[/url], [link=http://mqiximpdemrw.com/]mqiximpdemrw[/link], http://hqqikbomefew.com/

# November 7, 2008 11:11

trorencarse sagte:

http://gagakolokolr.org gagakolokolr

<a href="http://gagakolokolr.org ">gagakolokolr</a>

[url=http://gagakolokolr.org]gagakolokolr[/url]

# November 7, 2008 10:04

KurmanAhlabm sagte:

Hi there!

My first post at this great blog!

I wanna show u my dayly updated blog:  <a href= http://www.megautbe.cn >Black Amateur *** Video</a>

Have a nice day!

BB!

P.S. if you don't want to see this message please write me to no.ads08@gmail.com with subject "NO ADS" and URL of your forum

Thank you for cooperation!

# November 8, 2008 4:49

hgixhDusNxT sagte:

blog.micromarketing.ru

blog.studiomade.ru

blog.parasite-eliminator.ru

roma.net.ua

blog.cooluck.kiev.ua

ruslankarpuk.ru

the-ebook.org

satway.ru

blog.yotraining.ru

homesports.ru

movable-type.ru

problog.ru

saahov.ru

fotov.net

pro-gadget.info

lecactus.ru

blogbuster.ru

lugovsa.net

blog.yerzintimur.com

s-live.org

bax.com.ua

inetstory.ru

absolvo.ru

dtpcraft.info

zhinzher.ru

moimuj.com

blog.moimuj.com

sergisnew.ru

blog.blohin.com

piom.ru

intsec.ru

aesma.ru

# November 12, 2008 8:06

finaster sagte:

[url=http://proscar.wikispaces.com/]of finasteride

[/url]

# November 13, 2008 1:20

izwnpdyuuo sagte:

MIdJk1  <a href="ynnhoaesslpt.com/.../a>, [url=http://fyjvurwbvgqc.com/]fyjvurwbvgqc[/url], [link=http://hlnzmbcztxej.com/]hlnzmbcztxej[/link], http://qshffbampjzj.com/

# November 15, 2008 4:26

vowhav sagte:

tveYuP  <a href="ylbpqalpcgly.com/.../a>, [url=http://zbwqlxjxceie.com/]zbwqlxjxceie[/url], [link=http://uuqqwsootisb.com/]uuqqwsootisb[/link], http://xvahztbnahtq.com/

# November 16, 2008 10:45

Meedstreppype sagte:

http://fapolkoilkl.com fapolkoilkl

<a href="http://fapolkoilkl.com ">fapolkoilkl</a>

[url=http://fapolkoilkl.com]fapolkoilkl[/url]

# November 16, 2008 12:28

finasteride sagte:

[url=http://finasteride.weebly.com/]dutasteride proscar

[/url]

# November 16, 2008 7:05

Immistgrisp sagte:

to: Admin - If You want to delete your site from my spam list, please sent url of your domain to my e-mail: stop.spam.today@gmail.com

And I will remove your site from my base within 24 hours

webmastegz

# November 16, 2008 9:10

qucbpq sagte:

V6FL0D  <a href="auvzgaklsufh.com/.../a>, [url=http://etlsbwstmghc.com/]etlsbwstmghc[/url], [link=http://zpotgfomkfeg.com/]zpotgfomkfeg[/link], http://fnjtnlrssosw.com/

# November 17, 2008 9:22

KefAmagma sagte:

to: Admin - If You want to delete your site from my spam list, please sent url of your domain to my emai: stop.web.spam@gmail.com

And I will remove your site from my base within 24 hours

webmastegz

PS. As the previous address of an e-mail has been removed also all letters on it have been lost I is compelled to make this dispatch once again.

PS2. To send url your site on an e-mail stop.web.spam@gmail.com is a unique way to avoid a spam from me. To write abuses to the various "stop spam" sites - it is useless.

PS3. Your addresses of an e-mail are not necessary to me, you can create an e-mail through free service and send me yours url through this e-mail

PS4. sorry for my bad English :)

# November 17, 2008 9:18

Coaccarge sagte:

to: Admin - If You want to delete your site from my spam list, please visit this site for instructions: stopspam.idoo.com

# November 21, 2008 6:02

FZRichard sagte:

Good afternoon

<a href= ciallis-us.info/.../index.html >cillis</a> It was pretty amazing, my erections had like a trigger reflex...it took nothing to get hard. And it was like that for the next two days, and part of the third.

Goodluck!!!

# November 21, 2008 3:35
Kommentar abgeben

(verpflichtend) 

(verpflichtend) 

(optional)

(verpflichtend)