?
Solved

TNSNAMES configuration with Data Guard

Posted on 2005-03-17
4
Medium Priority
?
888 Views
Last Modified: 2008-02-01
On Windows 2000, Oracle 10.1

There is one primary Oracle instance and a standby (data guard) secondary instance on a different server.
How can I configure the application's TNSNAMES.ORA file to connect to the correct instance after a failover/switchover?
Their SID can be the same if required.

Thanks
0
Comment
Question by:peledc
  • 2
4 Comments
 
LVL 11

Accepted Solution

by:
sujit_kumar earned 2000 total points
ID: 13572131
You will have to add this,

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
      )
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = TCP)(HOST = myHost)(PORT = 1521))
      )
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = TCP)(HOST = myHost)(PORT = 1512))
      )
    )
    (DESCRIPTION =
      (PROTOCOL_STACK =
        (PRESENTATION = GIOP)
        (SESSION = RAW)
      )
      (ADDRESS = (PROTOCOL = TCP)(HOST = myHost)(PORT = 2481))
    )
  )

STANDBY_LISTENER = (ADDRESS_LIST=
 (ADDRESS=(PROTOCOL=tcp)(PORT=1512)(HOST=myHost))
)


See,
http://www.oracle-base.com/articles/9i/DataGuard.php
http://www.dba-oracle.com/t_oracledataguard_245_network_tuning_.htm
0
 
LVL 2

Expert Comment

by:dsr789
ID: 13573632
Standby 1 listener.ora
==============

NAME_LIST =
(DESCRIPTION_LIST =
    (DESCRIPTION =
         (ADDRESS = (PROTOCOL = TCP)(HOST = <<NAME/IP>>)(PORT = <<Port>>)))))
            SID_LIST_DGPERF_LIST =
              (SID_LIST =
                (SID_DESC =
                   (SDU=32767)
                   (ORACLE_HOME = <<path>>)
                  (SID_NAME = <<SID>>) ) )

Standby 1 tnsnames.ora

NAME =
     (DESCRIPTION =
         (SDU = 32767)
           (ADDRESS_LIST =
               (ADDRESS = (PROTOCOL = tcp)(PORT = <<PORT>>)(HOST = <<NAME/IP>>)))
               (CONNECT_DATA =
                    (SID = <<SID>>) ) )
0
 
LVL 2

Expert Comment

by:dsr789
ID: 13573651
0
 
LVL 48

Expert Comment

by:schwertner
ID: 13573674
     Initialization parameter(STANDBY)
      ==================================  
      *.control_files='/u02/admin/v10g/datafiles/standby.ctl'  
      *.log_archive_config='DG_CONFIG=(v10g_stdg2,v10g_stdg1)'
      *.log_archive_dest_1='LOCATION=/u02/admin/v10g/v10garch/  
                              VALID_FOR=(ALL_LOGFILES,ALL_ROLES)
        *.db_unique_name=v10g_stdg1'
      *.log_archive_dest_2='SERVICE=v10g_stdg2  
                              VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)    
                              DB_UNIQUE_NAME=v10g_stdg2 LGWR ASYNC REOPEN=10'
      
      *.log_archive_dest_state_1='enable'
      *.log_archive_dest_state_2='enable'
      *.db_unique_name='v10g_stdg1'
 
      *.FAL_CLIENT='v10g_stdg1'
      *.FAL_SERVER='v10g_stdg2'
 
      *.standby_archive_dest='/u02/admin/v10g/v10garch'
      *.standby_file_management='auto'
      *.remote_login_passwordfile='EXCLUSIVE'
 
Set up the listeners (Net Services)
 
Primary:
 
LISTENER.ORA
LISTENER =
        (DESCRIPTION_LIST =
          (DESCRIPTION =
            (ADDRESS_LIST =
                    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
                  )
                  (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = TCP)(HOST = 138.1.137.235)(PORT = 1521))
      )
    )
  )
 
SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = /u01/oracle/product/10g)
      (PROGRAM = extproc)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = v10g)
(ORACLE_HOME = /u01/oracle/product/10g)
      (SID_NAME = v10g)
    )
)
 
TNSNAMES.ORA:
 
v10g_stdg1 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 138.1.137.234)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = v10g)
    )
  )
v10g_stdg2 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 138.1.137.235)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = v10g)
    )
 

 

0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
This video shows how to recover a database from a user managed backup

569 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question