Transaction Guard and Application Continuity

Transaction Guard:  A new feauture in version 12c.  Transaction guard provides a way to keep track of transaction state by using a logical transaction identifier which maps to a dataabase transactio_id.  If there is a failure, the applciation connection can query the transaction status using logical transaction_id to determine if a transaction is commited or not.  There are two parameters when creating a service as transaciton guard.  commit_outcome:  to determine if a logical transaction is tracked or not.  retention how long to retend in the database (default 86400 seconds = 1 day).

srvctl add service -d dba12c -service TGDBA12C -preferred DBA12C1 -available DBA12C2 -commit_outcome TRUE -retention 86400

Application Continuity:  
Application Continuity is a new feature in 12c using the transaction guard.  It attempts to mask the outage by rebuilding the database session and resubmitting the pending work.  It used client-side JDBC driver 12c, Universal connection Pool 12c, and Oracle WeblOGIC sERVER 12.1.2 class.

-failovertype TRANSACTION
-commit_outcome  TRUE

srvctl add service -d dba12c -service ACDBA12C -preferred DBA12C1 -available DBA12C2 -commit_outcome TRUE -retention 86400 -failovertype TRANSACTION -failoverretry 10 -failoverdelay 5 -replay_int_time 1200

Creating Services with Pluggable database in RAC


For applications to access the Pluggable database, you need to create services for the PDB.  

Example:  Create order_oltp service associated with pocpdb1 (PDB) prefered on poccdb1(Container DB instance 1) and available on poccdb2 (Container DB instance 2)

srvctl add service -db poccdb -service order_oltp -pdb pocpdb1 -preferred poccdb1 -available poccdb2

srvctl start service -d poccdb -s order_oltp

SQL> connect sys@pocpdb1 as sysdba
Enter password:
Connected.
SQL> show con_name
POCPDB1

To check services of the pluggable database

select name, pdb from all_services;

From clusterware, you can check the service configuration of a container database using srvctl command

poccdb1 > srvctl config service -db poccdb
Service name: order_oltp
Service is enabled
Server pool: poccdb_order_oltp
Cardinality: 1
Disconnect: false
Service role: PRIMARY
Management policy: AUTOMATIC
DTP transaction: false
AQ HA notifications: false
Global: false
Commit Outcome: false
Failover type:
Failover method:
TAF failover retries:
TAF failover delay:
Connection Load Balancing Goal: LONG
Runtime Load Balancing Goal: NONE
TAF policy specification: NONE
Edition:
Pluggable database name: pocpdb1
Maximum lag time: ANY
SQL Translation Profile:
Retention: 86400 seconds
Replay Initiation Time: 300 seconds
Session State Consistency:
Preferred instances: poccdb1
Available instances: poccdb2

Creating order_oltp Net Service name for Pluggale database

After define the service with property of the pluggable database, you can create the net service name order_oltp in the tnsnames.ora file for applications to access the PDBs.  The connection string should look like this..

ORDER =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 12cracpoc-scan)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = order_oltp)
    )
  )

sqlplus > connect sys@ORDER as sysdba
Enter password:

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Advanced Analytics and Real Application Testing options