Oracle 11g RAC 多节点集群删除节点实操记录

目前在进行去O,为保证生产操作,搭建了模拟生产环境的多节点RAC集群,作为一学就会,一会就废系列,今天推出该系列的第二篇,和11G RAC删除节点不同,10G RAC 删除稍有差别,后面会奉上该系列第三篇,10G的集群删除。

一、环境概述

本次验证测试环境为Oracle 11g RAC 三节点集群环境,现计划模拟下线其中一个节点。

1.1 现有集群节点信息

主机名public-IPvirtual-IPscan-IPprivate-IP操作系统版本数据库版本
host210192.168.17.136192.168.17.103192.168.17.10810.90.1.36CentOS release 6.10 (Final)11.2.0.4
host211192.168.17.137192.168.17.104192.168.17.10810.90.1.37CentOS release 6.10 (Final)11.2.0.4
host212192.168.17.139192.168.17.105192.168.17.10810.90.1.38CentOS release 6.10 (Final)11.2.0.4

现计划将host212从集群中下线,将RAC集群修改为 二节点RAC集群。

二、删除节点

2.1 检查CSS服务

检查现有集群节点CSS服务是否正常。

 

--- 使用grid用户,任一节点
[root@host210 ~]# su - grid
[grid@host210 ~]$ olsnodes -s -t
host210 Active Unpinned
host211 Active Unpinned
host212 Active Unpinned

## Unpinned代表正常
## 若是pinned代表不正常,需执行 [grid@hostxxx ~] crsctl unpin css -n hostname 【hostname即为不正常节点】

2.2 检查集群及数据库状态

集群状态信息如下:

 

