You are on page 1of 27

DB EXPERTS Basavraju 9866465379

Deleting Cluster Node from Oracle Real Application Cluster


Environment

Assume that we have a two node RAC

First Node Name = node1


Second Node Name = node2
Database Name = proddb
Instance 1 = proddb1
Instance 2 = proddb2

Check the database status by executing following command

[oracle@node1 ~]$ srvctl status database -d proddb

Instance proddb1 is running on node node1


Instance proddb2 is running on node node2
[oracle@node1 ~]$ srvctl config database -d proddb
node1 proddb1 /orasoft/ora10g
node2 proddb2 /orasoft/ora10g
[oracle@node1 ~]$
Here assume that we want to delete second node (node2) from RAC
Step 1: Delete Instance from Oracle Real Application Cluster Database
Which is running on second node
Note:
Before deleting an instance from an Oracle RAC database, use either
SRVCTL or Oracle Enterprise Manager to do the following:
● If you have services configured, relocate the services
● Modify the services so that each service can run on one of the
remaining instances
● Set "not used" for each service running on the instance that is to be
deleted

DB EXPERTS Basavraju 1
DB EXPERTS Basavraju 9866465379

Using DBCA in Interactive Mode to Delete Instance from the Node to


be deleted

To delete an instance using DBCA in interactive mode, perform the


following steps:
1. Verify there is a current backup of the OCR.
Run the ocrconfig -showbackup command to ensure there
is a valid backup.
2. Start DBCA.
Start DBCA on a node other than the node that hosts the instance
that you want to delete. The database and the instance that you plan
to delete should continue to be started and running during this step.

3. On the DBCA Welcome page select Oracle Real Application


Clusters Database, click Next. DBCA displays the Operations page.

DB EXPERTS Basavraju 2
DB EXPERTS Basavraju 9866465379

4. On the DBCA Operations page, select Instance Management and


click Next. DBCA displays the Instance Management page.

DB EXPERTS Basavraju 3
DB EXPERTS Basavraju 9866465379

5. On the DBCA Instance Management page, select the instance to be


deleted, select Delete Instance, and click Next.

DB EXPERTS Basavraju 4
DB EXPERTS Basavraju 9866465379

6. On the List of Cluster Databases page, select the Oracle RAC


database from which to delete the instance, as follows:
1. On the List of Cluster Database Instances page, DBCA
displays the instances that are associated with the Oracle
RAC database that you selected and the status of each
instance. Select the cluster database from which you will
delete the instance.
2. Enter a user name and password for the database user that
has SYSDBA privileges. Click Next.
3. Click OK on the Confirmation dialog to proceed to delete the
instance.

DB EXPERTS Basavraju 5
DB EXPERTS Basavraju 9866465379

DBCA displays a progress dialog showing that DBCA is


deleting the instance. During this operation, DBCA removes
the instance and the instance's Oracle Net configuration.
When DBCA completes this operation, DBCA displays a
dialog asking whether you want to perform another
operation.
Click No and exit DBCA or click Yes to perform another
operation. If you click Yes, then DBCA displays the
Operations page.

DB EXPERTS Basavraju 6
DB EXPERTS Basavraju 9866465379

DB EXPERTS Basavraju 7
DB EXPERTS Basavraju 9866465379

DB EXPERTS Basavraju 8
DB EXPERTS Basavraju 9866465379

7. Verify that the dropped instance's redo thread has been removed by
querying the V$LOG view. If the redo thread is not disabled, then
disable the thread. For example:
SQL> ALTER DATABASE DISABLE THREAD 2;

8. Verify that the instance has been removed from the OCR by issuing
the following commands:
srvctl config database -d database_name
[oracle@node1 ~]$ srvctl config database -d proddb
node1 proddb1 /orasoft/ora10g
[oracle@node1 ~]$
cd CRS_HOME/bin
./crs_stat

[oracle@node1 ~]$ crs_stat -t

Name Type Target State Host

------------------------------------------------------------

ora....SM1.asm application ONLINE ONLINE node1

