This discussion is archived
13 Replies Latest reply: Aug 22, 2013 8:52 AM by 889906 RSS

Switchover and Failover tips...

794493 Newbie
Currently Being Moderated
Hello everybody.

I have some configurations of data guard 11g (Physical). Every aplications that use primary databases have an entry of standby database on their tnsnamees.ora. Is there any solution when I do a switchover or failover to those application begin to use the new production database without make any change at code level???

thanks again
  • 1. Re: Switchover and Failover tips...
    Dr. Paranoid Pro
    Currently Being Moderated
    See http://www.oracle.com/technetwork/database/features/availability/maa-wp-11gr2-client-failover-173305.pdf

    You can do the basic client failover setup and not use the FAN/FCF/ONS which would require some application changes. But you risk the clients hanging on the crashed production database for the normal network timeout period.

    Larry
  • 2. Re: Switchover and Failover tips...
    mseberg Guru
    Currently Being Moderated
    "I do a switchover or failover to those application begin to use the new production database without make any change at code level?"

    Sure, handle it with a tnsnames.ora change instead.

    For example on our App server the entry is already there so we just change the alias and its all good. For client server we have a common tnsnames.ora on the network.


    The one thought that comes to mind is a Java connection, for example:

    conn = DriverManager.getConnection ("jdbc:oracle:thin:@some.server.com:1521:TEST", "scott","tiger");


    Something like that will cause an issue, but its more of a JDBC issue that a Data Guard issue.

    On all our tests we switched the tnsnames.ora and the customer never even knew.

    Best Regards

    mseberg
  • 3. Re: Switchover and Failover tips...
    794493 Newbie
    Currently Being Moderated
    Thanks for helping

    I don't want to use a failover configuration. I just want to use a better way to applications can connect to a new database (old standby) making minimal changes.

    This is what I have done 'till now:

    For example I have 10 Application Servers those use my primary database. At those App Servers I have an entry to my standby on tnsname.ora.

    if i have to do a switchover or failover, all App Servers have to point to new database (standby entry) in a manual way????? I can't do it automatically???

    Thanks again
  • 4. Re: Switchover and Failover tips...
    Dr. Paranoid Pro
    Currently Being Moderated
    What you are trying to do is called a failover configuration. You want your application tier to be able to connect to the standby database automatically when it becomes the primary. That is the definition of a failover configuration.

    However, it looks like you are on 10g and I sent the link for the 11.2 paper. Read http://www.oracle.com/technetwork/database/features/availability/maa-wp-10gr2-clientfailoverbestprac-129636.pdf and just ignore the bits about FAN and FCF and ONS. Just use the services and the tnsnames definitions that are shown in the paper. What you need starts on page 10.

    Larry
  • 5. Re: Switchover and Failover tips...
    mseberg Guru
    Currently Being Moderated
    All I can answer is what I do. If you have these two entries in your tnsnames.ora:

    PRIMARY=
    (DESCRIPTION=
    (ADDRESS=
    (PROTOCOL=TCP)
    (HOST=some.server.com)
    (PORT=1521)
    )
    (CONNECT_DATA=
    (SERVICE_NAME=PRIMARY)
    (UR=A)
    )
    )


    STANDBY=
    (DESCRIPTION=
    (ADDRESS=
    (PROTOCOL=TCP)
    (HOST=some.standby.server.com)
    (PORT=1521)
    )
    (CONNECT_DATA=
    (SERVICE_NAME=STANDBY)
    (UR=A)
    )
    )

    You just switch PRIMARY and STANDBY. I don't even try automatically because I want to check the DB first. However you can configure Oracle Net alias to specify both the primary and standby hostnames, and have it SCAN for both of them. Search for "OCI and JDBC automatic failover for OCI clients" in the link Dr. Paranoid gave you.

    Opinion (Mine) Most of the document links provided by Dr. Paranoid are gold. If you gives you one and you read if it will almost always solve you issue.

    Best Regards

    mseberg
  • 6. Re: Switchover and Failover tips...
    794493 Newbie
    Currently Being Moderated
    Hi again.


    I have both Oracles on 11gR1. Do you have a link of some whitepaper to this version ??
  • 7. Re: Switchover and Failover tips...
    mseberg Guru
    Currently Being Moderated
    I don't. However I'm almost 100% sure this part of Data Guard did not change for Oracle 11. So the 10 version is good.


    Cliff notes can be found here:

    How to configure Client Failover after Data Guard Switchover or Failover [ID 316740.1]


    Best Regards

    mseberg
  • 8. Re: Switchover and Failover tips...
    Dr. Paranoid Pro
    Currently Being Moderated
    The 10g Papers is the same for 11.1. The 11.2 paper I also mentioned above is basically the same with additions for Oracle Restart, SCAN listeners, Role Based services, etc.

    Larry
  • 9. Re: Switchover and Failover tips...
    UweHesse Expert
    Currently Being Moderated
    Apart from the very good whitepaper that Larry has already referenced, if you'd like to see a simple example:

    Client failover with event trigger managing the Application Service (only possible way in pre 11gR2):
    http://uhesse.wordpress.com/oracle-database-ha-architecture/2009/08/19/connect-time-failover-transparent-application-failover-for-data-guard/

    Client failover with Oracle Restart managing the Application Service (11gR2 only):
    http://uhesse.wordpress.com/oracle-database-ha-architecture/2010/09/06/data-guard-oracle-restart-in-11gr2/

    Kind regards
    Uwe Hesse

    http://uhesse.wordpress.com
  • 10. Re: Switchover and Failover tips...
    794493 Newbie
    Currently Being Moderated
    Hi again and thanks for helping.

    I reed the WhitePaper and it is very complicated to provide Client Failover 'cause many ways Client can access to Database. I think that providing OCI Client Configuration to this purpose it is good. So I haven't test it yet. If I have to configure it, it looks like this:

    DATAGUARDOCI =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = PRIMARY)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = STANDBY)(PORT = 1521))
    (LOAD_BALANCE = yes)
    )
    (CONNECT_DATA=
    (SERVICE_NAME=PRIMARY.DOMAIN)
    )
    )



    And setting SQLNET.OUTBOUND_CONNECT_TIMEOUT parameter, here I need help, how much do you think???


    If you had configured a OCI Client Failover like this you can explain me about your experience.

    Thanks again
  • 11. Re: Switchover and Failover tips...
    Dr. Paranoid Pro
    Currently Being Moderated
    You are missing the FAIOOVER clause.

    DATAGUARDOCI =
    (DESCRIPTION =
    (FAILOVER = ON)
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = PRIMARY)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = STANDBY)(PORT = 1521))
    (LOAD_BALANCE = yes)
    )
    (CONNECT_DATA=
    (SERVICE_NAME=PRIMARY.DOMAIN)
    )
    )

    As for SQLNET.OUTBOUND_CONNECT_TIMEOUT - Page 9 Bullet 5 of the paper I sent you the link for already http://www.oracle.com/technetwork/database/features/availability/maa-wp-10gr2-clientfailoverbestprac-129636.pdf

    Larry
  • 12. Re: Switchover and Failover tips...
    889906 Newbie
    Currently Being Moderated

    I have two Oracle 11g r2 databases on separate servers (primary/physical standby) with data guard configured to switch over between the two. This is just a priimary database and its standby with no RAC configured.

     

    I have an API server running in Windows IIS which connects to the primary database via Oracle 11g client. There is much discussion above on application failover. I would like to know:

     

    1. Do I have to configure a new service on each database server using srvctl to provide applicatiion connection to the database?

    2. When this is done I suppose by configuring tnsnames with the same new service name the application will be automatically switched to the open database on switchover?

    3. What steps do I have to carry out to achive this?

     

    Thanks,

    Lloyd

  • 13. Re: Switchover and Failover tips...
    mseberg Guru
    Currently Being Moderated

    Lloyd;

     

    Please open a new question.

     

    Best Regards

     

    mseberg

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points