Download as pdf or txt
Download as pdf or txt
You are on page 1of 24

Oracle Database 12c:

Application Continuity
Platform Technology Solutions
Oracle Server Technologies

1 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


The following is intended to outline our general product
direction. It is intended for information purposes only, and
may not be incorporated into any contract. It is not a
commitment to deliver any material, code, or functionality,
and should not be relied upon in making purchasing
decisions. The development, release, and timing of any
features or functionality described for Oracle's products
remains at the sole discretion of Oracle.

2 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Application Continuity

Application Continuity
Transaction Guard

3 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Unknown Transaction State
Leads to poor customer experiences

 Database and infrastructure outages can cause in-flight work to be


lost, leaving users and applications “in-doubt”
 Often leads to:
 User pains
 Duplicate submissions
 Rebooting mid-tiers
 Developer pains

4 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


In-Flight Work - Unplanned
Current Situation – Consider Oracle Travel ….

End User

Application Servers

Database Servers

5 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


In-Flight Work - Unplanned
Current Situation – Consider Oracle Travel ….

End User

Application Servers

Database Servers

6 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Unknown Transaction State
Current Situation
User selects product from
application and purchases it
from the web checkout
End User

Application Servers User transaction arrives at


application infrastructure. It
makes it’s way through the
Network Switches
application tiers and results in a
database transaction being
created
Database Servers

7 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Unknown Transaction State
Current Situation

A failure in the infrastructure on


End User its return journey means the
application server never
Application Servers User transaction
receives arrives at
an acknowledgment
application infrastructure and
makes it’s way through
Network Switches
application tiers and results in a
database transaction being
The transaction commits inside
created
of the database and an
Database Servers acknowledgement begins it
return journey

8 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Unknown Transaction State
Current Situation
The application is left in an
unknown state. It returns an
error to the user who may order
End User
the product for a second time
resulting in them potentially
Application Servers
being charged twice.

Network Switches

Database Servers

9 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


A Solution to the Problem
Two New Features

• Transaction Guard: a reliable protocol and API that returns the outcome
of the last transaction

• Application Continuity: safely attempts to replay in-flight work following


outages and planned operations.

10 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Transaction Guard
First Database to preserve COMMIT outcome

 Tool that supports known


outcome for every transaction
 Used by Application Continuity
End User
for at-most-once execution
Application Servers  Without Transaction Guard,
retry can cause logical
corruption
 Can be used independently of
Application Continuity
Database Servers

11 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Transaction Guard
Broad driver support in first release
• Clients
– JDBC-thin, OCI, OCCI, ODP.net
• Database
– Uses logical transaction ID (LTXID)
– Commit Models
• Local TXN
• Auto-commit, Commit on Success
• Commit embedded in PL/SQL
• DDL, DCL, Parallel DDL
• Remote, Distributed
– Excludes – XA in 12.1

12 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Application Continuity
A reliable replay of in flight work
User selects product from
application and purchases it
from the web checkout
End User

Application Servers User transaction arrives at


application infrastructure. It
makes it’s way through the
Network Switches
application tiers and results in a
database transaction being
created
Database Servers

13 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Application Continuity
A reliable replay of in flight work

End User

Application Servers

Network Switches The infrastructure hosting the


database fails just before the
transaction is committed to the
Database Servers database.

14 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Application Continuity
A reliable replay of in flight work

End User If the transaction needs to be


replayed, “Application
Application Servers TheContinuity”
jdbc driverwill
detects
submitthe
all of the
failure andwork
inflight checks
to awith an node
surviving
available node inand
in the cluster theperform
cluster, a
Network Switches
using “Transaction
commit. Guard”,
This all happens
whether the transaction
transparently to the application
committed or needs to be
replayed
Database Servers

15 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Application Continuity
A reliable replay of in flight work
The user receives confirmation
that his order has been
successfully completed.
End User

Application Servers

Network Switches

Database Servers

16 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Application Continuity
Architecture
• JDBC replay driver
– The JDBC replay driver intercepts execution errors and, when these errors are
recoverable, automatically replays the user calls from the beginning of the request.
When successful, the replay appears to the application as a delayed database
interaction.
• Continuity Director
– The continuity director directs the run time and replay, working in collaboration with
the JDBC client-side replay driver to determine what to do. The director knows what
is repeatable and how to repeat it.
 Replay Context
– Context information that the database returns to the client driver during normal runtimes to be
held by the JDBC replay driver in case a replay is required
 Transaction Guard

17 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Application Continuity
Solution coverage
 Client
– JDBC-Thin driver
– UCP, WebLogic Server, Third Party Java Apps

 Database
– SQL, PL/SQL, JDBC RPC
 Select, ALTER SESSION, DML, DDL, COMMIT/ROLLBACK/SAVEPOINT
– Transaction models
 Local, Parallel, Remote, Distributed
– Mutable function support
– Hardware acceleration on current Intel & Sparc chips

18 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Application Continuity for Java Transparency

 Application Continuity for Java will be used if the


Application
– Uses J2EE or JPA (Java Persistence API) that uses the
standard JDBC API
– Uses UCP or WebLogic Server and return connections to pool
– Does not have external actions that cannot be replayed.

19 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


How do TAF and Application Continuity differ ?
 Transparent Application  Application Continuity
Failover  JDBC Thin
 OCI, OCCI  Replays in-flight request on-demand (SQL,
 Replays open SELECT PL/SQL, RPC, local calls)
statements on-demand  “At-most-once” for transactions with
 Validates on client Transaction Guard
 Mutable replacement
 Hardware for validation at DB, when
available

20 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Setting up Application Continuity with UCP
Oracle 12.1 software is required on client and server

• Check whether ONS is running on the server


$ srvctl config nodeapps -s

• Use a database service to support Application Continuity


$ srvctl add service -d fp12c -s tgac -r FP12C1,FP12C2
-clbgoal SHORT -rlbgoal SERVICE_TIME -failoverretry 30
-failoverdelay 10 -commit_outcome TRUE -failovertype TRANSACTION -
replay_init_time 1800 -retention 86400 -notification TRUE

• Add to client CLASSPATH


– ons.jar
– ucp.jar

21 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Setting up Application Continuity with UCP
Creating a UCP connection pool to use Application Continuity

public void createPool(){


// Configure Replay Driver for Application Continuity
pds.setConnectionFactoryClassName("oracle.jdbc.replay.OracleDataSourceImpl");
pds.setUser("demo");
pds.setPassword("demo");
String dbURL = "jdbc:oracle:thin:@//myscan:1521/tgac.oracle.com";
pds.setONSConfiguration("nodes=ruby1.oracle.com:6200,ruby1.oracle.com:6200");
// Enable Fast Connection Failover and use remote ONS
pds.setFastConnectionFailoverEnabled(true);
pds.setInitialPoolSize(10);
pds.setValidateConnectionOnBorrow(true);
}

22 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Application Continuity
Demo

23 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


24 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

You might also like