Creating Services for Application Continuity and Transaction Guard

When using Application Continuity and Transaction Guard with your applications, you must configure a service. This section describes how to configure these application services depending on the functionality you plan to implement.

Creating Services for Application Continuity

To configure services for Application Continuity, when you create a service using SRVCTL, set the -failovertype parameter to TRANSACTION and -commit_outcome to TRUE. Additionally, you can set values for these other service parameters for Application Continuity and load balancing:

  • -replay_init_time: Specifies how long, in seconds, you allow replay to start. Oracle recommends that you choose a value based on how long you will allow replay to be initiated. The default value is 300 seconds.

  • -retention: Specifies the time (in seconds) that the commit outcome information is stored in the database. The default value is 86400 (1 day).

  • -session_state: After a COMMIT has executed, if the state was changed in that transaction, then it is not possible to replay the transaction to reestablish that state if the session is lost. When configuring Application Continuity, the applications are categorized depending on whether the session state after the initial setup is dynamic or static, and then whether it is correct to continue past a COMMIT operation within a request.

    • Dynamic: (default) A session has a dynamic state if the session state changes are not fully encapsulated by the initialization, and cannot be fully captured in a callback at failover. Once the first transaction in a request commits, failover is internally disabled until the next request begins. This is the default mode that almost all applications should use for requests.

    • Static: (special—on request) A session has a static state if all session state changes, such as NLS settings and PL/SQL package state, can be repeated in an initialization callback. This setting is used only for database diagnostic applications that do not change session state. Do not specify STATIC if there are any non-transactional state changes in the request that cannot be reestablished by a callback. If you are unsure what state to specify, use DYNAMIC.

  • -failoverretry: Number of connection retries for each connection attempt; recommended value is 30.

  • -failoverdelay: Delay in seconds between each connection attempt; recommended value is 10.

  • -notification: FAN is highly recommended—set this value to TRUE to enable FAN for OCI and ODP.Net clients.

  • -clbgoal: For connection load balancing, use SHORT when using run-time load balancing.

  • -rlbgoal: For run-time load balancing, set to SERVICE_TIME.

To create a service for Application Continuity for a policy-managed Oracle RAC database, use a command similar to the following, where racdb is the name of your Oracle RAC database, app2 is the name of the service you are modifying, and Svrpool1 is the name of the server pool in which the service is offered:

$ srvctl add service -db racdb -service app2 -serverpool Srvpool1
    -failovertype TRANSACTION -commit_outcome TRUE -replay_init_time 1800
    -retention 86400 -notification TRUE -rlbgoal SERVICE_TIME -clbgoal SHORT
    -failoverretry 30 -failoverdelay 10

You can use SRVCTL to modify an existing service for Application Continuity, similar to the following command, where racdb is the name of your Oracle RAC database, and app1 is the name of the service you are modifying:

$ srvctl modify service -db racdb -service app1 -clbgoal SHORT
    -rlbgoal SERVICE_TIME -failoverretry 30 -failoverdelay 10
    -failovertype TRANSACTION -commit_outcome TRUE -replay_init_time 1800
    -retention 86400 -notification TRUE

Creating Services for Transaction Guard

To enable Transaction Guard, but not Application Continuity, create the service using SRVCTL and set only -commit_outcome TRUE.

You can use SRVCTL to modify an existing service to enable Transaction Guard, similar to the following command, where racdb is the name of your Oracle RAC database, and app2 is the name of the service you are modifying:

$ srvctl modify service -db racdb -service app2 -commit_outcome TRUE
    -retention 86400 -notification TRUE

In the preceding example, the -retention parameter specifies how long, in seconds, to maintain the history. Additionally the –notification parameter is set to TRUE, enabling FAN events.

To use Transaction Guard, a DBA must grant permission, as follows:

GRANT EXECUTE ON DBMS_APP_CONT;

See Also:

Oracle Database Development Guide for more information about using Transaction Guard with applications