Friday, August 16, 2019

Convert Single Instance to RAC using RCONFIG

Convert Single Instance to RAC using RCONFIG


In $ORACLE_HOME/assistants/rconfig/sampleXMLs directory, there are two templates ConvertToRAC_AdminManaged.xml and ConvertToRAC_PolicyManaged.xml that are used to convert a single instance database to RAC admin managed or policy managed database respectively.

Below are the prerequisites that should be completed.

1-> Ensure the clusterware is configured, up and running on the nodes.
2-> Oracle RDBMS binaries for RAC database must be installed.
3-> Active ASM instance across the nodes.
4-> Create and mount required ASM diskgroups.
5-> Stand alone database running on the local node.
6-> Stand alone DB and RAC must be of same db versions.

All the steps to be performed from RAC1 Node(cluster node)
Note: It is assumed that we are also having ORACLE_HOME for single instance (i.e dbhome_1) at RAC1

1-> #su - oracle
2-> $. oraenv
3-> $export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
4-> $export PATH=$ORACLE_HOME/bin:$PATH
5-> $dbca => for creating a database for single instance
6-> $export ORACLE_HOME=/u01/home/oracle/product/11.2.0/dbhome_1
7->  $export PATH=$ORACLE_HOME/bin:$PATH
8-> $cp $ORACLE_HOME/assistants/rconfig/sampleXMLs/ConvertToRAC_Adminmanged.xml  /convert1.xml

Convert parameters:

– Source $OH = OracleHome of non-rac database for SourceDBHome
– Destination $OH = OracleHome where the RAC database should be configured.
– SourceDBInfo SID
– List of nodes that should have rac instances running for the Admin Managed Cluster Database. Local Node should be the first node.
– Instance Prefix tag is optional starting with 11.2.
– Specify the type of storage to be used by RAC database (ASM or Cluster File system).
– Specify Database Area Location to be configured for RAC database.
– Specify Fast Recovery Area to be configured for RAC database.

Example:

9-> $vi convert1.xml
:se nu
7=> verify="ONLY" (for verify and after give NO for convert)
9=> /u01/app/oracle/product/11.2.0/db_1   (source db home location)
11=>/u01/app/oracle/product/11.2.0/db_1  (target db home location)
13=> SID="nonrac" (sid of non-rac db)
16=>password=manager
22=> name="rac1"    (cluster(rac) nodes)
23=> name="rac2"
28=> prefix>nonrac<    (after migration rconfig creates nonrac1,nonrac2 intances)
31=> type="ASM"      (storage type (only two are there (ASM|CFS)))
33=> +DATA (storage location)
35=> +DATA (FRA location)
:wq!

10-> $rconfig convert1.xml (Only for verifying whether successful migrate or not)

11-> Set ONLY->NO in convert1.xml and run the below again:

$rconfig convert1.xml (Now For Migration after giving NO or YES option)

Note:

The Convert verify option in the ConvertToRAC.xml file has three options:

Convert verify="YES": rconfig performs checks to ensure that the prerequisites for single-instance to Oracle RAC conversion have been met before it starts conversion
Convert verify="NO": rconfig does not perform prerequisite checks, and starts conversion
Convert verify="ONLY" rconfig only performs prerequisite checks; it does not start conversion after completing prerequisite checks

Post conversion steps:

1-> Adjust the SGA for the RAC database, at least 15% for buffer cache and shared pool.
2-> Create SERVICE and apply TAF & Load balancing options, if required.
3-> Backup the RAC database.
4-> Backup OCR.
5-> Remove single-instance database.

How to resume from a failed conversion:

1-> Simply rerun the command if the rconfig exits in the mid-of the conversion for any fatal reasons.
2-> Perform clean-up operations on converted instance before reinitializing the conversion procedure.
3-> You can manually add the resources to CRS, in case rconfig utility fails to perform the final steps.

Logs to monitor:

1-> Single instance database alert log file.
2-> RAC database alert log file.
3-> $ORACLE_BASE/cfgtools/rconfig or /u01/app/oracle/cfgtoollogs/rconfig [records entire operation step-by-step]
4-> For RMAN log and SQL log, check the respective directories under /u01/app/oracle/cfgtoollogs/rconfig/db


Rconfig FAQ's:

What is the best scenario for using RCONFIG?

RCONFIG invokes RMAN internally to back up  the database to proceed with converting non-ASM to ASM.  This is time consuming task if the DB is in Terabyte size  and it will cause longer outage.
Hence this is good option only for small database and customer allows significant amount downtime.

How do we improve the conversion time with RCONFIG?

We can increase RMAN backup channel to reduce the backup time. Again it depends on how many number of CPU you have in your node. Here is the command to adjust the parallelism.  The  channel can be adjusted according to your server capacity.

RMAN> CONFIGURE DEVICE TYPE DISK PARALLELISM 6;

What does RCONFIG do during the conversion?

Migrate the database to ASM storage if we specified in XML file
Create Database Instances on all nodes in the cluster
Configure Listener and NetService entries
Configure and register CRS resources
Start the instances on all nodes in the cluster.
What are the Pre-requisite for RCONFIG utility?
Cluster should  installed and all the cluster process is up and running on all the nodes.
The oracle RAC RDBMS is installed on all nodes.
ASM disk must be mounted across all nodes if we want to migrate from file system to ASM.
The source and target should be in same home and same OS version.
Make sure, ASM disk has enough storage to migrate all the data files
How do we test RCONFIG before we do real conversion?

We have convert verify parameter in XML file and it has below options. Please choose ONLY.

Convert verify="YES"
Runs through verification checks to ensure that the
prerequisites for single-instance to RAC db
conversion have been met before it acutually starts
the conversion.

Convert verify="NO"
Bypass the prerequisite verification checks, and
starts conversion straight away

Convert verify="ONLY"
Do not perform the acutal conversion process.
Rather, just run through the prerequisite verification
checks and ends.

What can do if it fails middle of the conversion?

Don't get panic.  This will perform the clean-up operation on converted Instance or will delete the files created by earlier run.

How do we monitor conversion process during the migration?

There are few logs and we can tail the log during the process. We can monitor (tail -f)
single instance alert log, RAC database alert log, rconfig alert log, rman logs. Log info will give better idea and we can see what is going on.

How do we convert using RCONFIG if the stand alone DB is in different host?

You would accomplish this task by first restoring single instance database  in one of RAC node and , then you would use RCONFIG  to convert to RAC option.

No comments:

Post a Comment