[grid@host210 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.CRS.dg ora....up.type ONLINE ONLINE host210
ora.DATA.dg ora....up.type ONLINE ONLINE host210
ora....ER.lsnr ora....er.type ONLINE ONLINE host210
ora....N1.lsnr ora....er.type ONLINE ONLINE host210
ora.asm ora.asm.type ONLINE ONLINE host210
ora.cvu ora.cvu.type ONLINE ONLINE host210
ora.gsd ora.gsd.type OFFLINE OFFLINE
ora....SM1.asm application ONLINE ONLINE host210
ora....10.lsnr application ONLINE ONLINE host210
ora....210.gsd application OFFLINE OFFLINE
ora....210.ons application ONLINE ONLINE host210
ora....210.vip ora....t1.type ONLINE ONLINE host210
ora....SM2.asm application ONLINE ONLINE host211
ora....11.lsnr application ONLINE ONLINE host211
ora....211.gsd application OFFLINE OFFLINE
ora....211.ons application ONLINE ONLINE host211
ora....211.vip ora....t1.type ONLINE ONLINE host211
ora....SM3.asm application ONLINE ONLINE host212
ora....12.lsnr application ONLINE ONLINE host212
ora....212.gsd application OFFLINE OFFLINE
ora....212.ons application ONLINE ONLINE host212
ora....212.vip ora....t1.type ONLINE ONLINE host212
ora....network ora....rk.type ONLINE ONLINE host210
ora.oc4j ora.oc4j.type ONLINE ONLINE host210
ora.ons ora.ons.type ONLINE ONLINE host210
ora.oradb.db ora....se.type ONLINE ONLINE host210
ora.scan1.vip ora....ip.type ONLINE ONLINE host210

数据库状态信息如下:

 

[root@host210 ~]# su - oracle
[oracle@host210 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Thu Sep 21 11:05:38 2023

Copyright (c) 1982, 2013, Oracle. All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL> set long 99999 head off pages 0 lines 1000
SQL> select INST_ID,INSTANCE_NUMBER,INSTANCE_NAME,HOST_NAME,STATUS,THREAD# from gv$instance;
1 1 oradb1 host210 OPEN 1
3 3 oradb3 host212 OPEN 3
2 2 oradb2 host211 OPEN 2

2.3 删除数据库实例

删除数据库实例有两种方式,一种可通过图形的方式,另一种可通过命令的方式。

2.3.1 图形方式

图片

图片

图片

图片

图片

图片

图片

图片

图片

2.3.2 命令方式

 

--- 使用oracle用户在任一未被删除节点执行
[root@host210 ~]# su - oracle
[oracle@host210 ~]$ dbca -silent -deleteInstance -nodeList host212 -gdbName oradb -instanceName oradb3 -sysDBAUserName sys -sysDBAPassword oracle
Deleting instance
1% complete
2% complete
6% complete
13% complete
20% complete
26% complete
33% complete
40% complete
46% complete
53% complete
60% complete
66% complete
Completing instance management.
100% complete
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/oradb.log" for further details.

-- 通过如下方式查询,可以看到实例3已经被删除
[oracle@host210 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Thu Sep 21 11:05:38 2023

Copyright (c) 1982, 2013, Oracle. All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL> set long 99999 head off pages 0 lines 1000
SQL> select INST_ID,INSTANCE_NUMBER,INSTANCE_NAME,HOST_NAME,STATUS,THREAD# from gv$instance;
1 1 oradb1 host210 OPEN 1
2 2 oradb2 host211 OPEN 2


## /u01/app/oracle/cfgtoollogs/dbca/oradb.log 日志信息如下:
[root@host210 ~]# more /u01/app/oracle/cfgtoollogs/dbca/oradb.log
The Database Configuration Assistant will delete the Oracle instance and its associated OFA directory structure. All information about this instance will be deleted.

Do you want to proceed?
Deleting instance
DBCA_PROGRESS : 1%
DBCA_PROGRESS : 2%
DBCA_PROGRESS : 6%
DBCA_PROGRESS : 13%
DBCA_PROGRESS : 20%
DBCA_PROGRESS : 26%
DBCA_PROGRESS : 33%
DBCA_PROGRESS : 40%
DBCA_PROGRESS : 46%
DBCA_PROGRESS : 53%
DBCA_PROGRESS : 60%
DBCA_PROGRESS : 66%
Completing instance management.
DBCA_PROGRESS : 100%

2.4 停被删除节点监听

 

-- 使用grid用户在任一节点操作
[grid@host210 ~]$ srvctl config listener -a
Name: LISTENER
Network: 1, Owner: grid
Home: <CRS home>
/u01/app/11.2.0/grid on node(s) host210,host211,host212
End points: TCP:1521

[grid@host210 ~]$ srvctl disable listener -l listener -n host212
[grid@host210 ~]$ srvctl stop listener -l listener -n host212

-- 查看集群状态,可看到被删除实例host212监听已停
[grid@host210 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.CRS.dg ora....up.type ONLINE ONLINE host210
ora.DATA.dg ora....up.type ONLINE ONLINE host210
ora....ER.lsnr ora....er.type ONLINE ONLINE host210
ora....N1.lsnr ora....er.type ONLINE ONLINE host210
ora.asm ora.asm.type ONLINE ONLINE host210
ora.cvu ora.cvu.type ONLINE ONLINE host210
ora.gsd ora.gsd.type OFFLINE OFFLINE
ora....SM1.asm application ONLINE ONLINE host210
ora....10.lsnr application ONLINE ONLINE host210
ora....210.gsd application OFFLINE OFFLINE
ora....210.ons application ONLINE ONLINE host210
ora....210.vip ora....t1.type ONLINE ONLINE host210
ora....SM2.asm application ONLINE ONLINE host211
ora....11.lsnr application ONLINE ONLINE host211
ora....211.gsd application OFFLINE OFFLINE
ora....211.ons application ONLINE ONLINE host211
ora....211.vip ora....t1.type ONLINE ONLINE host211
ora....SM3.asm application ONLINE ONLINE host212
ora....12.lsnr application OFFLINE OFFLINE
ora....212.gsd application OFFLINE OFFLINE
ora....212.ons application ONLINE ONLINE host212
ora....212.vip ora....t1.type ONLINE ONLINE host212
ora....network ora....rk.type ONLINE ONLINE host210
ora.oc4j ora.oc4j.type ONLINE ONLINE host210
ora.ons ora.ons.type ONLINE ONLINE host210
ora.oradb.db ora....se.type ONLINE ONLINE host210
ora.scan1.vip ora....ip.type ONLINE ONLINE host210

2.5 第一次更新集群列表信息

 

-- 在被删除的host212节点使用oracle用户更新集群列表信息
[root@host212 ~]# su - oracle
[oracle@host212 ~]$ $ORACLE_HOME/oui/bin/runInstaller -updateNodeList ORACLE_HOME=$ORACLE_HOME "CLUSTER_NODES={host212}" -local
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB. Actual 65535 MB Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /u01/app/oraInventory
'UpdateNodeList' was successful.

2.6 删除数据库oracle软件

注意:在被删除节点执行。

 

-- 在被删除的host212节点使用oracle用户执行
[oracle@host212 ~]$ $ORACLE_HOME/deinstall/deinstall -local

-- 上述命令执行结果如下
Checking for required files and bootstrapping ...
Please wait ...
Location of logs /u01/app/oraInventory/logs/

############ ORACLE DEINSTALL & DECONFIG TOOL START ############


######################### CHECK OPERATION START #########################
## [START] Install check configuration ##


Checking for existence of the Oracle home location /u01/app/oracle/product/11.2.0/db_1
Oracle Home type selected for deinstall is: Oracle Real Application Cluster Database
Oracle Base selected for deinstall is: /u01/app/oracle
Checking for existence of central inventory location /u01/app/oraInventory
Checking for existence of the Oracle Grid Infrastructure home /u01/app/11.2.0/grid
The following nodes are part of this cluster: host212
Checking for sufficient temp space availability on node(s) : 'host212'

## [END] Install check configuration ##


Network Configuration check config START

Network de-configuration trace file location: /u01/app/oraInventory/logs/netdc_check2023-09-21_11-26-01-AM.log

Network Configuration check config END

Database Check Configuration START

Database de-configuration trace file location: /u01/app/oraInventory/logs/databasedc_check2023-09-21_11-26-03-AM.log

Database Check Configuration END

Enterprise Manager Configuration Assistant START

EMCA de-configuration trace file location: /u01/app/oraInventory/logs/emcadc_check2023-09-21_11-26-05-AM.log

Enterprise Manager Configuration Assistant END
Oracle Configuration Manager check START
OCM check log file location : /u01/app/oraInventory/logs//ocm_check8572.log
Oracle Configuration Manager check END

######################### CHECK OPERATION END #########################


####################### CHECK OPERATION SUMMARY #######################
Oracle Grid Infrastructure Home is: /u01/app/11.2.0/grid
The cluster node(s) on which the Oracle home deinstallation will be performed are:host212
Since -local option has been specified, the Oracle home will be deinstalled only on the local node, 'host212', and the global configuration will be removed.
Oracle Home selected for deinstall is: /u01/app/oracle/product/11.2.0/db_1
Inventory Location where the Oracle home registered is: /u01/app/oraInventory
The option -local will not modify any database configuration for this Oracle home.

No Enterprise Manager configuration to be updated for any database(s)
No Enterprise Manager ASM targets to update
No Enterprise Manager listener targets to migrate
Checking the config status for CCR
Oracle Home exists with CCR directory, but CCR is not configured
CCR check is finished
Do you want to continue (y - yes, n - no)? [n]: y ---输入 y
A log of this session will be written to: '/u01/app/oraInventory/logs/deinstall_deconfig2023-09-21_11-26-00-AM.out'
Any error messages from this session will be written to: '/u01/app/oraInventory/logs/deinstall_deconfig2023-09-21_11-26-00-AM.err'

######################## CLEAN OPERATION START ########################

Enterprise Manager Configuration Assistant START

EMCA de-configuration trace file location: /u01/app/oraInventory/logs/emcadc_clean2023-09-21_11-26-05-AM.log

Updating Enterprise Manager ASM targets (if any)
Updating Enterprise Manager listener targets (if any)
Enterprise Manager Configuration Assistant END
Database de-configuration trace file location: /u01/app/oraInventory/logs/databasedc_clean2023-09-21_11-26-23-AM.log

Network Configuration clean config START

Network de-configuration trace file location: /u01/app/oraInventory/logs/netdc_clean2023-09-21_11-26-23-AM.log

De-configuring Local Net Service Names configuration file...
Local Net Service Names configuration file de-configured successfully.

De-configuring backup files...
Backup files de-configured successfully.

The network configuration has been cleaned up successfully.

Network Configuration clean config END

Oracle Configuration Manager clean START
OCM clean log file location : /u01/app/oraInventory/logs//ocm_clean8572.log
Oracle Configuration Manager clean END
Setting the force flag to false
Setting the force flag to cleanup the Oracle Base
Oracle Universal Installer clean START

Detach Oracle home '/u01/app/oracle/product/11.2.0/db_1' from the central inventory on the local node : Done

Delete directory '/u01/app/oracle/product/11.2.0/db_1' on the local node : Done

Failed to delete the directory '/u01/app/oracle'. The directory is in use.
Delete directory '/u01/app/oracle' on the local node : Failed <<<<

Oracle Universal Installer cleanup completed with errors.

Oracle Universal Installer clean END


## [START] Oracle install clean ##

Clean install operation removing temporary directory '/tmp/deinstall2023-09-21_11-25-55AM' on node 'host212'

## [END] Oracle install clean ##


######################### CLEAN OPERATION END #########################


####################### CLEAN OPERATION SUMMARY #######################
Cleaning the config for CCR
As CCR is not configured, so skipping the cleaning of CCR configuration
CCR clean is finished
Successfully detached Oracle home '/u01/app/oracle/product/11.2.0/db_1' from the central inventory on the local node.
Successfully deleted directory '/u01/app/oracle/product/11.2.0/db_1' on the local node.
Failed to delete directory '/u01/app/oracle' on the local node.
Oracle Universal Installer cleanup completed with errors.

Oracle deinstall tool successfully cleaned up temporary directories.
#######################################################################


############# ORACLE DEINSTALL & DECONFIG TOOL END #############

2.7 停止节点NodeApps

在任一非被删除节点执行。

 

[root@host210 ~]# su - grid
-- 查看集群状态
[grid@host210 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.CRS.dg ora....up.type ONLINE ONLINE host210
ora.DATA.dg ora....up.type ONLINE ONLINE host210
ora....ER.lsnr ora....er.type ONLINE ONLINE host210
ora....N1.lsnr ora....er.type ONLINE ONLINE host210
ora.asm ora.asm.type ONLINE ONLINE host210
ora.cvu ora.cvu.type ONLINE ONLINE host210
ora.gsd ora.gsd.type OFFLINE OFFLINE
ora....SM1.asm application ONLINE ONLINE host210
ora....10.lsnr application ONLINE ONLINE host210
ora....210.gsd application OFFLINE OFFLINE
ora....210.ons application ONLINE ONLINE host210
ora....210.vip ora....t1.type ONLINE ONLINE host210
ora....SM2.asm application ONLINE ONLINE host211
ora....11.lsnr application ONLINE ONLINE host211
ora....211.gsd application OFFLINE OFFLINE
ora....211.ons application ONLINE ONLINE host211
ora....211.vip ora....t1.type ONLINE ONLINE host211
ora....SM3.asm application ONLINE ONLINE host212
ora....12.lsnr application OFFLINE OFFLINE
ora....212.gsd application OFFLINE OFFLINE
ora....212.ons application ONLINE ONLINE host212
ora....212.vip ora....t1.type ONLINE ONLINE host212
ora....network ora....rk.type ONLINE ONLINE host210
ora.oc4j ora.oc4j.type ONLINE ONLINE host210
ora.ons ora.ons.type ONLINE ONLINE host210
ora.oradb.db ora....se.type ONLINE ONLINE host210
ora.scan1.vip ora....ip.type ONLINE ONLINE host210
[grid@host210 ~]$ exit
logout
-- 使用oracle用户执行
[root@host210 ~]# su - oracle
[oracle@host210 ~]$ srvctl stop nodeapps -n host212
[oracle@host210 ~]$ exit
logout

-- 再次查看集群状态
[root@host210 ~]# su - grid
[grid@host210 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.CRS.dg ora....up.type ONLINE ONLINE host210
ora.DATA.dg ora....up.type ONLINE ONLINE host210
ora....ER.lsnr ora....er.type ONLINE ONLINE host210
ora....N1.lsnr ora....er.type ONLINE ONLINE host210
ora.asm ora.asm.type ONLINE ONLINE host210
ora.cvu ora.cvu.type ONLINE ONLINE host210
ora.gsd ora.gsd.type OFFLINE OFFLINE
ora....SM1.asm application ONLINE ONLINE host210
ora....10.lsnr application ONLINE ONLINE host210
ora....210.gsd application OFFLINE OFFLINE
ora....210.ons application ONLINE ONLINE host210
ora....210.vip ora....t1.type ONLINE ONLINE host210
ora....SM2.asm application ONLINE ONLINE host211
ora....11.lsnr application ONLINE ONLINE host211
ora....211.gsd application OFFLINE OFFLINE
ora....211.ons application ONLINE ONLINE host211
ora....211.vip ora....t1.type ONLINE ONLINE host211
ora....SM3.asm application ONLINE ONLINE host212
ora....12.lsnr application OFFLINE OFFLINE
ora....212.gsd application OFFLINE OFFLINE
ora....212.ons application OFFLINE OFFLINE
ora....212.vip ora....t1.type OFFLINE OFFLINE
ora....network ora....rk.type ONLINE ONLINE host210
ora.oc4j ora.oc4j.type ONLINE ONLINE host210
ora.ons ora.ons.type ONLINE ONLINE host210
ora.oradb.db ora....se.type ONLINE ONLINE host210
ora.scan1.vip ora....ip.type ONLINE ONLINE host210

## 如上可以看到被删除节点在集群状态都已显示为OFFLINE

2.8 第二次更新集群列表信息

在任一未被删除节点使用oracle用户更新集群列表信息。

 

[root@host210 ~]# su - oracle
[oracle@host210 ~]$ $ORACLE_HOME/oui/bin/runInstaller -updateNodeList ORACLE_HOME=$ORACLE_HOME "CLUSTER_NODES={host210,host211}"
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB. Actual 65535 MB Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /u01/app/oraInventory
'UpdateNodeList' was successful.

2.9 去除被删节点集群软件

注意:使用root用户在被删除节点执行。

 

[root@host212 ~]# /u01/app/11.2.0/grid/crs/install/rootcrs.pl -deconfig -force
-- 上述命令执行结果如下
Using configuration parameter file: /u01/app/11.2.0/grid/crs/install/crsconfig_params
Network exists: 1/192.168.17.0/255.255.255.0/em1, type static
VIP exists: /host210-vip/192.168.17.103/192.168.17.0/255.255.255.0/em1, hosting node host210
VIP exists: /host211-vip/192.168.17.104/192.168.17.0/255.255.255.0/em1, hosting node host211
VIP exists: /host212-vip/192.168.17.105/192.168.17.0/255.255.255.0/em1, hosting node host212
GSD exists
ONS exists: Local port 6100, remote port 6200, EM port 2016
PRKO-2426 : ONS is already stopped on node(s): host212
PRKO-2425 : VIP is already stopped on node(s): host212
PRKO-2440 : Network resource is already stopped.

CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'host212'
CRS-2673: Attempting to stop 'ora.crsd' on 'host212'
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'host212'
CRS-2673: Attempting to stop 'ora.CRS.dg' on 'host212'
CRS-2673: Attempting to stop 'ora.DATA.dg' on 'host212'
CRS-2677: Stop of 'ora.DATA.dg' on 'host212' succeeded
CRS-2677: Stop of 'ora.CRS.dg' on 'host212' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'host212'
CRS-2677: Stop of 'ora.asm' on 'host212' succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'host212' has completed
CRS-2677: Stop of 'ora.crsd' on 'host212' succeeded
CRS-2673: Attempting to stop 'ora.crf' on 'host212'
CRS-2673: Attempting to stop 'ora.ctssd' on 'host212'
CRS-2673: Attempting to stop 'ora.evmd' on 'host212'
CRS-2673: Attempting to stop 'ora.asm' on 'host212'
CRS-2673: Attempting to stop 'ora.mdnsd' on 'host212'
CRS-2677: Stop of 'ora.crf' on 'host212' succeeded
CRS-2677: Stop of 'ora.mdnsd' on 'host212' succeeded
CRS-2677: Stop of 'ora.evmd' on 'host212' succeeded
CRS-2677: Stop of 'ora.asm' on 'host212' succeeded
CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'host212'
CRS-2677: Stop of 'ora.ctssd' on 'host212' succeeded
CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'host212' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'host212'
CRS-2677: Stop of 'ora.cssd' on 'host212' succeeded
CRS-2673: Attempting to stop 'ora.gipcd' on 'host212'
CRS-2677: Stop of 'ora.gipcd' on 'host212' succeeded
CRS-2673: Attempting to stop 'ora.gpnpd' on 'host212'
CRS-2677: Stop of 'ora.gpnpd' on 'host212' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'host212' has completed
CRS-4133: Oracle High Availability Services has been stopped.
Removing Trace File Analyzer
Successfully deconfigured Oracle clusterware stack on this node

2.10 去除被删除节点

在任一非被删除节点使用root用户操作。

 

[root@host210 ~]# su - grid
[grid@host210 ~]$ olsnodes -t -s
host210 Active Unpinned
host211 Active Unpinned
host212 Inactive Unpinned
[grid@host210 ~]$ exit
logout
[root@host210 ~]# /u01/app/11.2.0/grid/bin/crsctl delete node -n host212
CRS-4661: Node host212 successfully deleted.
[root@host210 ~]# su - grid
[grid@host210 ~]$ olsnodes -t -s
host210 Active Unpinned
host211 Active Unpinned

2.11 第三次更新集群列表信息

在被删除节点更新列表信息。

-- 使用 grid用户在被删除节点操作
[root@host212 ~]# su - grid
[grid@host212 ~]$ $ORACLE_HOME/oui/bin/runInstaller -updateNodeList ORACLE_HOME=$ORACLE_HOME "CLUSTER_NODES={host212}" CRS=true -local
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB.   Actual 65535 MB    Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /u01/app/oraInventory
'UpdateNodeList' was successful.

2.12 删除数据库grid软件

注意:在被删除节点操作执行。

 

-- 使用grid用户操作
[root@host212 ~]# su - grid
[grid@host212 ~]$ $ORACLE_HOME/deinstall/deinstall -local
-- 上述操作执行结果如下所示
Checking for required files and bootstrapping ...
Please wait ...
Location of logs /tmp/deinstall2023-09-21_11-46-20AM/logs/

############ ORACLE DEINSTALL & DECONFIG TOOL START ############


######################### CHECK OPERATION START #########################
## [START] Install check configuration ##


Checking for existence of the Oracle home location /u01/app/11.2.0/grid
Oracle Home type selected for deinstall is: Oracle Grid Infrastructure for a Cluster
Oracle Base selected for deinstall is: /u01/app/grid
Checking for existence of central inventory location /u01/app/oraInventory
Checking for existence of the Oracle Grid Infrastructure home
The following nodes are part of this cluster: host212
Checking for sufficient temp space availability on node(s) : 'host212'

## [END] Install check configuration ##

Traces log file: /tmp/deinstall2023-09-21_11-46-20AM/logs//crsdc.log
Enter an address or the name of the virtual IP used on node "host212"[host212-vip]
> --- 敲回车

The following information can be collected by running "/sbin/ifconfig -a" on node "host212"
Enter the IP netmask of Virtual IP "192.168.17.105" on node "host212"[255.255.255.0]
> --- 敲回车

Enter the network interface name on which the virtual IP address "192.168.17.105" is active
> --- 敲回车

Enter an address or the name of the virtual IP[]
> --- 敲回车

Network Configuration check config START

Network de-configuration trace file location: /tmp/deinstall2023-09-21_11-46-20AM/logs/netdc_check2023-09-21_11-46-48-AM.log

Specify all RAC listeners (do not include SCAN listener) that are to be de-configured [LISTENER]:

Network Configuration check config END

Asm Check Configuration START

ASM de-configuration trace file location: /tmp/deinstall2023-09-21_11-46-20AM/logs/asmcadc_check2023-09-21_11-46-52-AM.log


######################### CHECK OPERATION END #########################


####################### CHECK OPERATION SUMMARY #######################
Oracle Grid Infrastructure Home is:
The cluster node(s) on which the Oracle home deinstallation will be performed are:host212
Since -local option has been specified, the Oracle home will be deinstalled only on the local node, 'host212', and the global configuration will be removed.
Oracle Home selected for deinstall is: /u01/app/11.2.0/grid
Inventory Location where the Oracle home registered is: /u01/app/oraInventory
Following RAC listener(s) will be de-configured: LISTENER
Option -local will not modify any ASM configuration.
Do you want to continue (y - yes, n - no)? [n]: y --- 输入 y,敲回车
A log of this session will be written to: '/tmp/deinstall2023-09-21_11-46-20AM/logs/deinstall_deconfig2023-09-21_11-46-24-AM.out'
Any error messages from this session will be written to: '/tmp/deinstall2023-09-21_11-46-20AM/logs/deinstall_deconfig2023-09-21_11-46-24-AM.err'

######################## CLEAN OPERATION START ########################
ASM de-configuration trace file location: /tmp/deinstall2023-09-21_11-46-20AM/logs/asmcadc_clean2023-09-21_11-46-58-AM.log
ASM Clean Configuration END

Network Configuration clean config START

Network de-configuration trace file location: /tmp/deinstall2023-09-21_11-46-20AM/logs/netdc_clean2023-09-21_11-46-58-AM.log

De-configuring RAC listener(s): LISTENER

De-configuring listener: LISTENER
Stopping listener on node "host212": LISTENER
Warning: Failed to stop listener. Listener may not be running.
Listener de-configured successfully.

De-configuring Naming Methods configuration file...
Naming Methods configuration file de-configured successfully.

De-configuring backup files...
Backup files de-configured successfully.

The network configuration has been cleaned up successfully.

Network Configuration clean config END

---------------------------------------->

The deconfig command below can be executed in parallel on all the remote nodes. Execute the command on the local node after the execution completes on all the remote nodes.

Run the following command as the root user or the administrator on node "host212".

/tmp/deinstall2023-09-21_11-46-20AM/perl/bin/perl -I/tmp/deinstall2023-09-21_11-46-20AM/perl/lib -I/tmp/deinstall2023-09-21_11-46-20AM/crs/install /tmp/deinstall2023-09-21_11-46-20AM/crs/install/rootcrs.pl -force -deconfig -paramfile "/tmp/deinstall2023-09-21_11-46-20AM/response/deinstall_Ora11g_gridinfrahome1.rsp"

Press Enter after you finish running the above commands
================================================================
-- 使用root新开一个被删除节点的会话窗口,执行上述命令,如下所示
[root@host212 ~]# /tmp/deinstall2023-09-21_11-46-20AM/perl/bin/perl -I/tmp/deinstall2023-09-21_11-46-20AM/perl/lib -I/tmp/deinstall2023-09-21_11-46-20AM/crs/install /tmp/deinstall2023-09-21_11-46-20AM/crs/install/rootcrs.pl -force -deconfig -paramfile "/tmp/deinstall2023-09-21_11-46-20AM/response/deinstall_Ora11g_gridinfrahome1.rsp"
-- 上述命令执行输出结果如下
Using configuration parameter file: /tmp/deinstall2023-09-21_11-46-20AM/response/deinstall_Ora11g_gridinfrahome1.rsp
****Unable to retrieve Oracle Clusterware home.
Start Oracle Clusterware stack and try again.
CRS-4047: No Oracle Clusterware components configured.
CRS-4000: Command Stop failed, or completed with errors.
################################################################
# You must kill processes or reboot the system to properly #
# cleanup the processes started by Oracle clusterware #
################################################################
Either /etc/oracle/olr.loc does not exist or is not readable
Make sure the file exists and it has read and execute access
Either /etc/oracle/olr.loc does not exist or is not readable
Make sure the file exists and it has read and execute access
Failure in execution (rc=-1, 256, No such file or directory) for command /etc/init.d/ohasd deinstall
error: package cvuqdisk is not installed
Successfully deconfigured Oracle clusterware stack on this node
-- 待以上执行完毕,重新返回前会话
================================================================
<----------------------------------------
--- 敲回车
Remove the directory: /tmp/deinstall2023-09-21_11-46-20AM on node:
Setting the force flag to false
Setting the force flag to cleanup the Oracle Base
Oracle Universal Installer clean START

Detach Oracle home '/u01/app/11.2.0/grid' from the central inventory on the local node : Done

Delete directory '/u01/app/11.2.0/grid' on the local node : Done

Delete directory '/u01/app/oraInventory' on the local node : Done

Delete directory '/u01/app/grid' on the local node : Done

Oracle Universal Installer cleanup was successful.

Oracle Universal Installer clean END


## [START] Oracle install clean ##

Clean install operation removing temporary directory '/tmp/deinstall2023-09-21_11-46-20AM' on node 'host212'

## [END] Oracle install clean ##


######################### CLEAN OPERATION END #########################


####################### CLEAN OPERATION SUMMARY #######################
Following RAC listener(s) were de-configured successfully: LISTENER
Oracle Clusterware is stopped and successfully de-configured on node "host212"
Oracle Clusterware is stopped and de-configured successfully.
Successfully detached Oracle home '/u01/app/11.2.0/grid' from the central inventory on the local node.
Successfully deleted directory '/u01/app/11.2.0/grid' on the local node.
Successfully deleted directory '/u01/app/oraInventory' on the local node.
Successfully deleted directory '/u01/app/grid' on the local node.
Oracle Universal Installer cleanup was successful.


Run 'rm -rf /etc/oraInst.loc' as root on node(s) 'host212' at the end of the session.

Run 'rm -rf /opt/ORCLfmap' as root on node(s) 'host212' at the end of the session.
Run 'rm -rf /etc/oratab' as root on node(s) 'host212' at the end of the session.
Oracle deinstall tool successfully cleaned up temporary directories.
#######################################################################


############# ORACLE DEINSTALL & DECONFIG TOOL END #############

 

2.13 第四次更新集群列表信息

在任一非删除节点操作执行。

 

-- 使用grid用户执行
[root@host210 ~]# su - grid
[grid@host210 ~]$ $ORACLE_HOME/oui/bin/runInstaller -updateNodeList ORACLE_HOME=$ORACLE_HOME "CLUSTER_NODES={host210,host211}" CRS=true
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB. Actual 65535 MB Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /u01/app/oraInventory
'UpdateNodeList' was successful.

2.15 清除被删节点信息

若要清空被删除节点上的数据库目录及文件信息,可在被删除节点使用root用户执行。

 

[root@host212 ~]# rm -rf /tmp/*
[root@host212 ~]# rm -rf /tmp/.*
[root@host212 ~]# rm -f /usr/local/bin/dbhome
[root@host212 ~]# rm -f /usr/local/bin/oraenv
[root@host212 ~]# rm -f /usr/local/bin/coraenv
[root@host212 ~]# rm -rf /opt/ORCLfmap
#删除数据库软件安装目录
[root@host212 ~]# rm -rf /u01/app/*

3、结果验证

在任一非被删除节点执行。

 

[root@host210 ~]# su - grid
[grid@host210 ~]$ cluvfy stage -post nodedel -n host212

Performing post-checks for node removal

Checking CRS integrity...

Clusterware version consistency passed

CRS integrity check passed

Node removal check passed

Post-check for node removal was successful.
[grid@host210 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.CRS.dg ora....up.type ONLINE ONLINE host210
ora.DATA.dg ora....up.type ONLINE ONLINE host210
ora....ER.lsnr ora....er.type ONLINE ONLINE host210
ora....N1.lsnr ora....er.type ONLINE ONLINE host210
ora.asm ora.asm.type ONLINE ONLINE host210
ora.cvu ora.cvu.type ONLINE ONLINE host210
ora.gsd ora.gsd.type OFFLINE OFFLINE
ora....SM1.asm application ONLINE ONLINE host210
ora....10.lsnr application ONLINE ONLINE host210
ora....210.gsd application OFFLINE OFFLINE
ora....210.ons application ONLINE ONLINE host210
ora....210.vip ora....t1.type ONLINE ONLINE host210
ora....SM2.asm application ONLINE ONLINE host211
ora....11.lsnr application ONLINE ONLINE host211
ora....211.gsd application OFFLINE OFFLINE
ora....211.ons application ONLINE ONLINE host211
ora....211.vip ora....t1.type ONLINE ONLINE host211
ora....network ora....rk.type ONLINE ONLINE host210
ora.oc4j ora.oc4j.type ONLINE ONLINE host210
ora.ons ora.ons.type ONLINE ONLINE host210
ora.oradb.db ora....se.type ONLINE ONLINE host210
ora.scan1.vip ora....ip.type ONLINE ONLINE host210


[root@host210 ~]# su - oracle
[oracle@host210 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Thu Sep 21 11:56:39 2023

Copyright (c) 1982, 2013, Oracle. All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options

SQL> set long 99999 head off pages 0 lines 1000
SQL> select INST_ID,INSTANCE_NUMBER,INSTANCE_NAME,HOST_NAME,STATUS,THREAD# from gv$instance;
1 1 oradb1 host210 OPEN 1
2 2 oradb2 host211 OPEN 2

SQL> select INST_ID,THREAD#,STATUS,GROUPS,INSTANCE from gv$thread;
2 1 OPEN 2 oradb1
2 2 OPEN 2 oradb2
1 1 OPEN 2 oradb1
1 2 OPEN 2 oradb2

## 可以看到集群中已不含有被删除节点信息。

欢迎您关注我的公众号【尚雷的驿站】


公众号:尚雷的驿站
CSDN :https://blog.csdn.net/shlei5580
墨天轮:https://www.modb.pro/u/2436
PGFans:https://www.pgfans.cn/user/home?userId=4159


image.png

  • 10
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

尚雷5580

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值