Oracle RAC删除一个节点_3节点的数据库

教程发布:风哥 教程分类:ITPUX技术网 更新日期:2022-02-12 浏览学习:1489

Oracle RAC删除一个节点_3节点的数据库

1、主机名规划:
#Public Network - (eth0)
192.168.110.11 rac1
192.168.110.12 rac2
#Private Interconnect - (eth1)
10.10.10.11 rac1priv
10.10.10.12 rac2priv
#Public Virtual IP (VIP) addresses - (eth0)
192.168.110.21 rac1vip
192.168.110.22 rac2vip

2、删除数据库实例—rac3主机的racdb3
To start the database instance removal process, run the following from linux1:
dbca——instance management——delete instance
查看状态如下:
[oracle@rac1 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application ONLINE ONLINE rac2
ora.rac2.gsd application ONLINE ONLINE rac2
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip application ONLINE ONLINE rac2
ora....SM3.asm application ONLINE ONLINE rac3
ora....C3.lsnr application ONLINE ONLINE rac3
ora.rac3.gsd application ONLINE ONLINE rac3
ora.rac3.ons application ONLINE ONLINE rac3
ora.rac3.vip application ONLINE ONLINE rac3
ora.racdb.db application ONLINE ONLINE rac2
ora....b1.inst application ONLINE ONLINE rac1
ora....b2.inst application ONLINE ONLINE rac2
ora....db_s.cs application ONLINE ONLINE rac1
ora....db1.srv application ONLINE ONLINE rac1
ora....db2.srv application ONLINE ONLINE rac2

3、删除ASM实例—rac3主机的+ASM3
[oracle@rac1 ~]$ srvctl stop asm -n rac3
[oracle@rac1 ~]$ srvctl remove asm -n rac3
[oracle@rac1 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application ONLINE ONLINE rac2
ora.rac2.gsd application ONLINE ONLINE rac2
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip application ONLINE ONLINE rac2
ora....C3.lsnr application ONLINE ONLINE rac3
ora.rac3.gsd application ONLINE ONLINE rac3
ora.rac3.ons application ONLINE ONLINE rac3
ora.rac3.vip application ONLINE ONLINE rac3
ora.racdb.db application ONLINE ONLINE rac2
ora....b1.inst application ONLINE ONLINE rac1
ora....b2.inst application ONLINE ONLINE rac2
ora....db_s.cs application ONLINE ONLINE rac1
ora....db1.srv application ONLINE ONLINE rac1
ora....db2.srv application ONLINE ONLINE rac2
Remove ASM Directories from the Node to be Deleted
删除asm一些目录
[oracle@linux3 ~]$ cd $ORACLE_BASE/admin
[oracle@linux3 ~]$ rm -rf +ASM
[oracle@linux3 ~]$ cd $ORACLE_HOME/dbs
[oracle@linux3 ~]$ rm -f *ASM*
Remove ASMLib from the Node to be Deleted
[root@linux3 ~]# /etc/init.d/oracleasm stop
Dropping Oracle ASMLib disks: [ OK ]
Shutting down the Oracle ASMLib driver: [ OK ]
[root@linux3 ~]# rpm -qa | grep oracleasm
oracleasm-2.6.18-128.el5-2.0.5-1.el5
oracleasmlib-2.0.4-1.el5
oracleasm-support-2.1.3-1.el5
[root@linux3 ~]# rpm -ev oracleasm-2.6.18-128.el5-2.0.5-1.el5 oracleasmlib-2.0.4-1.el5 oracleasm-support-2.1.3-1.el5
warning: /etc/sysconfig/oracleasm saved as /etc/sysconfig/oracleasm.rpmsave
[root@linux3 ~]# rm -f /etc/sysconfig/oracleasm.rpmsave
[root@linux3 ~]# rm -f /etc/sysconfig/oracleasm-_dev_oracleasm
[root@linux3 ~]# rm -f /etc/rc.d/init.d/oracleasm
[root@linux3 ~]# rm -f /etc/rc0.d/*oracleasm*
[root@linux3 ~]# rm -f /etc/rc1.d/*oracleasm*
[root@linux3 ~]# rm -f /etc/rc2.d/*oracleasm*
[root@linux3 ~]# rm -f /etc/rc3.d/*oracleasm*
[root@linux3 ~]# rm -f /etc/rc4.d/*oracleasm*
[root@linux3 ~]# rm -f /etc/rc5.d/*oracleasm*
[root@linux3 ~]# rm -f /etc/rc6.d/*oracleasm

4、删除监听listener—rac3主机的listener_RAC3
Remove the Listener From the Node to be Deleted
netca
oracle@linux3 ~]$ ps -ef | grep lsnr | grep -v 'grep' | grep -v 'ocfs' | awk '{print $9}'

5、删除数据库软件
Remove the Oracle Database Software From the Node to be Deleted
From the node to be deleted (linux3),
cd $ORACLE_HOME/oui/bin
oracle@linux3 ~]$ DISPLAY=:0.0; export DISPLAY
[oracle@linux3 ~]$ cd $ORACLE_HOME/oui/bin
[oracle@linux3 bin]$ ./runInstaller -updateNodeList ORACLE_HOME=$ORACLE_HOME CLUSTER_NODES="" -local
[oracle@rac3 bin]$ ./runInstaller -updateNodeList ORACLE_HOME=$ORACLE_HOME CLUSTER_NODES="" -local
Starting Oracle Universal Installer...
No pre-requisite checks found in oraparam.ini, no system pre-requisite checks will be executed.
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /oracle/app/oraInventory
'UpdateNodeList' was successful.