ora....E1.lsnr application ONLINE ONLINE node1

ora.node1.gsd application ONLINE ONLINE node1

ora.node1.ons application ONLINE ONLINE node1

ora.node1.vip application ONLINE ONLINE node1

ora....SM2.asm application ONLINE ONLINE node2

ora....E2.lsnr application ONLINE ONLINE node2

ora.node2.gsd application ONLINE ONLINE node2

ora.node2.ons application ONLINE ONLINE node2

ora.node2.vip application ONLINE ONLINE node2

ora.proddb.db application ONLINE ONLINE node2

ora....b1.inst application ONLINE ONLINE node1

[oracle@node1 ~]$

DB EXPERTS Basavraju 9
DB EXPERTS Basavraju 9866465379

9. If this node had an ASM instance and the node will no longer be a
part of the cluster, you must remove the ASM instance by issuing
the following commands:
[oracle@node1 ~]$ srvctl config asm -n node1
+ASM1 /orasoft/ora10g
[oracle@node1 ~]$ srvctl config asm -n node2
+ASM2 /orasoft/ora10g
[oracle@node1 ~]$
Stop asm instance on node2

[oracle@node1 ~]$ srvctl stop asm -n node2 -i +ASM2

Remove asm instance from node2

[oracle@node1 ~]$ srvctl remove asm -n node2 -i +ASM2

Verify that asm has been removed

[oracle@node1 ~]$ srvctl config asm -n node2


[oracle@node1 ~]$

10 .If you are deleting more than one node, then repeat these steps to
delete the instances from all the nodes that you are going to delete.

Note : Using DBCA in Silent Mode to Delete Instances from Nodes

You can use DBCA in silent mode to delete a database instance from a
node.
Run the following command, where the variables are the same as those
shown in Table 8-1 for the DBCA command to add an instance. Provide a
node name only if you are deleting an instance from a node other than the
one on where DBCA is running as shown in the following example where
password is the password:
dbca -silent -deleteInstance [-nodeList node] -gdbName gdbname
-instanceName
instname -sysDBAUserName sysdba -sysDBAPassword password

At this point, you have accomplished the following:


● Deregistered the selected instance from its associated Oracle Net
Services listeners
● Deleted the selected database instance from the instance's
configured node

DB EXPERTS Basavraju 10
DB EXPERTS Basavraju 9866465379

● Removed the Oracle Net configuration


● Deleted the Oracle Flexible Architecture directory structure from
the instance's configured node.

Remove the listener from the node.


If this is the Oracle home from which the node-specific listener
named LISTENER_nodename runs, then use NETCA to remove
this listener. If necessary, re-create this listener in another home.
Invoke NETCA and proceed as follows:
● Choose Cluster Configuration.
● Select only the node you are removing and click Next.
● Choose Listener Configuration and click Next.
● Choose Delete and delete any listeners configured on the
node you are removing.

DB EXPERTS Basavraju 11
DB EXPERTS Basavraju 9866465379

DB EXPERTS Basavraju 12
DB EXPERTS Basavraju 9866465379

DB EXPERTS Basavraju 13
DB EXPERTS Basavraju 9866465379

Now deinstall oracle software on second node (node2)

To delete a node that has Oracle Configuration Manager (OCM)


configured, run the following commands:
$ORACLE_HOME/ccr/bin/deployPackages -d
$ORACLE_HOME/ccr/inventory/core.jar
rm –rf $ORACLE_HOME/ccr

Depending on whether you have a shared or nonshared Oracle


home, complete one of the following two procedures:
1. For a shared home:
To delete a node from a cluster:
./runInstaller -detachHome -local
ORACLE_HOME=Oracle_home

2. For a nonshared home:


To delete a node from a cluster:
./runInstaller -updateNodeList
ORACLE_HOME=Oracle_home CLUSTER_NODES="" –
local

DB EXPERTS Basavraju 14
DB EXPERTS Basavraju 9866465379

Check the Inventory

[oracle@node2 ~]$ /orasoft/ora10g/OPatch/opatch


lsinventory

