Professional Documents
Culture Documents
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Confidential – Oracle Internal/Restricted/Highly Restricted
Safe Harbor Statement
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, timing, and pricing of any
features or functionality described for Oracle’s products may change and remains at the
sole discretion of Oracle Corporation.
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Confidential – Oracle Internal/Restricted/Highly Restricted
Application High Availability
1 Motivation
2 Connecting to Oracle
3 Detecting HA Events
4 Re-directing Database Work for Planned Maintenance
5 Recovering from an Unplanned Outage
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 7
Program Agenda
1 Motivation
2 Connecting to Oracle
3 Detecting HA Events
4 Re-directing Database Work for Planned Maintenance
5 Recovering from an Unplanned Outage
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 8
Application High Availability
What if my application does not address high availability?
1 Motivation
2 Connecting to Oracle
3 Detecting HA Events
4 Re-directing Database Work for Planned Maintenance
5 Recovering from an Unplanned Outage
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 11
Applications Need a Highly Available Database
Oracle Database is the Gold Standard for HA
• Node Replication
– RAC – Real Application Clusters
– DG – Data Guard
– ADG – Active Data Guard
– PDB – Pluggable Database clones
• A node is always available to get new connections
OracleConnection con =
new OracleConnection();
Main Thread:
con.ConnectionString = "User Id=hr;
OCISessionPoolCreate(. . .); Password=hr; Data Source=hrdb;
Pooling=true"
con.Open();
Worker Thread: [database request]
OCISessionGet(. . .);
con.Dispose();
[database request]
OCISessionRelease(. . .);
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 14
Connect via CMAN-TDM (Traffic Director Mode)
C C++ • Supports 11gR2 (11.2.0.4) and newer
Applications and Drivers – 11gR2 and up
client and database
• Optional internal OCI Session Pool
(PRCP) for multiplexing and HA
support
CMAN- TDM
• Shields application from planned and
unplanned outages
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 16
Program Agenda
1 Motivation
2 Connecting to Oracle
3 Detecting HA Events
4 Re-directing Database Work for Planned Maintenance
5 Recovering from an Unplanned Outage
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 17
Fast Application Notification (FAN) Proven since 10g
Server initiated messages sent to interested clients
1 Motivation
2 Connecting to Oracle
3 Detecting HA Events
4 Re-directing Database Work for Planned Maintenance
5 Recovering from an Unplanned Outage
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 21
Error-Free Planned Maintenance
Migrate connections away from target instance
- Non-RAC database:
declare
params dbms_service.svc_parameter_array ; params('commit_outcome') := 'true' ;
begin params(’failover_restore') := 'LEVEL1'
params(’failover_type') := 'SELECT'; dbms_service.modify_service('hrsvc', params);
params(’failover_method') := 'BASIC' ; end;
params(’failover_delay') := 5;
params(‘failover_retries’) := 20;
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 27
HA with Oracle CMAN in Traffic Director Mode (CMAN-TDM)
Oracle Database
Program Agenda
1 Motivation
2 Connecting to Oracle
3 Detecting HA Events
4 Re-directing Database Work for Planned Maintenance
5 Recovering from an Unplanned Outage
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 30
Unplanned Outages
and
Application
Continuity
in OCI from 12.2
Request
Worker Thread: Begins
OCISessionGet(…);
…
OCI calls Request Body
… often ends with
COMMIT
OCISessionRelease(…);
Request
Ends
Installation Have Oracle client 12.2+, and Oracle Database 12.2+ with Transaction Guard
Service
Use srvctl, gdsctl, or DBMS_SERVICE to enable AC on the service
Configuration
Request
Use Oracle pools
Boundaries
Side Effects Use disable API or attribute if a request has a call that should not be replayed
Callbacks Register a TAF callback for applications that change state outside requests.