Total Pageviews

Tuesday 17 March 2015

Converting to cluster database and adding instances

Converting to cluster database and Adding instances :

Source DB :
=========

DB_NAME=orcl
ORACLE_HOME= /data01/app/oracle/product/11.2.0.4/db_1/
SPFILE/PFILE= /data01/app/oracle/product/11.2.0.4/db_1/dbs/initorcl.ora
ORALCE_SID=ORCL
Cluster DB=FALSE
HOSTNAME=NODE1

Target DB:
========
DB_NAME=orcl
ORACLE_HOME= /data01/app/oracle/product/11.2.0.4/db_1/
SPFILE/PFILE= +DATA
cluster_database=true
orcl2.instance_number=2
orcl1.instance_number=1
Hostname : node1 , node2

Step 1: Check the cluster database parameter for source DB and shu the DB to make changes in pfile:

SQL> show parameter cluster ;

NAME     TYPE VALUE
------------------------------------ ----------- ------------------------------
cluster_database     boolean FALSE
cluster_database_instances     integer 1
cluster_interconnects     string
 
Step 2 : Make the cluster parameter true in the pfile , also add other rac specific parameters as highlighted below:

[oracle@node1 trace]$ cat /data01/app/oracle/product/11.2.0.4/db_1/dbs/initorcl.ora
*.audit_file_dest='/data01/app/oracle/admin/orcl/adump'
*.audit_trail='db'
*.compatible='11.2.0.4.0'
*.control_files='+DATA/orcl/controlfile/current.269.874539303','+FRA/orcl/controlfile/current.256.874539311'
*.db_block_size=8192
*.db_create_file_dest='+DATA'
*.db_domain=''
*.db_name='orcl'
*.db_recovery_file_dest='+FRA'
*.db_recovery_file_dest_size=3670016000
*.diagnostic_dest='/data01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)'
*.log_archive_format='%t_%s_%r.dbf'
*.memory_target=839909376
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
orcl1.undo_tablespace='UNDOTBS1'
orcl2.undo_tablespace='UNDOTBS2' 
*.cluster_database=true
orcl2.instance_number=2
orcl1.instance_number=1
orcl2.thread=2
orcl1.thread=1

Step 3: Startup DB using the modified pfile and Create spfile from pfile ; 

SQL> create spfile='+DATA' from pfile ; 

File created.

you can check the location of spfile create using asmcmd :

ASMCMD> pwd
+DATA/ORCL/PARAMETERFILE
ASMCMD> ls
spfile.264.874545139
ASMCMD>

Step 4: Shutdown and Create pfiles for both instance orcl1 and orcl2 :
Modify pfile to have only entry of spfile as below , SPFILE path should be shared and accessible from both node1 and node2 :

[oracle@node1 trace]$ mv /data01/app/oracle/product/11.2.0.4/db_1/dbs/initorcl.ora /data01/app/oracle/product/11.2.0.4/db_1/dbs/initorcl1.ora

[oracle@node1 trace]$ cat /data01/app/oracle/product/11.2.0.4/db_1/dbs/initorcl1.ora
SPFILE='+DATA/ORCL/PARAMETERFILE/spfile.264.874545139'
[oracle@node1 trace]$
[oracle@node1 trace]$ cat /data01/app/oracle/product/11.2.0.4/db_1/dbs/initorcl2.ora
SPFILE='+DATA/ORCL/PARAMETERFILE/spfile.264.874545139'

Step5 : Startup instance using SPFILE :

SQL>  startup;
ORACLE instance started.

Total System Global Area  839282688 bytes
Fixed Size    2257880 bytes
Variable Size  608177192 bytes
Database Buffers  226492416 bytes
Redo Buffers    2355200 bytes
Database mounted.
Database opened.


SQL> show parameter spfile ;

NAME     TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile     string +DATA/orcl/parameterfile/spfile.264.874545139
SQL>

Step 6: Add logfile thread for orcl2 and enable the thread:

SQL> ALTER DATABASE ADD LOGFILE THREAD 2 group 5 size 50m ;

Database altered.


SQL> ALTER DATABASE ADD LOGFILE THREAD 2 group  6 size 50m;

Database altered.

SQL> alter database enable public thread 2;

Database altered.

Step 7: Add database to cluster using srvctl :

oracle@node1 trace]$ which srvctl
/data01/app/oracle/product/11.2.0.4/db_1/bin/srvctl


[oracle@node1 trace]$ srvctl add database -d orcl -n node1 -o /data01/app/oracle/product/11.2.0.4/db_1/ -p +DATA/orcl/parameterfile/spfile.264.874545139

[oracle@node1 trace]$ srvctl config database -d orcl
Database unique name: orcl
Database name: node1
Oracle home: /data01/app/oracle/product/11.2.0.4/db_1/
Oracle user: oracle
Spfile: +DATA/orcl/parameterfile/spfile.264.874545139
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: orcl
Database instances:
Disk Groups:
Mount point paths:
Services:
Type: RAC
Database is administrator managed
[oracle@node1 trace]$

Step8 : Add instance orcl1 and orcl2 for database orcl :

[oracle@node1 trace]$ srvctl add instance -d orcl -i orcl1 -n node1
[oracle@node1 trace]$ srvctl add instance -d orcl -i orcl2 -n node2

step 9 : Check the database configuration and try to start orcl1 & orcl2 using srvctl :

[oracle@node1 trace]$ srvctl config database -d orcl
Database unique name: orcl
Database name: node1
Oracle home: /data01/app/oracle/product/11.2.0.4/db_1/
Oracle user: oracle
Spfile: +DATA/orcl/parameterfile/spfile.264.874545139
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: orcl
Database instances: orcl1,orcl2
Disk Groups:
Mount point paths:
Services:
Type: RAC
Database is administrator managed

Step 9 : You can start both instance one by one using srvctl and fix any issue if there :

[oracle@node1 trace]$ srvctl start instance -d orcl -i orcl2
[oracle@node1 trace]$ srvctl start instance -d orcl -i orcl2

Step 10: Stop both instance and start using srvctl :

[oracle@node1 trace]$ srvctl stop database  -d orcl
[oracle@node1 trace]$ srvctl start database  -d orcl

[oracle@node1 trace]$ srvctl status database  -d orcl
Instance orcl1 is running on node node1
Instance orcl2 is running on node node2






1 comment:

  1. Jadwal Cockfight SV388 2 Maret 2019 di Situs Judi Sabung Ayam Online Melalui Agen Resmi Taruhan Sabung Ayam Live Asli Thailand.

    Judi Sabung Ayam - Sabtu, Aceh 2 Maret 2019 – Kami Selaku Agen Sabung Ayam 2018 Akan Memberikan Informasi Mengenai Jadwal Cockfight SV388 2 Maret 2019.

    Untuk Info Lebih Lanjut Bisa Hub kami Di :
    wechat : bolavita
    line : cs_bolavita
    whatsapp : +628122222995
    BBM: BOLAVITA

    ReplyDelete