dd and the OCR with ocrconfig:
rac-server1$ su - rac-server1# cd $ORA_CRS_HOME/bin rac-server1# ./crsctl query css votedisk rac-server1# mkdir -p /home/oracle/backup rac-server1# chown oracle:dba /home/oracle/backup rac-server1# dd if=/dev/sdb5 \ of=/home/oracle/backup/votedisk.bak \ bs=4k rac-server1# ./ocrconfig -manualbackup rac-server1# cp /u01/app/crs/cdata/Xluster/backup_20080707_225600.ocr \ /home/oracle/backup/.
srvctl modify service:
rac-server1$ # The command below lists the services rac-server1$ srvctl config service -d ORCL rac-server1$ # The command below modify the OLTP service rac-server1$ srvctl modify service -d ORCL \ -s OLTP -n \ -i "ORCL1,ORCL2,ORCL3,ORCL4"
oratab, background_dump_dest---won't be deleted. Run the command below from any of the servers:
rac-server1$ . oraenv ORCL rac-server1$ dbca -silent -deleteInstance \ -gdbName ORCL \ -instanceName ORCL5 \ -sysDBAPassword xxxYou need to use the
SYS password or at least to know the one from a SYSDBA user.
init.ora file (*). To proceed, execute the commands below:
rac-server1$ srvctl stop asm -n rac-server5 rac-server1$ srvctl remove asm -n rac-server5 rac-server1$ ssh rac-server5 rac-server5$ rm $ORACLE_HOME/dbs/init+ASM5.ora
srvctl instead of crs_unregister and thus use a supported way to remove a listener from a configuration when the node is not available anymore. To proceed run:
rac-server1$ srvctl stop listener -n rac-server5 rac-server1$ srvctl remove listener -n rac-server5Once this is done, update all the network files from the remaining nodes and from the node you are removing (*), and remove all references to that node.
rac-server1, rac-server2, rac-server3, and rac-server4 will still be part of the clustered installation. To update the inventories of those nodes, run:
rac-server1$ export ORACLE_HOME=/u01/app/oracle/product/11.1.0/db_1
rac-server1$ cd $ORACLE_HOME/oui/bin
rac-server1$ ./runInstaller -silent -updateNodeList \
ORACLE_HOME=$ORACLE_HOME \
"CLUSTER_NODES={rac-server1,rac-server2,rac-server3,rac-server4}"
Once you've updated the inventory, Oracle Universal Installer will never again prompt you for rac-server5 when used from any of those four nodes.
detachHome or deinstall. To change the inventory on the node to be removed, connect to it and run:
rac-server5$ export ORACLE_HOME=/u01/app/oracle/product/11.1.0/db_1 rac-server5$ cd $ORACLE_HOME/oui/bin rac-server5$ ./runInstaller -silent -updateNodeList \ ORACLE_HOME=$ORACLE_HOME \ CLUSTER_NODES="" -localOnce the inventory updated, all the runInstaller command you'll run will touch only the local
ORACLE_HOME (assuming it is not shared). Then, as described in the documentation, you can remove the ORACLE_HOME you want and withdraw it from the cluster:
rac-server5$ cat /etc/oraInst.loc
rac-server5$ cd /u01/app/oraInventory/ContentsXML
rac-server5$ grep NAME inventory.xml
rac-server5$ export ORACLE_HOME=/u01/app/oracle/product/11.1.0/db_1
rac-server5$ cd $ORACLE_HOME/oui/bin
rac-server5$ ./runInstaller -silent -deinstall -removeallfiles \
"REMOVE_HOMES={/u01/app/oracle/product/11.1.0/db_1}"
You can also detach the ORACLE_HOME from the inventory with the -detachHome syntax as below:
rac-server5$ cat /etc/oraInst.loc rac-server5$ cd /u01/app/oraInventory/ContentsXML rac-server5$ grep NAME inventory.xml rac-server5$ export ORACLE_HOME=/u01/app/oracle/product/11.1.0/db_1 rac-server5$ cd $ORACLE_HOME/oui/bin rac-server5$ ./runInstaller -silent -detachHome \ ORACLE_HOME="/u01/app/oracle/product/11.1.0/db_1" \ ORACLE_HOME_NAME="OraDB111Home1"This second approach allow you to keep the
ORACLE_HOME and delete its content only if or when you want:
rac-server5$ rm -rf /u01/app/oracle/product/11.1.0/db_1If that's the last database software installed on the server, you can delete the
oratab file too:
rac-server5# rm /etc/oratab
rac-server1$ cd $ORA_CRS_HOME/bin rac-server1$ ./ocrdump /home/oracle/backup/ocr.dmp rac-server1$ grep -A1 "DATABASE.ONS_HOSTS.rac-server5.PORT" \ /home/oracle/backup/ocr.dmp
Note: If you've installed the 11.1.0.6 clusterware without adding the ONS configuration, the OCR may not store the remote port. If that's the case, just skip the next step.Then, you can remove the server and its port from the ONS remote configuration:
rac-server1$ cd $ORA_CRS_HOME/bin rac-server1$ ./racgons remove_config rac-server5:6250
srvctl remove nodeapps command:
rac-server1$ srvctl stop nodeapps -n rac-server5 rac-server1$ su - rac-server1# ./srvctl remove nodeapps -n rac-server5You can check that the nodeapps have been removed by querying its status with srvctl, or by checking the resources named
ora.rac-server5 as below:
rac-server1$ cd $ORA_CRS_HOME/bin rac-server1$ ./crs_stat |grep "ora.rac-server5"
CRS=TRUE:
rac-server1$ export ORA_CRS_HOME=/u01/app/crs
rac-server1$ cd $ORA_CRS_HOME/oui/bin
rac-server1$ ./runInstaller -silent -updateNodeList \
ORACLE_HOME=$ORA_CRS_HOME \
"CLUSTER_NODES={rac-server1,rac-server2,rac-server3,rac-server4}" \
CRS=TRUE
Once you've updated the inventory, Oracle Universal Install will never again prompt you for rac-server5 when used from any of those four nodes.
rac-server5$ su - rac-server5# cd /u01/app/crs/bin rac-server5# ./crsctl stop crs rac-server5# ./crsctl disable crsThen, update the inventory as below:
rac-server5$ export ORA_CRS_HOME=/u01/app/crs rac-server5$ cd $ORA_CRS_HOME/oui/bin rac-server5$ ./runInstaller -silent -updateNodeList \ ORACLE_HOME=$ORA_CRS_HOME \ CLUSTER_NODES="" \ CRS=TRUE \ -localFinally, run the Universal Installer with the
deinstall and CRS=TRUE directives as below:
rac-server5$ cat /etc/oraInst.loc
rac-server5$ cd /u01/app/oraInventory/ContentsXML
rac-server5$ grep NAME inventory.xml
rac-server5$ export ORA_CRS_HOME=/u01/app/crs
rac-server5$ cd $ORA_CRS_HOME/oui/bin
rac-server5$ ./runInstaller -silent -deinstall -removeallfiles \
"REMOVE_HOMES={/u01/app/crs}" \
CRS=TRUE
-removeallfiles didn't do its job..profile file.oraInv.loc file and the inventory.inittab with the one backed up from before the clusterware install named inittab.no_crs./var/tmp/.oracle directory./etc/init.d/init* and /etc/rc?.d/*init.crs files with Oracle or Redhat Enterprise Linux.ocr.loc files, i.e., the /etc/oracle directory with Oracle or Redhat Enterprise Linux/etc/fstab for NFS, udev for ASM, or the raw devices)olsnodes, you'll see the server is always registered in the OCR:
rac-server1$ cd /u01/app/crs/bin rac-server1$ ./olsnodes -n -i rac-server1 1 rac-server1-priv rac-server1-vip rac-server2 2 rac-server2-priv rac-server2-vip rac-server3 3 rac-server3-priv rac-server3-vip rac-server4 4 rac-server4-priv rac-server4-vip rac-server5 5 rac-server5-privTo remove that server from the OCR, connect as
root on any of the remaining nodes and use its name and number with the rootdeletenode.sh script as below:
rac-server1$ su - rac-server1# cd /u01/app/crs/install rac-server1# ./rootdeletenode.sh rac-server5,5 rac-server1# exit rac-server1$ cd /u01/app/crs/bin rac-server1$ olsnodes -n -i
This 9 th post is the last one about the fundamentals of the 10g and 11g database and silent syntaxes, though there are many more syntaxes you may want to look at. The 10 th and last post will present some of the additional syntaxes. But you'll have to wait again! (*) If you cannot access the server you are removing, don't run this step
Ready to optimize your Oracle Database for the future?