Invoking OPatch 10.2.0.1.0

Oracle interim Patch Installer version 10.2.0.1.0

Copyright (c) 2005, Oracle Corporation. All rights


reserved..

Oracle Home : /orasoft/ora10g

Central Inventory : /orasoft/oraInventory

from : /orasoft/ora10g/oraInst.loc

OPatch version : 10.2.0.1.0

OUI version : 10.2.0.1.0

OUI location : /orasoft/ora10g/oui

Log file location :


/orasoft/ora10g/cfgtoollogs/opatch/opatch-
2010_Aug_05_09-47-34-IST_Thu.log

Lsinventory Output file location :


/orasoft/ora10g/cfgtoollogs/opatch/lsinv/lsinventory-
2010_Aug_05_09-47-34-IST_Thu.txt

--------------------------------------------------------------------------------

Installed Top-level Products (1):

Oracle Database 10g


10.2.0.1.0

There are 1 products installed in this Oracle Home.

There are no Interim patches installed in this Oracle


Home.

Rac system comprising of multiple nodes

DB EXPERTS Basavraju 15
DB EXPERTS Basavraju 9866465379

Local node = node2

Remote node = node1

--------------------------------------------------------------------------------

OPatch succeeded.

Now update the inventory on second node

[oracle@node2 ~]$

[oracle@node2 ~]$ cd /orasoft/ora10g/oui/bin/

[oracle@node2 bin]$ ./runInstaller -silent -updateNodeList


ORACLE_HOME=/orasoft/ora10g CLUSTER_NODES="" -local

Starting Oracle Universal Installer...

No pre-requisite checks found in oraparam.ini, no system pre-requisite


checks will be executed.

'UpdateNodeList' was successful.

[oracle@node2 bin]$

[oracle@node2 bin]$ /orasoft/ora10g/OPatch/opatch lsinventory Invoking


OPatch 10.2.0.1.0

Oracle interim Patch Installer version 10.2.0.1.0

Copyright (c) 2005, Oracle Corporation. All rights reserved..

Oracle Home : /orasoft/ora10g

Central Inventory : /orasoft/oraInventory

from : /orasoft/ora10g/oraInst.loc

OPatch version : 10.2.0.1.0

OUI version : 10.2.0.1.0

OUI location : /orasoft/ora10g/oui

Log file location : /orasoft/ora10g/cfgtoollogs/opatch/opatch-

DB EXPERTS Basavraju 16
DB EXPERTS Basavraju 9866465379

2010_Aug_05_09-49-58-IST_Thu.log

Lsinventory Output file location :


/orasoft/ora10g/cfgtoollogs/opatch/lsinv/lsinventory-2010_Aug_05_09-
49-58-IST_Thu.txt

--------------------------------------------------------------------------------

Installed Top-level Products (1):

Oracle Database 10g 10.2.0.1.0

There are 1 products installed in this Oracle Home.

There are no Interim patches installed in this Oracle Home.

--------------------------------------------------------------------------------

OPatch succeeded.

Now deinstall oracle software on node2

To deinstall the Oracle home from the node you are deleting, run the
following command from the Oracle_home/oui/bin directory:
./runInstaller -deinstall -silent
"REMOVE_HOMES={Oracle_home}" -local

[oracle@node2 bin]$ ./runInstaller -silent -deinstall


REMOVE_HOMES={"/orasoft/ora10g"} -local

Starting Oracle Universal Installer...

No pre-requisite checks found in oraparam.ini, no system pre-requisite


checks will be executed.

Preparing to launch Oracle Universal Installer from /tmp/OraInstall2010-


08-05_09-51-31AM. Please wait ...[oracle@node2 bin]$ Oracle
Universal Installer, Version 10.2.0.1.0 Production

Copyright (C) 1999, 2005, Oracle. All rights reserved.

Starting deinstall

Deinstall in progress (Thu Aug 05 09:51:35 IST 2010)

Configuration assistant "Oracle Database Configuration Assistant"

DB EXPERTS Basavraju 17
DB EXPERTS Basavraju 9866465379

