Oracle RAC下 删除节点(只删节点不删集群软件+数据库软件)

Oracle RAC下 删除节点

(只删节点不删集群软件+数据库软件)

1、环境介绍:

linux 6.5 +oracle11g-11.2.0.4-RAC集群

主机名1:rac1

主机名2:rac2

数据库名:racdb

vip:rac-vip

priv:rac-priv

2个节点实例均正常运行,在线删除节点

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

3、在所有保留节点(rac1)上执行

[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.

 

4、使用dbca删除rac2实例

注意这里需要在任一保留节点上删除rac2实例,也就是必须在rac1上执行

https://img-blog.csdn.net/20170320133912651?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvc2hpeXUxMTU3NzU4NjU1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center

https://img-blog.csdn.net/20170320133931374?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvc2hpeXUxMTU3NzU4NjU1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center

https://img-blog.csdn.net/20170320133953340?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvc2hpeXUxMTU3NzU4NjU1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center

https://img-blog.csdn.net/20170320134014434?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvc2hpeXUxMTU3NzU4NjU1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center

这一步可能会报错,报的错因为过长不大记得,大致是sys用户连接不上rac-vip1521,请确认连接是否正常和用户名密码正确

通常第一想到的肯定是连接不正常,可以尝试一下是用sys用户通过vip1521登录,你会发现登录不上去,解决办法:

select * from V$PWFILE_USERS; ---看数据库是否存在密码文件,如果是空的表示密码文件在$ORACLE_HOME/dbs下不存在需要重建密码文件

重建密码命令:orapwd file=orapwracdb1 password=abcd1234 entries=30 ---racdb1是一节点数据库

https://img-blog.csdn.net/20170320134040547?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvc2hpeXUxMTU3NzU4NjU1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center

https://img-blog.csdn.net/20170320134051263?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvc2hpeXUxMTU3NzU4NjU1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center

https://img-blog.csdn.net/20170320134106329?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvc2hpeXUxMTU3NzU4NjU1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center

https://img-blog.csdn.net/20170320134123498?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvc2hpeXUxMTU3NzU4NjU1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center

https://img-blog.csdn.net/20170320134139532?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvc2hpeXUxMTU3NzU4NjU1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center

https://img-blog.csdn.net/20170320134218515?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvc2hpeXUxMTU3NzU4NjU1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center

 

 

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进程已经消失

5、查看库的配置

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

 

 

 

6、停止rac2节点的监听

 

rac2:/home/oracle@rac2>srvctl config listener -a

Name: LISTENER

Network: 1, Owner: grid

Home: <CRS 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监听还在

 

7、在rac2节点使用oracle用户更新集群列表

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.

 

8、在任一保留的节点上停止rac2节点NodeApps

rac1:/home/oracle@rac1>srvctl stop nodeapps -n rac2 -f  //发现rac2的ons和vip 已经停了

9.在每个保留节点上执行

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.

 

10.停止rac2节点的集群

[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

 

11.在任一保留的节点上删除rac2节点

 

[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

 

12.rac3节点使用grid 用户更新集群列表

+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.

 

13、验证

最后用crsctl status res –t 验证rac2集群是否被删除

SQL> select thread#,status,instance from v$thread; 验证实例是否被删除

 

猜你喜欢

转载自blog.csdn.net/az65381973/article/details/87303251