Application Continuity in Oracle Database 12c (12.1.0.2)

In this entry I’ll try and detail the steps required to get application continuity working with swingbench. I’ll create a video with a complete walk through of the build. It’s also possible this blog is likely to be updated regularly as I get feedback

Assumptions


The following assumptions are made

  • You have a working Oracle RAC Database 12c ideally running at version 12.1.0.2 (Database and Clusterware)
  • You have downloaded the very latest version of swingbench
  • You’ve installed the SOE benchmark using the oewizard
  • You’re running on a Physical or Virtual Machine (Virtual Box)
  • You are using the thin jdbc driver with swingbench

My configuration


In this example I’m using a 2 node RAC cluster for simplicity but I’ve validated the configuration on an 8 node cluster as well. My configuration

OS : Linux 6
Nodes : RAC1, RAC2
SCAN : racscan
CDB : orcl
PDB : soe
schema : soe

So after you’ve confirmed that the soe benchmark has been installed correctly the next step is to define the services. I created two new ones to show the difference between Application Continuity and standard Fast Application Failover. First a non Application Continuity Service

srvctl add service -d orcl -s soepdb -pdb soe -preferred orcl1,orcl2
srvctl modify service -db orcl -service soepdb -failoverdelay 5
srvctl modify service -db orcl -service soepdb -failoverretry  60
srvctl modify service -db orcl -service soepdb -clbgoal SHORT
srvctl modify service -db orcl -service soepdb -rlbgoal SERVICE_TIME


Now a service defined for Application Continuity

srvctl add service -db orcl -service soepdb_ac -commit_outcome TRUE -retention 86400 -preferred orcl1,orcl2
srvctl modify service -db orcl -service soepdb_ac -failovertype TRANSACTION
srvctl modify service -db orcl -service soepdb_ac -failoverdelay 5
srvctl modify service -db orcl -service soepdb_ac -failoverretry  60
srvctl modify service -db orcl -service soepdb_ac -session_state STATIC
srvctl modify service -db orcl -service soepdb_ac -clbgoal SHORT
srvctl modify service -db orcl -service soepdb_ac -rlbgoal SERVICE_TIME


Then grant access to the Application Continuity package to the SOE use

SYS@//rac1/soepdb > GRANT EXECUTE ON DBMS_APP_CONT TO SOE;

And thats it for the database/grid. All we need to do now is to configure swingbench to connect to the services. You can do this either in the command line, swingbench GUI or by editing the config file. The connect string should look similar to this (for application continuity)

(DESCRIPTION=
  (TRANSPORT_CONNECT_TIMEOUT=5)
  (RETRY_COUNT=6)
  (FAILOVER=ON)
  (ADDRESS =
    (PROTOCOL = TCP)
    (HOST = racscan)
    (PORT = 1521)
  )
  (CONNECT_DATA=
    (SERVER = DEDICATED)
    (SERVICE_NAME = soepdb_ac)
  )
)

NOTE : EZConnect strings won’t work for this.

We’ll also need to use connection pooling. The pool definition is only example and should reflect the total number of threads you plan to run with. If you’ve edited the definition in the config file you should end up with something similar to

<ConnectionPooling>
            <PooledInitialLimit>40</PooledInitialLimit>
            <PooledMinLimit>20</PooledMinLimit>
            <PooledMaxLimit>60</PooledMaxLimit>
            <PooledInactivityTimeOut>50</PooledInactivityTimeOut>
            <PooledConnectionWaitTimeout>45</PooledConnectionWaitTimeout>
            <PooledPropertyCheckInterval>10</PooledPropertyCheckInterval>
            <PooledAbandonedConnectionTimeout>120</PooledAbandonedConnectionTimeout>
</ConnectionPooling>

Or if you modify it via the GUI.

guimod1

The final step is to enable the application continuity driver and FAN you can again do this in the config file with the following settings

<Properties>
            <Property Key="StatementCaching">50</Property>
            <Property Key="FastFailover">true</Property>
            <Property Key="FetchSize">20</Property>
            <Property Key="OnsConfiguration">nodes=rac1:6200,rac2:6200</Property>
            <Property Key="AppContinuityDriver">true</Property>
</Properties>


or via the GUI

ChildMain

For my test I used the following Load configuration

<Load>
        <NumberOfUsers>60</NumberOfUsers>
        <MinDelay>0</MinDelay>
        <MaxDelay>0</MaxDelay>
        <InterMinDelay>50</InterMinDelay>
        <InterMaxDelay>500</InterMaxDelay>
        <QueryTimeout>120</QueryTimeout>
        <MaxTransactions>-1</MaxTransactions>
        <RunTime>0:0</RunTime>
        <LogonGroupCount>5</LogonGroupCount>
        <LogonDelay>1000</LogonDelay>
        <LogOutPostTransaction>false</LogOutPostTransaction>
        <WaitTillAllLogon>false</WaitTillAllLogon>
        <StatsCollectionStart>0:0</StatsCollectionStart>
        <StatsCollectionEnd>0:0</StatsCollectionEnd>
        <ConnectionRefresh>0</ConnectionRefresh>


Or via the GUI

ChildMain

My complete config file is available here for reference

I’d initially suggest running with swingbench to enable the monitoring of errors. Start swingbench

screenshot1

You should see a balanced number of users logged on across your instances. Although though may fluctuate depending on a number of factors.

ChildMain

The next step is to cause an unexpected termination of one of the resources. I’d suggest killing PMON i.e.

[oracle@rac2 ~]$ ps -def | grep pmon
oracle    4345     1  0 05:00 ?        00:00:00 asm_pmon_+ASM2
oracle   18093     1  0 08:11 ?        00:00:00 ora_pmon_orcl2
oracle   25847  6655  0 08:37 pts/1    00:00:00 grep pmon
[oracle@rac2 ~]$ kill -9 18093


You should see a little disruption in the TPS as you kill the instance. How long will depend on your RAC configuration and power of machine. The following screen shot is from 2 VMs running on my mac. But the important point is that swingbench won’t get any errors.


screenshot2

To try and see what happens without application continuity try changing the connect string to point at the non application continuity service.

ChildMain

Then delete the property that forces swingbench to use the Application Continuity Driver.

ChildMain

Rerunning and terminating the instance should result in something like this.

screenshot3

The important point here is the errors which normally an application developer would need to handle without the guarantee of transactions not being applied more than once.





Comments

On the subject of donations

Some of you may have noticed that on the side of the page I ask for donations. I haven’t been totally open about where that money goes to, so let me clear that up now. Over the years, like many people, I’ve seen the terrible pain and suffering cancer can inflict on friends and family. So all the donations that I receive via PayPal are given straight to Cancer Research UK and the British Red Cross. Clearly there’s no need to make it directly to me, you can pass it onto your local organisations.

So once again thank you to everybody that makes a donation.

imaging.ashx

www.redcross.org.uk
Comments

Some simple videos on 12.1.0.2 functionality

I’ve added a couple of simple youtube videos on Oracle Database 12c release 1 (12.1.0.2) functionality. I’ll be adding a few more over the new few weeks as well... Let me know what you think.

Comments

Ever so slightly embarassing

I’ve had to update swingbench again. I thought I made a minor refactoring update and managed to break more than I’d bargained for. Please use this version Build number 932.

You can download it
here

Comments

Minor driver update to swingbench and dbtimemonitor

I’ve posted a minor update to swingbench and dbtimemonitor to bring them up to the latest versions of the jdbc drivers and fix a “few” niggling bugs. Please refresh to these builds particularly if you plan to do any 12.1.0.2 testing in the future.

You can as always download them from
here
Comments