Home > Oracle Rac > Manually converting Single Instance to RAC

Manually converting Single Instance to RAC

Steps taken from http://orapark.wordpress.com/

Pre-requisite setup:

  • I assume there is a Oracle single instance by name prod running on the Hostz. All the datafiles of this instance are on ext3 filesystem. Oracle version is 10.2.0 and OS is RHEL 4.
  • Prepare a 2 node RAC with oracle clusterware and oracle rdbms software installed and configured. Don’t create database, just choose the option “Install software only”. Before you do this, shared disk has to be configured; in our case we are using ocfs2 as the shared file system. Host names of the rac nodes are HostA and HostB. Oracle version is 10.2.0, Oracle clusterware version is 10.2.0 and OS is RHEL 4
  • I assume that OS Oracle owner username is oracle on all the nodes. (ie., source HostZ and Target HostA and HostB ).
  • This document lists the steps required to covert the sigle instance database to RAC instances.

___________________________________________________________________________________________________

STEP 1:

Clone single instance to One of the RAC nodes. (ie., single instance To single instance )

Clone the prod instance on HostZ to prod instance on HostA ( Retain the same instance name ie., prod ).

STEP 2:

——-Login to Host A

Shutdown the instance prod on HostA.

Change the SID to prod1 ie., export it directly OR set it in the environment file $HOME/.bash_profile.

$export ORACLE_SID=prod1

Prepare the parameter file initprod1.ora by copying the existing $ORACLE_HOME /dbs / initprod.ora

Add the following RAC related parameters to initprod1.ora. Retain all the old parameters from prod.

*.cluster_database=true
*.cluster_database_instances=2
prod1.instance_number=1
prod2.instance_number=2
prod1.thread=1
prod2.thread=2

Also update the initprod1.ora file with parameters related to second instance prod2, by prefixing the values with prod2.<parameter>= _ _ _. If the value is common to both instances you can say *.<parameter> =_ _ _ _ _.

Also modify the existing prod1 specific parameters by prefixing prod1. ie., prod1.<parameter>=_ _ _ _ _ _

( This is because, LATER we are going to create a common spfile from this initprod1.ora, which will be placed on the shared disk, and accessed by both nodes. )

Ultimately this is how my initprod1.ora file is looking like………..

*.cluster_database=true
*.cluster_database_instances=2
prod1.instance_number=1
prod2.instance_number=2
prod1.thread=1
prod2.thread=2
prod2.__db_cache_size=247463936
prod1.__db_cache_size=243269632
prod1.__java_pool_size=4194304
prod2.__java_pool_size=4194304
prod1.__large_pool_size=4194304
prod2.__large_pool_size=4194304
prod2.__shared_pool_size=109051904
prod1.__shared_pool_size=113246208
prod1.__streams_pool_size=0
prod2.__streams_pool_size=0
*.audit_file_dest=’/u01/oracle/product/10.2.0/admin/adump’
*.background_dump_dest=’/u01/oracle/product/10.2.0/admin/bdump’
*.compatible=’10.2.0.1.0′
*.control_files=’/u03/oracle/oradata/prod/control01.ctl’,’/u04/oracle/oradata/prod/control02.ctl’
*.core_dump_dest=’/u01/oracle/product/10.2.0/admin/cdump’
*.db_block_size=8192
*.db_domain=”
*.db_file_multiblock_read_count=16
*.db_name=’prod’
*.dispatchers=’(PROTOCOL=TCP) (SERVICE=prodXDB)’
*.job_queue_processes=10
*.open_cursors=300
*.pga_aggregate_target=121634816
*.processes=150
*.remote_login_passwordfile=’exclusive’
*.sga_target=365953024
*.undo_management=’AUTO’
*.user_dump_dest=’/u01/oracle/product/10.2.0/admin/udump’

STEP 3:

——-Login to HostA (As oracle user )

sql> connect / as sysdba

sql>startup

Now we have to create the Redo log file for instance prod2. It is good to have same size of redo log files on both nodes. Check the group and redo log size on the instance prod1 and create the Redo log files for prod2 instance.

sql> select group#,thread#,bytes/(1024*1024)mb from v$log;

sql>ALTER DATABASE ADD LOGFILE THREAD 2
GROUP 4 (‘/u03/oracle/oradata/prod/redo04.log’) size 50M,
GROUP 5 (‘/u03/oracle/oradata/prod/redo05.log’) size 50M,
GROUP 6 (‘/u03/oracle/oradata/prod/redo06.log’) size 50M;

sql>ALTER DATABASE ENABLE PUBLIC THREAD 2;

Create a spfile on the shared disk(/u03) , which can be used by both instances.

sql>create spfile=’/u03/oracle/oradata/prod/spfileprod.ora’ from pfile;

sql>shutdown immediate;

Create a pointer to the shared spfile

$cd $ORACLE_HOME/dbs

Backup the existing pfile

$ mv initprod1.ora initprod1.ora.bak

$vi initprod1.ora

spfile=/u03/oracle/oradata/prod/spfileprod.ora

$wq!

sql> startup

———Login to HostB (as oracle user)

$export ORACLE_SID=prod2

$cd $ORACLE_HOME/dbs

Point the init.ora to the common spfile.

$vi initprod2.ora

spfile=/u03/oracle/oradata/prod/spfileprod.ora

$wq!

sql> startup

…………..Now your Single Node is converted to RAC.

STEP 4: Post conversion steps

1. Create the temporary tablespaces.

2. Create Undo tablespaces for each instance and add the entry to the spfile.

3. Put your database in Archivelog mode. Let the archive destination be on shared storage and have a common destination for both the instances. Having common destination makes the media recovery job easy.

3. Run the script catclust.sql which is present in$ORACLE_HOME/rdbms/admin. This will create some of the RAC views. You can run this from any one of the RAC nodes.

4. Add an entry in the oratab file.

5. Create listener from netca and add an entry Local_Listener and Remote_Listener to the spfile.

 

STEP 5: Register the instance and listener with the CLUSTER

 

Login to any one of the node

$cd $CRS_HOME/bin

$srvctl add database -d prod -o $ORACLE_HOME

$srvctl add instance -d prod -i prod1 -n HostA
$srvctl add instance -d prod -i prod2 -n HostB

srvctl start database -d prod

–>Listener is automatically registered with cluster when you create it from netca. Manual registering of Listener is not possible in 10g.
(Make sure to choose Cluster Configuration option)

If everything is fine you should see all the registered components Online as show below.

$crs_stat -t

Name Type Target State Host
———– ————————————————-
ora….tA.lsnr application ONLINE ONLINE HostA
ora….stA.gsd application ONLINE ONLINE HostA
ora….stA.ons application ONLINE ONLINE HostA
ora….stA.vip application ONLINE ONLINE HostA
ora….tB.lsnr application ONLINE ONLINE HostB
ora….stB.gsd application ONLINE ONLINE HostB
ora….stB.ons application ONLINE ONLINE HostB
ora….stB.vip application ONLINE ONLINE HostB
ora.prod.db application ONLINE ONLINE HostA
ora….d1.inst application ONLINE ONLINE HostA
ora….d2.inst application ONLINE ONLINE HostB

**********************************************************************

~~END~~

Advertisements
Categories: Oracle Rac
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: