connect to the DB using descriptor
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: connect to the DB using descriptor

  1. #1
    Join Date
    Mar 2006
    Posts
    176

    connect to the DB using descriptor

    Hi all,

    Below is what I used to connect to the DB

    SQL>connect system/blah@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=server1)(PORT=1521))(ADDRESS=(PROTOCOL= TCP)(HOST=server2)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=test.world)))
    SQL> connected

    standby running on server1 and primary running on server2, service_name ONLY running on Primary instance. when I query to find out what server it connected, found out it connected to server1.


    1) it looked like it connected to whatever the first entry on the descriptor. b/c I tried to switch the server2 to go first it will connect to server2
    2) why it connected to standby instance? Standby instance doesn't have the service running so it shouldn't connect to standby. It should only connect to the instance which has the service running. I don't understand.......

    thx

  2. #2
    Join Date
    Nov 2000
    Location
    Pittsburgh, PA
    Posts
    4,001
    IMHO, the connection will always go to the first database in your tns string because you did not tell it to do any differently.
    You can include other directive such as round robin and failover. But your Oracle client is not going to know which database
    is active at any time, if the listener is running it will accept a connection and try to hand it off to the database, whether or
    not the database is started, mounted or open.

    http://docs.oracle.com/cd/B28359_01/...s.htm#NETRF262

    You should use two different listeners for this, one set of listeners would be for the primary and secondary to exchange
    archive logs, the other listener would be active on one of the two nodes. You can either use a cname or network alias
    that will point to one of the two servers. You would want to adjust the time to live to make sure that the client looks
    up the IP address often enough so that it realizes when you failed over.

    You can also use a virtual NIC that you can bring up on one server and not the other. So when you want to fail over
    you stop the virtual NIC on one server and start it one the other. Then any new connections are going to the new
    primary database, not the old primary database.

    Managing the standby database is only one part of having a standby database, you also need to redirect your application
    to the standby when you activate the standby. You may also want to use OpenLDAP to manage your database aliases,
    or OID if you prefer the Oracle product.
    this space intentionally left blank

  3. #3
    Join Date
    Mar 2006
    Posts
    176
    Thanks so much for your time and very clear explaination.

    I was thinking to use the trigger to control the listener in the event of failover.

    Could you please explain a little more on how cname or network alias or virtual NIC works in the event of DB failover?

  4. #4
    Join Date
    Nov 2000
    Location
    Pittsburgh, PA
    Posts
    4,001
    Generally I have done manual fail over with data guard. You still need to
    let the application know that the fail over happened. Here is a blog that
    shows how to point the application to the newly active prod. Just search
    for "Reconnect SAP instance to database".

    http://www.oracle.com/us/solutions/s...11g-303811.pdf
    this space intentionally left blank

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