Re: Data Guard

  • From: Mladen Gogala <gogala@xxxxxxxxxxxxx>
  • To: willyschriemer@xxxxxxxxx
  • Date: Fri, 07 Apr 2006 08:44:48 -0400

On 04/07/2006 08:16:22 AM, willy wrote:
> Hi Database Gurus,
> 
> I've a question regarding Data Guard. If a database switches role from
> standby to primary can I still connect to the new primary database without
> setting a network alias or adjusting the tnsnames.ora with the new IP adress
> ? I guess it has something to do with the tnsnames.ora but I can't figure
> out how to do this.
> 
> TIA,
> 
> Willy Schriemer
> 

Willy, there are several tricks you can do:
1) Do it on the DNS name server and when the roles are switched, change the 
machine alias. That is
   the simplest way that requires a little cooperation from SA people.
2) Replace the tnsnames.ora files. That requires either replacing it in the 
central location
   or re-distributing the new version.
3) You can do it in tnsnames.ora like this:
  (FAILOVER=on) 
  (ADDRESS=
       (PROTOCOL=tcp)  
       (HOST=server1)  
       (PORT=1521)) 
  (ADDRESS=
       (PROTOCOL=tcp)  
       (HOST=server2)  
       (PORT=1521)) 
  (CONNECT_DATA=
     (SERVICE_NAME=screwup) 


Oracle*Net will first try connection to server1 and, if it isn't available, 
will 
try server2. Trick with DG is that both services (listeners) will respond, but 
one
database will be in the recovery mode, unavailable for SQL processing. I 
haven't tried
that. You can also add "LOAD_BALANCE=ON" and that will make Oracle*Net select 
address at
random. Without that, it will try first address, then the 2nd one and so forth. 
You can
also have two database with the same service name and then do this:

SCREWUP_BIG = 
DESCRIPTION =
  ((ADDRESS=
       (PROTOCOL=tcp)  
       (HOST=server1)  
       (PORT=1521)) 
  (CONNECT_DATA=
     (SERVICE_NAME=screwup) 
     (INSTANCE_ROLE=primary)
     (FAILOVER_MODE=
       (BACKUP=screwup_small) 
       (TYPE=select) ))
)

SCREWUP_SMALL = 
DESCRIPTION =
  ((ADDRESS=
       (PROTOCOL=tcp)  
       (HOST=server2)  
       (PORT=1521)) 
  (CONNECT_DATA=
     (SERVICE_NAME=screwup) 
     (INSTANCE_ROLE=secondary))
)



That will make user connect to the secondary site, in case that the primary 
isn't available.
Service names are my own. You would be well advised to change them.
-- 
Mladen Gogala
http://www.mgogala.com

--
//www.freelists.org/webpage/oracle-l


Other related posts: