National Instruments is a test and measurement company founded in 1976 and headquartered in Austin, Texas. It has approximately 7,100 employees operating in almost 50 countries. Sean Braymen is a senior Oracle database administrator at National Instruments who has worked there for 14 years. Application continuity is an Oracle Database feature that attempts to mask database session outages by replaying transactions to provide continuous application access after an outage.
2. 2ni.com
About National Instruments
Founded: 1976
Corporate Headquarters: Austin, Texas
Industry: Test and Measurement
Our Mission:
We equip engineers and scientists with systems that
accelerate productivity, innovation, and discovery.
Revenue: $1.24 billion in 2014
Global Operations: Approximately 7,100 employees;
operations in almost 50 countries
IT Development Centers:
• Austin, Texas
• Debrecen, Hungary
• Penang, Malaysia
• San José, Costa Rica
• Shanghai, China
3. 3ni.com
About Sean Braymen
Title: Senior Oracle Database Administrator
Education: Kansas State University
Work History:
• National Instruments for 14 Years
• Prior to becoming a DBA:
Manufacturing IT; eCommerce Advisors
• 4 Years as a DBA
Family: Wife and 5 Year Old Daughter
Hobbies: Distance Running; Travel
5. 5ni.com
What is Application Continuity
• Application Continuity is a feature that attempts to mask
database session outages by recovering the in-flight work
for request submitted to the database.
• Application Continuity attempts to replay the transactional
and nontransactional work that makes up a database
request. When replay is successful, the outage appears
to the end user as if the execution was slightly delayed.
6. 6ni.com
Key Concepts for Application Continuity
• Database Request: Unit of work submitted from the
application, typically SQL, PL/SQL, RPC calls
• Recoverable Error: Error that arises due to an external
system failure, independent of the application
• Commit Outcome: Outcome of the last transaction
• Mutable Functions: Functions that change their results
each time they are executed
• Session State Consistency: Describes how the
application changes the nontransactional state during a
database request
7. 7ni.com
What is Transaction Guard?
Transaction Guard is:
• A tool that provides a reliable commit outcome for the last
transaction after errors
• An API available for JDBC Thin, C/C++ (OCI/OCCI), and
ODP.NET
• Used by Application Continuity for at-most-once execution
• Can be used independently of Application Continuity
Without Transaction Guard, retry can cause logical
corruption
9. 9ni.com
Transaction in Action: WithoutApplication Continuity
1. Work Request
2. DB Calls
3. DB Error / Shutdown
4. Application
Errors
10. 10ni.com
What Did the End User See?
• Application received an “ORA-03113: end-of-file
communication channel”
• Application error handling can vary
• Blank screen; generic error page; cryptic error message; etc
• Developing a solution inside the application is difficult and
expensive
• Database outages can cause:
• In-flight work to be lost, leaving users in doubt
• Users to restart applications and re-entering data, leading to
duplication of requests
• Additional failures that result in prolonged outages
11. 11ni.com
Transaction in Action: WithApplication Continuity
1. Work Request
2. DB Calls
3. Error / Shutdown
4. Replay
5. Response
12. 12ni.com
What Did the End User See?
• Application completed it work without any displayed
errors
• Application took slightly longer to accomplish the task
than normal
13. 13ni.com
Processing Phases of Application Continuity
Normal Run Time Reconnect Replay
• Start the database
request
• Builds proxy objects
• Holds the original
calls with validation
• Manages queues
• Ensure that the
request has replay
enabled
• Handles timeouts
• Creates a new
connection
• Validates the target
database
• Uses Transaction
Guard to enforce last
commit
• Replays held calls
• Continues replay, if
user-visible results
match base on
validations
• Continues the request
• Throws the original
exception if replay is
unsuccessful
14. 14ni.com
Requirements for Application Continuity
• Oracle Database 12c
• Oracle Database 12c for SQL*Plus Connections
• Oracle JDBC Driver 12.1.0.2 or later
• Oracle Universal Connection Pool (UCP)
o oracle.jdbc.replay.OracleDataSourceImpl – PooledConnection interface
o Supported by many including: IBM WebSphere, Apache Tomcat
and Red Hat JBoss
• WebLogic Server 12c
• Resource Needs
• Memory: The JDBC replay driver requires more memory because the calls
are retained until the end of the database request
• CPU: The JDBC replay driver uses additional CPU for building proxy
objects, managing queues and garbage collection
o Overhead may be reduced for database platforms with current SPARC chips
19. 19ni.com
UsingApplication Continuity
• Supported Operations
• SQL, PL/SQL, and JDBC RPC
o SELECT
o ALTER SESSION
o DML
o DDL
o SAVEPOINT / ROLLBACK
• Transaction Models
o Local, Parallel, Remote, Distributed and Embedded PL/SQL
• Mutable Functions
• Required Transaction Guard
• Works with Active Data Guard
20. 20ni.com
Mutable Objects and Application Continuity
• SYSDATE / SYSTIMESTAMP
• GRANT KEEP DATE TIME TO <user>;
• SEQUENCES
• GRANT KEEP SEQUENCES ON <sequence_name> TO <user>
• CREATE SEQUENCE <sequence_name> KEEP;
• ALTER SEQUENCE <sequence_name> KEEP;
21. 21ni.com
Restrictions for Application Continuity
• Unsupported Operations
• Default Database Services
• JDBC Concrete Classes
o Old Java classes: oracle.sql.*
o New interfaces: oracle.jdbc.*
• XA Transactions
• 3rd Party Statement Cache
• Replay is not supported for Active Data Guard with read/write
database links
22. 22ni.com
Restrictions for Application Continuity
• Transaction Types with Risks
• UTL_FILE Operations
• Email or notifications using DBMS_ALERT, UTL_MAIL,
UTL_SMTP
• Web Service calls (UTL_HTTP)
• Autonomous Transactions
• Transactions over database link
23. 23ni.com
Administration
• Stopping a session without replay
• alter system kill session ‘sid, serial#, @inst’ noreplay;
• alter system disconnect session ‘sid, serial#, @inst’ noreplay;
• Stopping a service
• srvctl stop service –d <database_name> -s <service_name> -noreplay
• Stopping an instance
• srvctl stop instance –d <database_name> -i <instance> -noreplay