succeeded

Configuration assistant "Oracle Net Configuration Assistant - Deinstall


Script" failed

........................................................................................................... 100%
Done.

Deinstall successful

End of install phases.(Thu Aug 05 09:51:59 IST 2010)

End of deinstallations

Please check '/orasoft/oraInventory/logs/silentInstall2010-08-05_09-51-


31AM.log' for more details.

[oracle@node2 bin]$

Ensure that the database resource is not running on a node you are
deleting. Run the crs_relocate command from the CRS_HOME/bin
directory to perform this as shown in the example:
crs_relocate ora.db_name.db

[oracle@node1 ~]$ crs_stat -t

Name Type Target State Host

------------------------------------------------------------

ora....SM1.asm application ONLINE ONLINE node1

ora....E1.lsnr application ONLINE ONLINE node1

ora.node1.gsd application ONLINE ONLINE node1

ora.node1.ons application ONLINE ONLINE node1

ora.node1.vip application ONLINE ONLINE node1

ora.node2.gsd application OFFLINE ONLINE node2

ora.node2.ons application OFFLINE ONLINE node2

ora.node2.vip application OFFLINE ONLINE node2

DB EXPERTS Basavraju 18
DB EXPERTS Basavraju 9866465379

ora.proddb.db application ONLINE ONLINE node2

ora....b1.inst application ONLINE ONLINE node1

[oracle@node1 ~]$ crs_relocate ora.proddb.db

Attempting to stop `ora.proddb.db` on member `node2`

Stop of `ora.proddb.db` on member `node2` succeeded.

Attempting to start `ora.proddb.db` on member `node1`

Start of `ora.proddb.db` on member `node1` succeeded.

[oracle@node1 ~]$

[oracle@node1 ~]$ crs_stat -t

Name Type Target State Host

------------------------------------------------------------

ora....SM1.asm application ONLINE ONLINE node1

ora....E1.lsnr application ONLINE ONLINE node1

ora.node1.gsd application ONLINE ONLINE node1

ora.node1.ons application ONLINE ONLINE node1

ora.node1.vip application ONLINE ONLINE node1

ora.node2.gsd application OFFLINE ONLINE node2

ora.node2.ons application OFFLINE ONLINE node2

ora.node2.vip application OFFLINE ONLINE node2

ora.proddb.db application ONLINE ONLINE node1

ora....b1.inst application ONLINE ONLINE node1

Update the node list on the remaining nodes in the cluster.

[oracle@node1 ~]$ /orasoft/ora10g/OPatch/opatch lsinventory

Invoking OPatch 10.2.0.1.0

DB EXPERTS Basavraju 19
DB EXPERTS Basavraju 9866465379

Oracle interim Patch Installer version 10.2.0.1.0

Copyright (c) 2005, Oracle Corporation. All rights reserved..

Oracle Home : /orasoft/ora10g

Central Inventory : /orasoft/oraInventory

from : /orasoft/ora10g/oraInst.loc

OPatch version : 10.2.0.1.0

OUI version : 10.2.0.1.0

OUI location : /orasoft/ora10g/oui

Log file location : /orasoft/ora10g/cfgtoollogs/opatch/opatch-


2010_Aug_05_09-54-38-EST_Thu.log

Lsinventory Output file location :


/orasoft/ora10g/cfgtoollogs/opatch/lsinv/lsinventory-2010_Aug_05_09-
54-38-EST_Thu.txt

--------------------------------------------------------------------------------

Installed Top-level Products (1):

Oracle Database 10g 10.2.0.1.0

There are 1 products installed in this Oracle Home.

There are no Interim patches installed in this Oracle Home.

Rac system comprising of multiple nodes

Local node = node1

Remote node = node2

--------------------------------------------------------------------------------

OPatch succeeded.

DB EXPERTS Basavraju 20
DB EXPERTS Basavraju 9866465379

[oracle@node1 ~]$

[oracle@node1 bin]$ ./runInstaller -silent -updateNodeList


ORACLE_HOME=/orasoft/ora10g CLUSTER_NODES=node1

