Thursday, April 6, 2017

Add Instance Manually


In this post we'll see the method to add an instance manually to a RAC database.


Scenario :-

Total no. of nodes in the cluster  : 3

Names of nodes                        : rac1,rac2,rac3

Name of RAC database               : orcl

Instances of orcl database           : orcl1, orcl2

Nodes hosting orcl instances       : rac1,rac2

Now I 'll add another instance orcl3 of orcl database on rac3 manually.

The steps which need to be taken:-

1) Rename init file and password file on new node

Here i'm assuming that we have already copied initfile and password from one of existing node to new node.


[oracle@rac3 ~]$ echo $ORACLE_HOME
/u01/app/oracle/product/11.2.0/db_1

[oracle@rac3 ~]$ cd $ORACLE_HOME/dbs
 [oracle@rac3 dbs]$ pwd
/u01/app/oracle/product/11.2.0/db_1/dbs

[oracle@rac3 dbs]$ ls -ltr
total 16
-rw-r----- 1 oracle oinstall 1536 Apr  2 20:40 orapworcl1
-rw-r----- 1 oracle oinstall   35 Apr  2 20:40 initorcl1.ora
-rw-r--r-- 1 oracle oinstall 2851 Apr  2 20:40 init.ora
-rw-rw---- 1 oracle oinstall 1544 Apr  2 20:40 hc_orcl1.dat

[oracle@rac3 dbs]$ mv initorcl1.ora initorcl3.ora

[oracle@rac3 dbs]$ mv orapworcl1 orapworcl3

[oracle@rac3 dbs]$ echo "orcl3:$ORACLE_HOME:N" >> /etc/oratab


Now you need to login into one of existing instance of database to perform below steps

2) Create redo-log group for new instance and enable thread


SYS@orcl1>alter database add logfile thread 3 group 11 ('+DATA') size 100M, group 12 ('+DATA') size 100M, group 13 ('+DATA') size 100M;
Database altered.

SYS@orcl1>alter system set thread =3 scope=spfile sid='orcl3';
System altered.

SYS@orcl1>alter database enable thread 3;
Database altered.


3) Create undo tablespace


SYS@orcl1>create undo tablespace undotbs3 datafile '+DATA' size 200M;
Tablespace created.

SYS@orcl1>alter system set undo_tablespace=undotbs3 scope=spfile sid='orcl3';
System altered.


3) Set other parameter for new instance


SYS@orcl1>alter system set instance_number=3 scope=spfile sid='orcl3';
System altered.

SYS@orcl1>alter system set cluster_database_instances=3 scope=spfile sid='*';
System altered.


4) Update Oracle Cluster Registry (OCR) for rac3


[oracle@rac3 dbs]$ db_env
[oracle@rac3 dbs]$ srvctl add instance -d orcl -i orcl3 -n rac3

[oracle@rac3]$ srvctl start instance -d orcl -i orcl3

[oracle@rac1 ~]$ srvctl status database -d orcl
Instance orcl1 is running on node rac1
Instance orcl2 is running on node rac2
Instance orcl3 is running on node rac3

[oracle@rac3 dbs]$ srvctl config database -d orcl
Database unique name: orcl
Database name: orcl
Oracle home: /u01/app/oracle/product/11.2.0/db_1
Oracle user: oracle
Spfile: +DATA/orcl/spfileorcl.ora
Domain: dba.com
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: orcl
Database instances: orcl1,orcl2,orcl3
Disk Groups: DATA
Services: j_srvice
Database is administrator managed


5) Copy TNSENTRY on rac3


Copy TNSENTRY for ORCL from one of existing node to new node

/u01/app/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora

ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = rac-cluster.rac1.dba.com)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl.dba.com)
    )
  )


6) Test that remote connection can be made from host03


[oracle@rac3 dbs]$ sqlplus sys@orcl as sysdba
Enter password:
Connected to:

SYS@orcl>



I have mentioned these steps in "add node to existing cluster" as well,
use link "https://aloksdba.blogspot.com/2017/04/add-node-to-existing-cluster.html"
for that.

Happy Learning !!

No comments:

Post a Comment