[oracle@linux3 ~]$ cd $ORACLE_HOME/oui/bin
[oracle@linux3 bin]$ ./runInstaller   
(选择de-install)
再到第一台机上
./runInstaller -updateNodeList ORACLE_HOME=$ORACLE_HOME "CLUSTER_NODES={rac1,rac2}"

Starting Oracle Universal Installer...
No pre-requisite checks found in oraparam.ini, no system pre-requisite checks will be executed.
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /oracle/app/oraInventory
'UpdateNodeList' was successful.

6、删除这个节点从crs中
Remove the Node to be Deleted from Oracle Clusterware
[oracle@rac3 bin]$ $ORA_CRS_HOME/bin/racgons remove_config rac3:6200
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
racgons: Existing key value on rac3 = 6200.
racgons: rac3:6200 removed from OCR.
[oracle@rac3 dbs]$ grep '^remoteport' $ORA_CRS_HOME/opmn/conf/ons.config
remoteport=6200
[oracle@rac3 dbs]$ $ORA_CRS_HOME/bin/oifcfg delif -node rac3
PROC-4: The cluster registry key to be operated on does not exist.
PRIF-11: cluster registry error
Disable Oracle Clusterware Applications
[root@rac3 install]# ./rootdelete.sh local nosharedvar nosharedhome
CRS-0210: Could not find resource 'ora.rac3.LISTENER_RAC3.lsnr'.
Shutting down Oracle Cluster Ready Services (CRS):
Jun 06 22:58:39.893 | INF | daemon shutting down
Stopping resources. This could take several minutes.
Successfully stopped CRS resources.
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
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.
Removing script. for Oracle Cluster Ready services
Updating ocr file for downgrade
Cleaning up SCR settings in '/etc/oracle/scls_scr'

Delete Node from Cluster and Update OCR
[oracle@rac1 ~]$ $ORA_CRS_HOME/bin/olsnodes -n
rac1 1
rac2 2
rac3 3
[root@rac1 install]# ./rootdeletenode.sh rac3,3
CRS-0210: Could not find resource 'ora.rac3.LISTENER_RAC3.lsnr'.
CRS-0210: Could not find resource 'ora.rac3.ons'.
CRS-0210: Could not find resource 'ora.rac3.vip'.
CRS-0210: Could not find resource 'ora.rac3.gsd'.
CRS-0210: Could not find resource ora.rac3.vip.
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.noderac3 marked for deletion is not there. Ignoring.
Successfully deleted 5 keys from OCR.
Node deletion operation successful.
'rac3,3' deleted successfully
[oracle@rac2 ~]$ $ORA_CRS_HOME/bin/olsnodes -n
rac1 1
rac2 2

Update Node List for Oracle Clusterware Software - (Remove linux3)

[oracle@rac3 bin]$ cd $ORA_CRS_HOME/oui/bin
[oracle@rac3 bin]$ ./runInstaller -updateNodeList ORACLE_HOME=$ORA_CRS_HOME CLUSTER_NODES="" -local CRS=true
Starting Oracle Universal Installer...
No pre-requisite checks found in oraparam.ini, no system pre-requisite checks will be executed.
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /oracle/app/oraInventory
'UpdateNodeList' was successful.

De-install Oracle Clusterware Software
cd $ORA_CRS_HOME/oui/bin
./runInstaller

7、Update Node List for Remaining Nodes in the Cluster
[oracle@linux1 ~]$ cd $ORA_CRS_HOME/oui/bin
[oracle@linux1 bin]$ ./runInstaller -updateNodeList ORACLE_HOME=$ORA_CRS_HOME "CLUSTER_NODES={rac1,rac2}" CRS=true
Starting Oracle Universal Installer...

8、Verify Node to be Deleted is no Longer a Member of the Cluster
[oracle@rac1 bin]$ srvctl status nodeapps -n rac3
PRKC-1056 : Failed to get the hostname for node rac3
PRKH-1001 : HASContext Internal Error
[OCR Error(Native: getHostName:[21])]
[oracle@rac1 bin]$ $ORA_CRS_HOME/bin/crs_stat | grep -i rac3
[oracle@rac1 bin]$ $ORA_CRS_HOME/bin/olsnodes -n
rac1 1
rac2 2
[oracle@rac1 bin]$
9、Remove/Rename any Remaining Oracle Files from Node to be Deleted
From the node to be deleted (linux3), remove/rename any remaining Oracle files while logged in as the root user account:
[root@linux3 ~]# mv -f /etc/inittab.no_crs /etc/inittab
[root@linux3 ~]# rm -f /etc/inittab.orig
[root@linux3 ~]# rm -f /etc/inittab.crs
[root@linux3 ~]# rm -rf /etc/oracle
[root@linux3 ~]# rm -f /etc/oratab
[root@linux3 ~]# rm -f /etc/oraInst.loc
[root@linux3 ~]# rm -rf /etc/ORCLcluster
[root@linux3 ~]# rm -rf /u01/app/oracle
[root@linux3 ~]# rm -rf /u01/app/crs
[root@linux3 ~]# rm -f /usr/local/bin/coraenv
[root@linux3 ~]# rm -f /usr/local/bin/dbhome
[root@linux3 ~]# rm -f /usr/local/bin/oraenv
Finally, remove the Oracle user account and all associated UNIX groups from linux3:
[root@linux3 ~]# userdel -r oracle
[root@linux3 ~]# groupdel oinstall
[root@linux3 ~]# groupdel dba
[root@linux3 ~]# groupdel oper

本文标签:
网站声明:本文由风哥整理发布,转载请保留此段声明,本站所有内容将不对其使用后果做任何承诺,请读者谨慎使用!
【上一篇】
【下一篇】