Starting Oracle Universal Installer...

No pre-requisite checks found in oraparam.ini, no system pre-requisite


checks will be executed.

'UpdateNodeList' was successful.

Remove the node applications on the node you are deleting.


As the root user, run the following command:

Stop the node applications on the node you are deleting.


run the srvctl stop nodeapps command to stop and remove the
nodeapps on the node you are deleting. For example:
srvctl stop nodeapps -n nodename

[oracle@node1 ~]$ srvctl stop nodeapps -n node2

[oracle@node1 ~]$ crs_stat -t

Name Type Target State Host

------------------------------------------------------------

ora....SM1.asm application ONLINE ONLINE node1

ora....E1.lsnr application ONLINE ONLINE node1

ora.node1.gsd application ONLINE ONLINE node1

ora.node1.ons application ONLINE ONLINE node1

ora.node1.vip application ONLINE ONLINE node1

ora....E2.lsnr application OFFLINE OFFLINE

ora.node2.gsd application OFFLINE OFFLINE

ora.node2.ons application OFFLINE OFFLINE

DB EXPERTS Basavraju 21
DB EXPERTS Basavraju 9866465379

ora.node2.vip application OFFLINE OFFLINE

ora.proddb.db application ONLINE ONLINE node1

ora....b1.inst application ONLINE ONLINE node1

[oracle@node1 ~]$

srvctl remove nodeapps -n nodename

[root@node1 ~]# srvctl remove nodeapps -n node2

Please confirm that you intend to remove the node-level applications on


node node2 (y/[n]) y

[root@node1 ~]#

[root@node1 ~]# crs_stat -t

Name Type Target State Host

------------------------------------------------------------

ora....SM1.asm application ONLINE ONLINE node1

ora....E1.lsnr application ONLINE ONLINE node1

ora.node1.gsd application ONLINE ONLINE node1

ora.node1.ons application ONLINE ONLINE node1

ora.node1.vip application ONLINE ONLINE node1

ora.proddb.db application ONLINE ONLINE node1

ora....b1.inst application ONLINE ONLINE node1

[root@node1 ~]#

Delete Nodes from the Cluster

Once you have deleted the instance, you can begin the process of deleting
the node from the cluster. You accomplish this by running scripts on the
node you want to delete to remove the Oracle Clusterware installation
and you run scripts on the remaining nodes to update the node list.
The following steps assume that the node to be removed (node2 in this

DB EXPERTS Basavraju 22
DB EXPERTS Basavraju 9866465379

discussion) is still functioning.

Stop Oracle CRS on the node you are deleting.


As the root user on the node that you are deleting, run the
rootdelete.sh script in the CRS_home/install/ directory to disable
the Oracle Clusterware applications that are on the node. For
example:
# cd CRS_home/install
# ./rootdelete.sh local nosharedvar nosharedhome

[root@node2 ~]# /cluster/ora10g/bin/crsctl stop crs

Stopping resources.

Successfully stopped CRS resources

Stopping CSSD.

Shutting down CSS daemon.

Shutdown request successfully issued.

[root@node2 ~]#

[root@node2 ~]# cd /cluster/ora10g/install

[root@node2 install]# ./rootdelete.sh local nosharedvar nosharedhome

Shutting down Oracle Cluster Ready Services (CRS):

Stopping resources.

Error while stopping resources. Possible cause: CRSD is down.

Stopping CSSD.

Unable to communicate with the CSS daemon.

Shutdown has begun. The daemons should exit soon.

Checking to see if Oracle CRS stack is down...

Oracle CRS stack is not running.

Oracle CRS stack is down now.

DB EXPERTS Basavraju 23
DB EXPERTS Basavraju 9866465379

Removing script for Oracle Cluster Ready services

Updating ocr file for downgrade

Cleaning up SCR settings in '/etc/oracle/scls_scr'

[root@node2 install]#

[oracle@node2 ~]$ cd /cluster/ora10g/oui/bin/

[oracle@node2 bin]$ ./runInstaller -silent -updateNodeList


