Introduction
This document is intend to explain about the RAC One feature that’s introduced in Oracle 11gR2.
What is Oracle RAC One
Real Application Cluster (RAC) One is a RAC enabled single instance database that can be moved around in a cluster.
The purpose of this feature is to improve the availability of a single instance database by providing fail-over protection. It helps to reduce down time during patching windows, rolling upgrades of both Oracle sand Operating system binaries.
To configure a RAC One database, we need to have a cluster environment with 2 or more nodes configured to form a cluster. Using the on-line database relocation feature, we can relocate the database instance from one node to another.
In 11.2.0.1, RAC One feature is limited to Linux platforms. This limitation is removed in 11.2.0.2, by integrating RAC One administration to SRVCTL.
Also there is another restriction exists to use the RAC One with 3rd party cluster-ware. Oracle has not certified this combination yet. I hope this will be removed in future.
How RAC One works?
On-line relocation is actually the key feature of RAC One. It allows the database instance to be relocated to another node of the cluster with a grace period.
This grace period will allow all the existing transactions in the database to complete. Once the online relocation is initiated all the new client connections will be re-directed to the new node node where the instance will be relocating.
Once the grace period is completed, the existing instance will be shutdown and all the connected clients will be failed over to the new instance that is running from the relocated node.
Configuring RAC One.
There are some significant differences in the way RAC One configurations works in both 11.2.0.1 and 11.2.0.2.
In 11.2.0.1, Oracle provides a set of shell scripts to monitor and perform the online migration. But starting from 11.2.0.2, this is integrated into SRVCTL utility. Both monitoring and migration can be done using SRVCTL command line options.
MOS Doc ID 1232802.1 gives more details about how RAC One works in 11.2.0.2
In the below section, we will see how RAC One can be configured and monitored in both 11.2.0.1 and 11.2.0.2 versions.
(i) RAC One in 11.2.0.1
Once RAC cluster is installed and configured, we need to download and install the patch 9004119 from MOS. This basically installs all the scripts required to use RAC One.
Ensure that the patch is applied to RDBMS HOMEs on all the nodes of the cluster, which are being considered as candidate nodes for RAC One.
The patch basically installs all the necessary scripts to perform the RAC One initialization and migrations.
-rwxr-xr-x 1 oracle oinstall 12396 Oct 22 2009 racone2rac
-rwxr-xr-x 1 oracle oinstall 25719 Oct 22 2009 raconefix
-rwxr-xr-x 1 oracle oinstall 20268 Oct 22 2009 raconeinit
-rwxr-xr-x 1 oracle oinstall 7461 Oct 22 2009 raconestatus
-rwxr-xr-x 1 oracle oinstall 22120 Oct 22 2009 Omotion
Once the patch is installed, use DBCA to create a RAC database on the first node of the cluster. Once the database creation is completed, we can start the configuration for RAC One.
(a) Run the script “raconeinit” script to initialize the database as RAC One.
Candidate Databases on this cluster:
# Database RAC One Node Fix Required
=== ======== ============ ============
[1] roneDB NO N/A
Enter the database to initialize [1]: 1
Database roneDB is now running on server: rac1
Candidate servers that may be used for this DB: rac2 rac3
Enter the names of additional candidate servers where this DB may run (space delimited): rac2 rac3
Please wait, this may take a few minutes to finish….
Database configuration modified.
$ raconestatus
Database UP Fix Required Current Server Candidate Server Names
———– —– —————– ——————- ——————————–
roneDB Y N rac1 rac1 rac2 rac3
(b) Once the database is initialized, we can run Omotion to start the database relocation.
$ Omotion
RAC One Node databases on this cluster:
# Database Server Fix Required
—- ———————- ——————- ———————————-
[1] roneDB rac1 N
Enter number of the database to migrate [1]: 1
Specify maximum time in minutes for migration to complete (max 30) [30]:
Available Target Server(s) :
# Server Available
== ============= =========
[1] rac2 Y
[2] rac3 Y
Enter number of the target node [1]: 1
Omotion Started…
Starting target instance on rac2…
Migrating sessions…
Stopping source instance on rac1…
Omotion Completed…
=== Current Status ===
Database roneDB is running on node rac2
$ raconestatus
RAC One Node databases on this cluster:
Database UP Fix Required Current Server Candidate Server Names
———— ——- ——————- —————— ——————————
roneDB Y N rac2 rac1 rac2 rac3
First step during the online migration is to start the instance on the target node. All the new client connections will be re-directed to the new node.
The “Omotion” will be wait for all the existing sessions that are connected to instance 1 to complete their transactions. And the timeout for this is based on the value we give for the “maximum time in minutes for migration to complete” when we execute the Omotion.
The max timeout is 30 mins in 11.2.0.1
Once the timeout is reached, the source instance will be terminated which will force all the existing sessions to reset their connections and initiate a new connection to the new instance that’s running on the target node.
During this process, all the running transactions will be rolled back.
(ii) RAC One in 11.2.0.2
Starting from 11.2.0.2, Oracle has added several improvements to RAC One feature. Most of them are documented in the MOS document 1232802.1.
Main change are:
o All RAC One administration ctivities can be done using SRVCTL utility.
o Both Universal installer and DBCA are RAC One aware now. We are able to install the binaries and create the database in RAC One mode.
(a) Once the installation is completed, run DBCA to create the database.
$ srvctl config database -d rone2db
Database unique name: ROne2DB
Database name: ROne2DB
Oracle home: /home/oracle/product/11gR2/11.2.0.2_RACOne
Oracle user: oracle
Spfile: +DG2/ROne2DB/spfileROne2DB.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: ROne2DB
Database instances:
Disk Groups: DG2,DG1
Mount point paths:
Services: ROne2DB_svc
Type: RACOneNode
Online relocation timeout: 30
Instance name prefix: ROne2DB
Candidate servers: rac1,rac2,rac3
Database is administrator managed
SRVCTL gives the options to manually add the RAC One database as well.
Usage:
srvctl add database -d <db_unique_name> -o <oracle_home> [-c {RACONENODE | RAC | SINGLE} [-e <server_list>] [-i <instname>] [-w <timeout>]] [-m <domain_name>] [-p <spfile>] [-r {PRIMARY | PHYSICAL_STANDBY | LOGICAL_STANDBY | SNAPSHOT_STANDBY}] [-s <start_options>] [-t <stop_options>] [-n <db_name>] [-y {AUTOMATIC | MANUAL}] [-g "<serverpool_list>"] [-x <node_name>] [-a "<diskgroup_list>"] [-j "<acfs_path_list>"]
Eg:
srvctl add database -d ROne2DB -o $ORACLE_HOME -c RACONENODE -e rac1,rac2,rac3 -w 30
(b) Online relocation in 11.2.0.2
The Omotion script has been replaced with “srvctl relocate database” command , this allow the online migration of RAC One database to any of the available candidate servers.
Usage: srvctl relocate database -d <db_unique_name> {[-n <target>] [-w <timeout>] | -a [-r]} [-v]
Eg:
$ srvctl status database -d rone2db
Instance RoneDB_1 is running on node rac1
Online relocation: INACTIVE
$ srvctl relocate database -d rone2db -n lnxrac2 -w 100 -v
Configuration updated to two instances
Instance RoneDB_2 started
Services relocated
Waiting for 100 minutes for instance Rone2DB_1 to stop…..
Instance RoneDB_1 stopped
Configuration updated to one instance
$ srvctl status database -d ronedb
Instance RoneDB_2 is running on node rac2
Online relocation: INACTIVE
(iii) Conversion between RAC One to RAC or vice versa
Both 11.2.0.1 and 11.2.0.2 allow coversion between RAC One and RAC.
Converting between RAC and RACOne is quite easy in 11.2.0.2
$ srvctl config database -d ronedb
Database unique name: RoneDB
Database name: RoneDB
Oracle home: /u01/app/oracle/product/11.2.0/dbhome_1
Oracle user: oracle
Spfile: +DG1/RoneDB/spfileRoneDB.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: RoneDB
Database instances:
Disk Groups: DG1,DG2
Mount point paths:
Services: RoneDB_svc
Type: RACOneNode
Online relocation timeout: 30
Instance name prefix: RoneDB
Candidate servers: rac1 ,rac2
Database is administrator managed
$ srvctl convert database -d ronedb -c RAC -n rac1
$ srvctl config database -d ronedb
Database unique name: RoneDB
Database name: RoneDB
Oracle home: /u01/app/oracle/product/11.2.0/dbhome_1
Oracle user: oracle
Spfile: +DG1/RoneDB/spfileRoneDB.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: RoneDB
Database instances: RoneDB_1
Disk Groups: DG1,DG2
Mount point paths:
Services: RoneDB_svc
Type: RAC
Database is administrator managed
Once the database is converted to RAC, we need to run DBCA to add additional instances on the remaining cluster nodes.
In the same way, to covert the database from RAC to RAC One, we need to run DBCA to delete the instances from all the nodes except the first node.
$ srvctl convert database -d ronedb -c RACONENODE -i RoneDB
$ srvctl modify database -d ronedb -e rac1,rac2
$ srvctl config database -d ronedb
Database unique name: RoneDB
Database name: RoneDB
Oracle home: /u01/app/oracle/product/11.2.0/dbhome_1
Oracle user: oracle
Spfile: +DG1/RoneDB/spfileRoneDB.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: RoneDB
Database instances:
Disk Groups: DG1,DG2
Mount point paths:
Services: RoneDB_svc
Type: RACOneNode
Online relocation timeout: 30
Instance name prefix: RoneDB
Candidate servers: rac1,rac2
Database is administrator managed
This RAC/RAC One conversion is done with the help of racone2rac script in 11.2.0.1.
$ racone2rac
Candidate Databases on this cluster:
# Database RACOne Node Fix Required
=== ======== ============= ============
[1] roneDB YES N
Enter the database to convert to one node RAC database [1]: 1
You are converting roneDB to single instance Oracle RAC database running on rac1,
Do you want to Continue? [Y]es or [N]o? Y
As mentioned earlier, we need to run DBCA to add additional instances on the remaining nodes of the cluster.
raconeinit script will convert RAC database back to Rac One. And off course we need to remove the additional instances we created earlier using DBCA and make database a single node RAC.