?
Solved

TNSNAMES configuration with Data Guard

Posted on 2005-03-17
4
Medium Priority
?
880 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
Suggested Courses

765 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