Application Continuity in Oracle Database 12c (12.1.0.2)
19/11/14 13:53 Filed in: SwingbenchOracle 12c
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
The following assumptions are made
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
Now a service defined for Application Continuity
Then grant access to the Application Continuity package to the SOE use
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)
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
Or if you modify it via the GUI.
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
or via the GUI
For my test I used the following Load configuration
Or via the GUI
My complete config file is available here for reference
I’d initially suggest running with swingbench to enable the monitoring of errors. Start swingbench
You should see a balanced number of users logged on across your instances. Although though may fluctuate depending on a number of factors.
The next step is to cause an unexpected termination of one of the resources. I’d suggest killing PMON i.e.
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.
To try and see what happens without application continuity try changing the connect string to point at the non application continuity service.
Then delete the property that forces swingbench to use the Application Continuity Driver.
Rerunning and terminating the instance should result in something like this.
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.
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
40 20 60 50 45 10 120
Or if you modify it via the GUI.
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
50 true 20 nodes=rac1:6200,rac2:6200 true
or via the GUI
For my test I used the following Load configuration
60 0 0 50 500 120 -1 0:0 5 1000 false false 0:0 0:0 0
Or via the GUI
My complete config file is available here for reference
I’d initially suggest running with swingbench to enable the monitoring of errors. Start swingbench
You should see a balanced number of users logged on across your instances. Although though may fluctuate depending on a number of factors.
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.
To try and see what happens without application continuity try changing the connect string to point at the non application continuity service.
Then delete the property that forces swingbench to use the Application Continuity Driver.
Rerunning and terminating the instance should result in something like this.
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.
blog comments powered by Disqus