Wednesday, 10 June 2015

Add/Register new RAC database to Cluster resources

Recently we created test database and below were the steps followed to add this new database to cluster resources.

[oracle@ ~]$ . oraenv
ORACLE_SID = [+ASM1] ? test1
The Oracle base has been changed from /u01/app/grid to /u01/app/oracle

-- Checking the location of PFILE or SPFILE

[oracle@ ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Thu Jun 11 01:40:02 2015

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 1119043584 bytes
Fixed Size                  2227624 bytes
Variable Size             838861400 bytes
Database Buffers          268435456 bytes
Redo Buffers                9519104 bytes
Database mounted.
Database opened.
SQL> show parameter spfile

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      +DATADG/test/spfiletest1.ora

-- Checking if TEST DB is configured already
[oracle@~]$ srvctl config database -d test
PRCD-1120 : The resource for database test could not be found.
PRCR-1001 : Resource ora.test.db does not exist

--Adding TEST DB with ORACLE_HOME (-o) and SPFILE (-p_ location
[oracle@~]$ srvctl add database -d test -o /u01/app/oracle/product/11.2.0.3/dbhome_1 -p +DATADG/test/spfiletest1.ora
[oracle@~]$ srvctl config database -d test
Database unique name: test
Database name:
Oracle home: /u01/app/oracle/product/11.2.0.3/dbhome_1
Oracle user: oracle
Spfile: +DATADG/test/spfiletest1.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: test
Database instances:   <<< Here no instances  are configured yet >>>>
Disk Groups:
Mount point paths:
Services:
Type: RAC
Database is administrator managed

[oracle@~]$ srvctl status database -d test
Database is not running.

--Below error comes as we have not configured any instances
[oracle@~]$ srvctl start database -d test
PRKO-3119 : Database test cannot be started since it has no configured instances. 

--Configure instances now
[oracle@~]$ srvctl add instance -d test -i test1 -n node1
[oracle@~]$ srvctl add instance -d test -i test2 -n node2

[oracle@~]$ srvctl status database -d test
Instance test1 is not running on node node1
Instance test2 is not running on node node2

[oracle@~]$ srvctl config database -d test
Database unique name: test
Database name:
Oracle home: /u01/app/oracle/product/11.2.0.3/dbhome_1
Oracle user: oracle
Spfile: +DATADG/test/spfiletest1.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: test
Database instances: test1,test2  <<Compare with previous values>>
Disk Groups:
Mount point paths:
Services:
Type: RAC
Database is administrator managed

[oracle@~]$ srvctl start database -d test

[oracle@~]$ srvctl status database -d test
Instance test1 is running on node node1
Instance test2 is running on node node2

ora.test.db
      1        ONLINE  ONLINE       node1                   Open
      2        ONLINE  ONLINE       node2                   Open



2 comments: