[Oracle 12c]How to remove and add databases from Oracle cluster

Owner:oracle (Oracle software owner)
Database: techdb
Instances: techdb1, techdb2
Servers/Node: basket-techdb01, basket-techdb02

To remove and later add the cluster Oracle database, follow these steps:

It is important to know the previous configuration for a possible backup:


srvctl config database -d <database_name|

[oracle@basket-techdb01 bin]$ srvctl config database -d techdb
Database unique name: techdb
Database name: techdb
Oracle home: /u01/app/oracle/product/12.1.0/dbhome_1
Oracle user: oracle
Spfile: +DATA/techdb/PARAMETERFILE/spfile.307.998131789
Password file: +DATA/techdb/PASSWORD/pwdtechdb.295.998131215
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools:
Disk Groups: DATA,RECO
Mount point paths:
Services:
Type: RAC
Start concurrency:
Stop concurrency:
OSDBA group: dba
OSOPER group: oper
Database instances: techdb1,techdb2
Configured nodes: basket-techdb01,basket-techdb02
Database is administrator managed

Stop the database:


srvctl stop database -d <database_name>

[oracle@basket-techdb01 bin]$ srvctl stop database -d techdb

Remove the database from cluster configuration:


srvctl remove database -d <database_name>

[oracle@basket-techdb01 bin]$ srvctl remove database -d techdb
Remove the database techdb? (y/[n]) y
[oracle@basket-techdb01 bin]$

Add the database in the cluster configuration: (For all nodes)


srvctl add instance -d <database_name> -i <instance_node1> -n <server_name_node1>
srvctl add instance -d <database_name>  -i <instance_node2> -n <server_name_node2>

[oracle@basket-techdb01 bin]$ srvctl add instance -d techdb -i techdb1 -n basket-techdb01
[oracle@basket-techdb01 bin]$ srvctl add instance -d techdb -i techdb2 -n basket-techdb02

Start the database:


srvctl start database -d <database_name> 

[oracle@basket-techdb01 bin]$ srvctl start database -d techdb

Check the configuration again :


srvctl config database -d <database_name> 

[oracle@basket-techdb01 bin]$ srvctl config database -d techdb
Database unique name: techdb
Database name:
Oracle home: /u01/app/oracle/product/12.1.0/dbhome_1
Oracle user: oracle
Spfile:
Password file:
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools:
Disk Groups: DATA,RECO
Mount point paths:
Services:
Type: RAC
Start concurrency:
Stop concurrency:
OSDBA group: dba
OSOPER group: oper
Database instances: techdb1,techdb2
Configured nodes: basket-techdb01,basket-techdb02
Database is administrator managed

Check the status of the database :


srvctl status database -d  <database_name> 

[oracle@basket-techdb01 bin]$ srvctl status database -d techdb
Instance techdb1 is running on node basket-techdb01
Instance techdb2 is running on node basket-techdb01
[oracle@basket-techdb01 bin]$

Related posts

Leave a Comment