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??