Oracle Failover using tnsnames.ora
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: Oracle Failover using tnsnames.ora

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Location
    Dubai, UAE
    Posts
    15

    Oracle Failover using tnsnames.ora

    Hi all,
    I would like to know how can i use tnsnames.ora file to help me in failover senario. My current setup is 2 DB server running oracle
    8.7.4 and two aplication servers running as 2 clients for those databases.

    client1 ---> connect to DB1 (default Database DB1 using tnsname appdb)
    connect to DB2 as a second choice
    appdb =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = DB1)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = DB2)(PORT = 1521))
    )
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = mdb)
    )
    )
    client2 ---> connect to DB2 (default Database DB2 using tnsname appdb)
    connect to DB1 as a second choice

    appdb =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = DB2)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = DB1)(PORT = 1521))
    )
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = mdb)
    )
    )

    =====================================================

    senario#1
    ---------
    stop the listener on DB1 (port 1521)
    result: client1 failover to DB2 ? YES

    senario#2
    ---------
    dont stop listener, but shutdown the database DB1
    result: client1 failover to DB2 ? NO (WHY????)
    senario#3
    ---------
    remove the network cable from DB1 ( DB1 is uneachable)
    result: client1 failover to DB2 ? NO (WHY????)

    senario#4
    ---------
    shutdown the machine DB1 totally
    result: client1 failover to DB2 ? NO (WHY????)

    So where is the problem. and how can I implement failover then??

  2. #2
    Join Date
    May 2002
    Posts
    2,645
    What you have:

    appdb =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = DB1)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = DB2)(PORT = 1521))
    )
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = mdb)
    )
    )

    What you should have:

    appdb =
    (DESCRIPTION_LIST =
    (FAILOVER = true)
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = DB1)(PORT = 1521))
    )
    )
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = mdb)
    )
    )
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = DB2)(PORT = 1521))
    )
    )
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = mdb --or can be some other name--)
    )
    )
    )-- closing parens for description_list

    Although failover = true is the default, it helps to list it so it is immediately clear (to someone else looking at the file) that you are intending to use failover.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width