(只删节点不删集群软件+数据库软件)
linux 6.5 +oracle11g-11.2.0.4-RAC集群
主机名1:rac1
主机名2:rac2
数据库名:racdb
vip:rac-vip
priv:rac-priv
2个节点实例均正常运行,在线删除节点
登陆任一节点,执行
SQL> select thread#,status,instance from v$thread;
THREAD# STATUS
---------- ------
INSTANCE
--------------------------------------------------------------------------------
1 OPEN
rac1
2 OPEN
rac2
说明2个节点,实例名是rac1,rac2
rac1:/u01/app/11.2.0/grid_1/bin@rac1>olsnodes -t –s (用grid用户即可)
rac1 Active Unpinned
rac2 Active Unpinned
[grid@rac1 ~]# cd /u01/app/11.2.0/grid_1/bin/
[grid@rac1 bin]# crsctl unpin css -n rac2
CRS-4667: Node rac2 successfully unpinned.
注意这里需要在任一保留节点上删除rac2实例,也就是必须在rac1上执行
这一步可能会报错,报的错因为过长不大记得,大致是sys用户连接不上rac-vip:1521,请确认连接是否正常和用户名密码正确
通常第一想到的肯定是连接不正常,可以尝试一下是用sys用户通过vip:1521登录,你会发现登录不上去,解决办法:
select * from V$PWFILE_USERS; ---看数据库是否存在密码文件,如果是空的表示密码文件在$ORACLE_HOME/dbs下不存在需要重建密码文件
重建密码命令:orapwd file=orapwracdb1 password=abcd1234 entries=30 ---racdb1是一节点数据库
5、验证rac2实例已被删除
查看活动的实例:
SQL> select thread#,status,instance from v$thread;
THREAD# STATUS
INSTANCE
1 OPEN
rac1
//已经没有rac2
rac2:/home/oracle@rac2>ps -ef|grep ora_
oracle 7550 30915 0 14:17 pts/0 00:00:00 grep ora_
//rac2的oracle进程已经消失
rac1:/home/oracle@rac1>srvctl config database -d rac
Database unique name: rac
Database name: rac
Oracle home: /u01/app/oracle/product/11.2.0/db_1
Oracle user: oracle
Spfile: +DATA/rac/spfilerac.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: rac
Database instances: rac1
Disk Groups: DATA,FRA_ARC
Mount point paths:
Services:
Type: RAC
Database is administrator managed
rac2:/home/oracle@rac2>srvctl config listener -a
Name: LISTENER
Network: 1, Owner: grid
Home:
/u01/app/11.2.0/grid_1 on node(s) rac2,rac1
End points: TCP:1521
rac2:/home/oracle@rac2>srvctl disable listener -l listener -n rac2
rac2:/home/oracle@rac2>srvctl stop listener -l listener -n rac2
rac2:/home/oracle@rac2>lsnrctl status
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 13-MAR-2017 14:22:50
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused
//rac2监听已停止,rac1监听还在
rac2:/home/oracle@rac2>/u01/app/oracle/product/11.2.0/db_1/oui/bin/runInstaller -updateNodeList
ORACLE_HOME=$ORACLE_HOME "CLUSTER_NODES={rac2}" –local
Starting Oracle Universal Installer...
Checking swap space: must be greater than 500 MB. Actual 3502 MB Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /u01/app/oraInventory
'UpdateNodeList' was successful.
rac1:/home/oracle@rac1>srvctl stop nodeapps -n rac2 -f //发现rac2的ons和vip 已经停了
rac1:/home/oracle@rac1>$ORACLE_HOME/oui/bin/runInstaller -updateNodeList
ORACLE_HOME=$ORACLE_HOME "CLUSTER_NODES={rac1 }"
Starting Oracle Universal Installer...
Checking swap space: must be greater than 500 MB. Actual 3194 MB Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /u01/app/oraInventory
'UpdateNodeList' was successful.
[root@rac2 db_1]# /u01/app/11.2.0/grid_1/crs/install/rootcrs.pl -deconfig -force
Using configuration parameter file: /u01/app/11.2.0/grid_1/crs/install/crsconfig_params
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
Error occurred during initialization of VM
java.lang.Error: Properties init: Could not determine current working directory.
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
CRS-2673: Attempting to stop 'ora.registry.acfs' on 'rac2'
CRS-2677: Stop of 'ora.registry.acfs' on 'rac2' succeeded
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
2017-03-13 14:37:29.128:
CLSD:An error was encountered while attempting to open log file "UNKNOWN". Additional diagnostics: (:CLSD00157:)
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'rac2'
CRS-2673: Attempting to stop 'ora.crsd' on 'rac2'
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'rac2'
CRS-2673: Attempting to stop 'ora.DATA.dg' on 'rac2'
CRS-2673: Attempting to stop 'ora.FRA_ARC.dg' on 'rac2'
CRS-2673: Attempting to stop 'ora.OCR_VOTING_NEW.dg' on 'rac2'
CRS-2673: Attempting to stop 'ora.ACFS.dg' on 'rac2'
CRS-2673: Attempting to stop 'ora.oc4j' on 'rac2'
CRS-2677: Stop of 'ora.FRA_ARC.dg' on 'rac2' succeeded
CRS-2677: Stop of 'ora.DATA.dg' on 'rac2' succeeded
CRS-2677: Stop of 'ora.ACFS.dg' on 'rac2' succeeded
CRS-2677: Stop of 'ora.OCR_VOTING_NEW.dg' on 'rac2' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'rac2'
CRS-2677: Stop of 'ora.asm' on 'rac2' succeeded
CRS-2677: Stop of 'ora.oc4j' on 'rac2' succeeded
CRS-2672: Attempting to start 'ora.oc4j' on 'rac2'
CRS-2676: Start of 'ora.oc4j' on 'rac2' succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'rac2' has completed
CRS-2677: Stop of 'ora.crsd' on 'rac2' succeeded
CRS-2673: Attempting to stop 'ora.mdnsd' on 'rac2'
CRS-2673: Attempting to stop 'ora.ctssd' on 'rac2'
CRS-2673: Attempting to stop 'ora.evmd' on 'rac2'
CRS-2673: Attempting to stop 'ora.asm' on 'rac2'
CRS-2677: Stop of 'ora.evmd' on 'rac2' succeeded
CRS-2677: Stop of 'ora.mdnsd' on 'rac2' succeeded
CRS-2677: Stop of 'ora.ctssd' on 'rac2' succeeded
CRS-2677: Stop of 'ora.asm' on 'rac2' succeeded
CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'rac2'
CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'rac2' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'rac2'
CRS-2677: Stop of 'ora.cssd' on 'rac2' succeeded
CRS-2673: Attempting to stop 'ora.crf' on 'rac2'
CRS-2677: Stop of 'ora.crf' on 'rac2' succeeded
CRS-2673: Attempting to stop 'ora.gipcd' on 'rac2'
CRS-2677: Stop of 'ora.gipcd' on 'rac2' succeeded
CRS-2673: Attempting to stop 'ora.gpnpd' on 'rac2'
CRS-2677: Stop of 'ora.gpnpd' on 'rac2' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'rac2' has completed
CRS-4133: Oracle High Availability Services has been stopped.
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
chdir: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
Removing Trace File Analyzer
Successfully deconfigured Oracle clusterware stack on this node
此时rac3的cluster 进程已被停止
[root@rac2 ~]# su - grid
+ASM3:/home/grid@rac2>crs_stat -t
CRS-0184: Cannot communicate with the CRS daemon.
如果仍有rac2节点的vip 服务哎,执行如下:
rac1:/home/oracle@rac1>srvctl stop vip -i ora.rac2.vip -f
rac1:/home/oracle@rac1>srvctl remove vip -i ora.rac2.vip -f
[root@rac1 ~]# crsctl delete resource ora.rac2.vip –f
[root@rac1 bin]# cd /u01/app/11.2.0/grid_1/bin/
[root@rac1 bin]# crsctl delete node -n rac2
CRS-4661: Node rac2 successfully deleted.
[root@rac1 bin]# olsnodes -t -s
rac1 Active Unpinned
+ASM2:/home/grid@rac2>$ORACLE_HOME/oui/bin/runInstaller -updateNodeList
ORACLE_HOME=$ORACLE_HOME "CLUSTER_NODES={rac2}" CRS=true -local
Starting Oracle Universal Installer...
Checking swap space: must be greater than 500 MB. Actual 3988 MB Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /u01/app/oraInventory
'UpdateNodeList' was successful.
最后用crsctl status res –t 验证rac2集群是否被删除
SQL> select thread#,status,instance from v$thread; 验证实例是否被删除