Home » Server Options » Data Guard » Hostname and IP change in case of Switchover and Failover with Dataguard (Oracle 10gR2,Red Hat Ent Linux )
Hostname and IP change in case of Switchover and Failover with Dataguard [message #495331] Fri, 18 February 2011 03:57 Go to next message
preet_kumar
Messages: 204
Registered: March 2007
Senior Member
We are using a Primary and Physical Standby with DataGuard,Broker Observer and Fast Start Failover .Till now things are working great but still we cannot make everything automated
In case of Switchover or Failover we always have to change the IP's of both Primary and Standby and start the listener.
When the Secondary becomes Primary then all our application which is connecting to Primary loose the connection and can only connect the the new Primary when we have changed the IP and hostname of the new Primary and when we change the IP and hostname same as of the old Primary then the EM stops working.All this causes some downtime.
Is there a solution for this so we can make everything fully automated.
Re: Hostname and IP change in case of Switchover and Failover with Dataguard [message #495340 is a reply to message #495331] Fri, 18 February 2011 05:03 Go to previous messageGo to next message
John Watson
Messages: 8347
Registered: January 2010
Location: Global Village
Senior Member
It is simple enough, and you certainly shouldn't;t be changing hostnames and IP addresses. Give your clients a tnsnames.ora entry such as this:

db=(description=
(address_list=
(load_balance=on)(failover=on)
(address=(protocol=tcp)(host=primary-server)(port=1521))
(address=(protocol=tcp)(host=standby-server)(port=1521))
)
(connect_data=(service_name=db))
)


Then create a service such as this:

dbms_service.create_service('db','db')


and a startup trigger such as this:

create trigger start_service after startup on database
declare
role varchar2(30);
begin
select database_role into role from v$database;
if role = 'PRIMARY' then dbms_service.start_service('db');
end if;
end;
/


The trigger will start the service on whichever machine is currently the primary, and the clients will try both listeners until they find it.





Re: Hostname and IP change in case of Switchover and Failover with Dataguard [message #495341 is a reply to message #495340] Fri, 18 February 2011 05:21 Go to previous messageGo to next message
preet_kumar
Messages: 204
Registered: March 2007
Senior Member
Thanks,
Do i also need to make any changes to the Listener entry for both Primary and Standby ?
Re: Hostname and IP change in case of Switchover and Failover with Dataguard [message #495343 is a reply to message #495341] Fri, 18 February 2011 05:27 Go to previous message
John Watson
Messages: 8347
Registered: January 2010
Location: Global Village
Senior Member
Think it through, and you will be able to work it out.
Previous Topic: UPGRADE ORACLE 9i R2 single instance to 11G R2 RAC
Next Topic: Data Guard in Same Machine
Goto Forum:
  


Current Time: Fri Sep 25 18:25:47 CDT 2020