8 Scenario: Configuring Transparent Application Continuity

This scenario describes configuring Transparent Application Continuity (TAC) with Oracle Data Guard on Oracle Database Appliance.

Application Continuity (AC) is available with Oracle Real Application Clusters (Oracle RAC), Oracle RAC One Node, and Oracle Active Data Guard options. It masks outages from end users and applications by recovering the in-flight work for impacted database sessions following outages. AC performs this recovery beneath the application, so that the outage appears to the application as a slightly delayed execution. It improves user experience for both unplanned outages and planned maintenance. It enhances the fault tolerance of systems and applications that use an Oracle database. Note that depending on the latency, bandwidth between the primary and the standby, complete site failover may be required, otherwise the response time of the applications that are still running on the primary site may suffer from network latency between the two sites. For more details, refer to the Continuous Availability technical brief. All options described in that technical brief are applicable to Oracle Database Appliance.

Environment

Understand the environment to setup Transparent Application Continuity (TAC) in a two-node primary Oracle RAC database and two-node standby Oracle RAC database environment.

Component Primary Oracle Database Appliance Standby Oracle Database Appliance
Database Type two-node Oracle RAC database two-node Oracle RAC database
Database Name racwtac racwtac
Database Unique Name racwtac_pri racwtac_stby
pluggable database (PDB) to be protected by TAC buda buda

Configuring Oracle Data Guard

Understand the steps to configure Oracle Data Guard with Application Continuity.

Follow these steps:
  1. Verify that Oracle Active Data Guard is configured between the primary and standby appliances:
    # odacli list-dataguardstatus
    Updated about 1 minute(s) ago
    It can take up to several minutes to update Data Guard status. You can re-run the command to obtain the latest status.
    ID                                       Name                             Database Name        Role       Protection Mode    Apply Lag       Transport Lag   Apply Rate      Status
    ---------------------------------------- -------------------------------- -------------------- ---------- ------------------ --------------- --------------- --------------- ----------
    9511c5cc-365c-4e85-9dee-8a55ae6f01fa     racwtac_pri_racwtac_stby         racwtac              PRIMARY    MAX_PERFORMANCE    0 seconds       0 seconds       2.00 KByte/s    CONFIGURED
  2. On the primary system, log in as the oracle user on any of the nodes and configure a role-based Transparent Application Continuity type of service:
    $ export ORACLE_HOME=path_of_the_RDBMS_home
    $ $ORACLE_HOME/bin/srvctl add service -db racwtac_pri -service tacservice -pdb buda -preferred racwtac1,racwtac2 -failover_restore AUTO -commit_outcome TRUE -failovertype AUTO -replay_init_time 600 -retention 86400 -notification TRUE -drain_timeout 300 -stopoption IMMEDIATE -role PRIMARY

    where failovertype = AUTO or TRANSACTION for Application Continuity, commit_outcome = TRUE for Transaction Guard, failoverretry = Number of connection retries per replay, failoverdelay = Delay in seconds between connection retries.

  3. Start the service on the primary:
    $ $ORACLE_HOME/bin/srvctl start service -s tacservice -d racwtac_pri
    
    $ $ORACLE_HOME/bin/srvctl status service -s tacservice -d racwtac_pri
    Service tacservice is running on instance(s) racwtac1,racwtac2
    
    $ORACLE_HOME/bin/srvctl config service -d racwtac_pri -s tacservice
    Service name: tacservice
    Server pool:
    Cardinality: 2
    Service role: PRIMARY
    Management policy: AUTOMATIC
    DTP transaction: false
    AQ HA notifications: true
    Global: false
    Commit Outcome: true
    Failover type: AUTO
    Failover method:
    Failover retries: 30
    Failover delay: 10
    Failover restore: AUTO
    Connection Load Balancing Goal: LONG
    Runtime Load Balancing Goal: NONE
    TAF policy specification: NONE
    Edition:
    Pluggable database name: buda
    Hub service:
    Maximum lag time: ANY
    SQL Translation Profile:
    Retention: 86400 seconds
    Replay Initiation Time: 600 seconds
    Drain timeout: 300 seconds
    Stop option: immediate
    Session State Consistency: AUTO
    GSM Flags: 0
    Service is enabled
    Preferred instances: racwtac1,racwtac2
    Available instances:
    CSS critical: no
    Service uses Java: false
  4. On the standby system, log in as the oracle user on any of the nodes and configure the same role-based Transparent Application Continuity type of service:
    $ $ORACLE_HOME/bin/srvctl add service -db racwtac_stby -service tacservice -pdb buda -preferred racwtac1,racwtac2 -failover_restore AUTO -commit_outcome TRUE -failovertype AUTO -replay_init_time 600 -retention 86400 -notification TRUE -drain_timeout 300 -stopoption IMMEDIATE -role PRIMARY
  5. Following is the JDBC connect string that our application must use to access all the benefits that TAC provides:
    jdbc:oracle:thin:@(DESCRIPTION=(CONNECT_TIMEOUT=90)(TRANSPORT_CONNECT_TIMEOUT=3)(RETRY_COUNT=50)(RETRY_DELAY=3)(ADDRESS_LIST=(LOAD_BALANCE=ON)(ADDRESS=(PROTOCOL = TCP)(HOST = primary-scan.oracle.com)(PORT = 1521)))(ADDRESS_LIST=(LOAD_BALANCE=ON)(ADDRESS=(PROTOCOL = TCP)(HOST = standby-scan.oracle.com)(PORT = 1521)))(CONNECT_DATA=(SERVER = DEDICATED)(SERVICE_NAME = tacservice.oracle.com)))