Convert Single Instance database to 2 Node RAC

      No Comments on Convert Single Instance database to 2 Node RAC

Convert Single Instance Database to 2 Node RAC oracle 10g / 11g.

Install Clusterware on the nodes on which node you want to setup RAC .

Install Oracle Database 10g / 11gR2  Real Application Cluster software and Database Software.

Make sure your Clusterware version must be greater than or equal to the single instance database version. It must be corrected.

  • Install the Software. The RDBMS software version must be same as your single instance RDBMS software version

db_name = pankajdb
Instance1 = pankajdb1
Instance2 = pankajdb2
Node1 = rac1 (hostname)
Node2 = rac2 (hostname)

  1. Create Instance on Both the node.
    ORADIM utility for create instance on windows environment.
    ORADIM -NEW -SID PANKAJDB1 (On Node 1)
    ORADIM -NEW -SID PANKAJDB2 (On Node 2)
  1. Create pfile from spfile.
    Create pfile=/path/location/initpankajdb.ora from spfile;
    Edit pfile on node1 and add following parameters,

Edit Initpankajdb.ora

*.cluster_database = TRUE
*.cluster_database_instances = 2
*.undo_management=AUTO
pankajdb1.undo_tablespace=UNDOTBS1
pankajdb1.instance_name=pankajdb1
pankajdb1.instance_number=1
pankajdb1.thread=1
pankajdb1.local_listener=listener_pankajdb1
pankajdb2.instance_name=pankajdb2
pankajdb2.instance_number=2
pankajdb2.local_listener=listener_pankajdb2
pankajdb2.thread=2
pankajdb2.undo_tablespace=UNDOTBS2

Create spfile=’ORACLE_HOME/dbs/spfilepankajdb.ora’ from pfile=’path/location/initpankajdb.ora’;

  1. Create pfile for instance 1
    create pfile=’ORACLE_HOME/dbs/initpankajdb1.ora’ from spfile;
  2. Create new password file for pankajdb1 instance under RAC oracle home.
    Create password file through orapwd utility on both node.

 orapwd file=orapwpankajdb1 password=iStr789_pankajdb

  1. Add second thread to database which will be for instance 2
    If there is 3 group available in thread 1 then add 3 more group in thread 2.

alter database add logfile thread 2 group 7 (‘+data’) size 50m,
group 8 (‘+data’) size 50m,
group 9 (‘+data’) size 50m;
alter database enable public thread 2;

  1. Create the second instance undo tablespace from existing instance:
    You can create undo tablespace either node 1 or 2 it will be store in shared storage.

CREATE UNDO TABLESPACE UNDOTBS2 DATAFILE ‘+DATA’ SIZE 512M;

  1. Run $ORACLE_HOME/rdbms/admin/catclust.sql to create cluster database specific views within the existing instance 1
    SQL> @?/rdbms/admin/catclust.sql
  2. On the second node, set ORACLE_HOME and SID for instance 2
  1. Create new password file for instance 2
    orapwd file=orapwpankajdb2 password=iStr789_pankajdb
  2. Start the second instance

Set ORACLE_SID and start Database

Startup

NOTE:
You might face some issue while starting second instance as bdump, udump and cdump dir location will be that of single instance ORACLE_HOME which is not present in node2.

11.Need to create required directory on node 2.
audit_file_dest
background_dump_dest
user_dump_dest
core_dump_dest

12.Add database in cluster

  1. srvctl add database -d pankajdb -o /u01/app/oracle/pankajdbuct/10.2.0/db -p +DATA/pankajdb/spfilepankajdb.ora

(Need to change exact path once configuration done)

13.Add Instance in cluster
srvctl add instance -d pankajdb -i pankajdb1 -n rac1
srvctl add instance -d pankajdb -i pankajdb2 -n rac2

14.Crosscheck database status and cluster status for all node.
$ srvctl status database -d pankajdb
(It will show database status on both node )
$ srvctl status database -d dbname -i instance_name
$ srvctl status database -d pankajdb -i pankajdb1

  1. srvctl stop instance -d database_name -i Instance_name
    srvctl start instance -d database_name -i Instance_name
    srvctl status instance -d database_name -i Instance_name

srvctl stop database -d database_name -i Instance_name
srvctl start database -d database_name -i Instance_name
srvctl status database -d database_name -i Instance_name

Check CRS
crsctl check crs

Check Votingdisk
crsctl query css votedick

Check Votingdisk
ocrcheck

Check all Cluster services
crs_stat -t (Oracle 10g)
crsctl stat -t (oracle 11g)

 

Leave a Reply

Your email address will not be published. Required fields are marked *