ORACLE_HOME=/cluster/ora10g CLUSTER_NODES="" CRS=TRUE

Starting Oracle Universal Installer...

No pre-requisite checks found in oraparam.ini, no system pre-requisite


checks will be executed.

'UpdateNodeList' was successful.

[oracle@node2 bin]$ ./runInstaller -silent -deinstall


REMOVE_HOMES={"/cluster/ora10g"} -local

Starting Oracle Universal Installer...

No pre-requisite checks found in oraparam.ini, no system pre-requisite


checks will be executed.

Preparing to launch Oracle Universal Installer from /tmp/OraInstall2010-


08-05_10-07-03AM. Please wait ...[oracle@node2 bin]$ Oracle
Universal Installer, Version 10.2.0.1.0 Production

Copyright (C) 1999, 2005, Oracle. All rights reserved.

Starting deinstall

Deinstall in progress (Thu Aug 05 10:07:08 IST 2010)

WARNING:The directory: /cluster/ora10g will be deleted after


deinstall.Click on "Yes" to continue.

Click on "No" to perform deinstall without deleting the directory.

Click on "Cancel" to go back to "Inventory Dialog".

............................................................... 100% Done.

DB EXPERTS Basavraju 24
DB EXPERTS Basavraju 9866465379

Deinstall successful

End of install phases.(Thu Aug 05 10:07:18 IST 2010)

End of deinstallations

Please check '/orasoft/oraInventory/logs/silentInstall2010-08-05_10-07-


03AM.log' for more details.

[oracle@node2 bin]$

From the CRS home run the installer with the updateNodeList option on
any remaining nodes in the cluster, and include a comma-delimited list of
nodes that remain in the cluster:
CRS_home/oui/bin/runInstaller -updateNodeList
ORACLE_HOME=CRS_home
CLUSTER_NODES=node1, node3, node4 CRS=TRUE

[oracle@node1 ~]$ cd /cluster/ora10g/oui/bin/

[oracle@node1 bin]$ ./runInstaller -silent -updateNodeList


ORACLE_HOME=/cluster/ora10g CLUSTER_NODES=node1
CRS=TRUE

Starting Oracle Universal Installer...

No pre-requisite checks found in oraparam.ini, no system pre-requisite


checks will be executed.

'UpdateNodeList' was successful.

Delete the node and remove it from the OCR.


As the root user on any node that you are not deleting:
To determine the node number of any node, run the olsnodes -n command
from the CRS_home/bin directory. For example:
[root@node1 ~]# olsnodes -n

node1 1

node2 2

[root@node1 ~]#

[root@node1 install]# ./rootdeletenode.sh node2,2

DB EXPERTS Basavraju 25
DB EXPERTS Basavraju 9866465379

CRS-0210: Could not find resource 'ora.node2.LISTENER_NODE2.lsnr'.

CRS-0210: Could not find resource 'ora.node2.ons'.

CRS nodeapps are deleted successfully …..

clscfg: EXISTING configuration version 3 detected.

clscfg: version 3 is 10G Release 2.

Successfully deleted 14 values from OCR.

Key SYSTEM.css.interfaces.nodenode2 marked for deletion is not there.


Ignoring.

Successfully deleted 5 keys from OCR.

Node deletion operation successful.

'node2,2' deleted successfully

[root@node1 install]# olsnodes -n

node1 1

[root@node1 install]#

[oracle@node1 ~]$ crs_stat -t

Name Type Target State Host

------------------------------------------------------------

ora....SM1.asm application ONLINE ONLINE node1

ora....E1.lsnr application ONLINE ONLINE node1

ora.node1.gsd application ONLINE ONLINE node1

ora.node1.ons application ONLINE ONLINE node1

ora.node1.vip application ONLINE ONLINE node1

ora.proddb.db application ONLINE ONLINE node1

ora....b1.inst application ONLINE ONLINE node1

DB EXPERTS Basavraju 26
DB EXPERTS Basavraju 9866465379

[oracle@node1 ~]$

DB EXPERTS Basavraju 27

You might also like