一、适用场景
1、被删除节点一切保留,需要从RAC中剔除,例如因为要更换服务器。
2、被删除节点关于RAC的部分文件丢失,如GI、库软件误删除,需要重新安装GI或oracle库软件。
二、实验环境:
3节点RAC(11.2.0.3),主机名是node1、node2、node3,数据库名node,现在需要删除node3
节点间系统目录为本地目录模式,非共享
主机版本:Red Hat Enterprise Linux Server release 5.8
三、具体步骤
参考MOS文档:How to Add Node/Instance or Remove Node/Instance in 10gR2, 11gR1 and 11gR2 Oracle Clusterware and RAC (文档 ID 1332451.1)
--如果在正式库上需确保OCR有正常备份
Verify there is a current backup of the OCR.
Run the ocrconfig -showbackup command to ensure there is a valid backup.
1、Unpin node3节点
[root@node1 ~]# /oracle/11.2.0/grid/crs/bin/olsnodes -t –s
node1 Active Unpinned
node2 Active Unpinned
node3 Active Unpinned
--This command shows whether the node is active and whether it is pinned. If the node is unpinned, then you do not need to run the crsctl unpin css command.
在所有保留节点上执行:
[root@node1 ~]# /oracle/11.2.0/grid/crs/bin/crsctl unpin css -n node3
CRS-4667: Node node3 successfully unpinned.
[root@node2 ~]# /oracle/11.2.0/grid/crs/bin/crsctl unpin css -n node3
CRS-4667: Node node3 successfully unpinned.
2、使用dbca删掉node3实例
在任一保留的节点上删除node3实例
[oracle@node1 ~]$ export DISPLAY=192.168.65.1:0.0
[oracle@node1 ~]$ dbca –图形界面删除实例
或使用命令行静默删除(实验时采用命令行方式):
[oracle@node1 ~]$ dbca -silent -deleteInstance -nodeList node3 -gdbName node -instanceName node3 -sysDBAUserName sys -sysDBAPassword 123qwe
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 "/oracle/app/oracle/cfgtoollogs/dbca/node.log" for further details.
Verify that the dropped instance's redo thread has been removed by querying the V$LOG view. If the redo thread is not disabled, then disable the thread. For example:
SQL> ALTER DATABASE DISABLE THREAD 2;
验证node3实例已被删除
查看活动的实例:
[oracle@node1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Mon Jan 19 06:45:32 2015
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL> set line 120
SQL> select thread#,status,instance from v$thread;
THREAD# STATUS INSTANCE
---------- ------ ------------------
1 OPEN node1
2 OPEN node2
--删除前如下:
SQL> select thread#,status,instance from v$thread;
THREAD# STATUS INSTANCE
---------- ------ -----------------
1 OPEN node1
2 OPEN node2
3 OPEN node3
查看库的配置:
[root@node1 ~]# /oracle/11.2.0/grid/crs/bin/srvctl config database -d node
Database unique name: node
Database name: node
Oracle home: /oracle/app/oracle/product/11.2.0/db_1
Oracle user: oracle
Spfile: +ORADATADG/node/spfilenode.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: node
Database instances: node1,node2
Disk Groups: ORADATADG
Mount point paths:
Services:
Type: RAC
Database is administrator managed
--删除前如下:
[root@node3 ~]# /oracle/11.2.0/grid/crs/bin/srvctl config database -d node
Database unique name: node
Database name: node
Oracle home: /oracle/app/oracle/product/11.2.0/db_1
Oracle user: oracle
Spfile: +ORADATADG/node/spfilenode.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: node
Database instances: node1,node2,node3
Disk Groups: ORADATADG
Mount point paths:
Services:
Type: RAC
Database is administrator managed
3、停止node3节点的监听
[root@node3 ~]# /oracle/11.2.0/grid/crs/bin/srvctl config listener -a
Name: LISTENER
Network: 1, Owner: grid
Home:
/oracle/11.2.0/grid/crs on node(s) node3,node2,node1
End points: TCP:1521
[root@node3 ~]# /oracle/11.2.0/grid/crs/bin/srvctl disable listener -l listener -n node3
[root@node3 ~]# /oracle/11.2.0/grid/crs/bin/srvctl stop listener -l listener -n node3
4、在node3节点使用使用oracle用户更新集群列表
[root@node3 ~]# su – oracle
[oracle@node3 ~]$ $ORACLE_HOME/oui/bin/runInstaller -updateNodeList ORACLE_HOME=$ORACLE_HOME “CLUSTER_NODES={node3}” -local
Starting Oracle Universal Installer...
Checking swap space: must be greater than 500 MB. Actual 4095 MB Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /oracle/app/oraInventory
'UpdateNodeList' was successful.
5、删除node3节点的数据库软件
在node3节点上执行:
[root@node3 ~]# su – oracle
[oracle@node3 ~]$ $ORACLE_HOME/deinstall/deinstall -local
Checking for required files and bootstrapping ...
Please wait ...
Location of logs /oracle/app/oraInventory/logs/
############ ORACLE DEINSTALL & DECONFIG TOOL START ############
######################### CHECK OPERATION START #########################
## [START] Install check configuration ##
Checking for existence of the Oracle home location /oracle/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: /oracle/app/oracle
Checking for existence of central inventory location /oracle/app/oraInventory
Checking for existence of the Oracle Grid Infrastructure home /oracle/11.2.0/grid/crs
The following nodes are part of this cluster: node1,node2,node3
Checking for sufficient temp space availability on node(s) : 'node1,node2,node3'
## [END] Install check configuration ##
Network Configuration check config START
Network de-configuration trace file location: /oracle/app/oraInventory/logs/netdc_check2015-01-19_06-52-47-PM.log
Network Configuration check config END
Database Check Configuration START
Database de-configuration trace file location: /oracle/app/oraInventory/logs/databasedc_check2015-01-19_06-54-18-PM.log
Database Check Configuration END
Enterprise Manager Configuration Assistant START
EMCA de-configuration trace file location: /oracle/app/oraInventory/logs/emcadc_check2015-01-19_06-54-31-PM.log
Enterprise Manager Configuration Assistant END
Oracle Configuration Manager check START
OCM check log file location : /oracle/app/oraInventory/logs//ocm_check4861.log
Oracle Configuration Manager check END
######################### CHECK OPERATION END #########################
####################### CHECK OPERATION SUMMARY #######################
Oracle Grid Infrastructure Home is: /oracle/11.2.0/grid/crs
The cluster node(s) on which the Oracle home deinstallation will be performed are:node1,node2,node3
Since -local option has been specified, the Oracle home will be deinstalled only on the local node, 'node3', and the global configuration will be removed.
Oracle Home selected for deinstall is: /oracle/app/oracle/product/11.2.0/db_1
Inventory Location where the Oracle home registered is: /oracle/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
node1 : Oracle Home exists with CCR directory, but CCR is not configured
node2 : Oracle Home exists with CCR directory, but CCR is not configured
node3 : 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
A log of this session will be written to: '/oracle/app/oraInventory/logs/deinstall_deconfig2015-01-19_06-48-56-PM.out'
Any error messages from this session will be written to: '/oracle/app/oraInventory/logs/deinstall_deconfig2015-01-19_06-48-56-PM.err'
######################## CLEAN OPERATION START ########################
Enterprise Manager Configuration Assistant START
EMCA de-configuration trace file location: /oracle/app/oraInventory/logs/emcadc_clean2015-01-19_06-54-31-PM.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: /oracle/app/oraInventory/logs/databasedc_clean2015-01-19_06-56-12-PM.log
Network Configuration clean config START
Network de-configuration trace file location: /oracle/app/oraInventory/logs/netdc_clean2015-01-19_06-56-12-PM.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 : /oracle/app/oraInventory/logs//ocm_clean4861.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 '/oracle/app/oracle/product/11.2.0/db_1' from the central inventory on the local node : Done
Failed to delete the directory '/oracle/app/oracle/product/11.2.0/db_1'. The directory is in use.
Delete directory '/oracle/app/oracle/product/11.2.0/db_1' on the local node : Failed <<<< ---操作过程中不要在其他窗口进入ORACLE_HOME目录
The Oracle Base directory '/oracle/app/oracle' will not be removed on local node. The directory is not empty.
Oracle Universal Installer cleanup was successful.
Oracle Universal Installer clean END
## [START] Oracle install clean ##
Clean install operation removing temporary directory '/tmp/deinstall2015-01-19_05-02-37PM' on node 'node3'
## [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 '/oracle/app/oracle/product/11.2.0/db_1' from the central inventory on the local node.
Failed to delete directory '/oracle/app/oracle/product/11.2.0/db_1' on the local node.
Oracle Universal Installer cleanup was successful.
Oracle deinstall tool successfully cleaned up temporary directories.
#######################################################################
############# ORACLE DEINSTALL & DECONFIG TOOL END #############
6、在任一保留的节点上停止node3节点NodeApps
[root@node1 ~]$ /oracle/11.2.0/grid/crs/bin/srvctl stop nodeapps -n node3 -f
–-发现停了node3节点的ons和VIP
[grid@node1 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ACFSDG.dg
ONLINE ONLINE node1
ONLINE ONLINE node2
ONLINE ONLINE node3
ora.LISTENER.lsnr
ONLINE ONLINE node1
ONLINE ONLINE node2
OFFLINE OFFLINE node3
ora.ORAC_VOTE.dg
ONLINE ONLINE node1
ONLINE ONLINE node2
ONLINE ONLINE node3
ora.ORADATADG.dg
ONLINE ONLINE node1
ONLINE ONLINE node2
ONLINE ONLINE node3
ora.asm
ONLINE ONLINE node1 Started
ONLINE ONLINE node2 Started
ONLINE ONLINE node3 Started
ora.gsd
OFFLINE OFFLINE node1
OFFLINE OFFLINE node2
OFFLINE OFFLINE node3
ora.net1.network
ONLINE ONLINE node1
ONLINE ONLINE node2
OFFLINE OFFLINE node3
ora.ons
ONLINE ONLINE node1
ONLINE ONLINE node2
OFFLINE OFFLINE node3
ora.registry.acfs
ONLINE ONLINE node1
ONLINE ONLINE node2
ONLINE ONLINE node3
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE node1
ora.cvu
1 ONLINE ONLINE node1
ora.node.db
1 ONLINE ONLINE node2 Open
3 ONLINE ONLINE node1 Open
ora.node1.vip
1 ONLINE ONLINE node1
ora.node2.vip
1 ONLINE ONLINE node2
ora.node3.vip
1 OFFLINE OFFLINE
ora.oc4j
1 ONLINE ONLINE node1
ora.scan1.vip
1 ONLINE ONLINE node1
7、在保留节点使用oracle用户更新集群列表
在每个保留的节点上执行(确保窗口需要能够生成图形界面):
[root@node1 ~]# su – oracle
[oracle@node1 ~]# export DISPLAY=192.168.65.1:0.0
[oracle@node1 ~]$ $ORACLE_HOME/oui/bin/runInstaller -updateNodeList ORACLE_HOME=$ORACLE_HOME “CLUSTER_NODES={node1,node2}”
[root@node2 ~]# export DISPLAY=192.168.65.1:0.0
[root@node2 ~]# su – oracle
[oracle@node2 ~]# export DISPLAY=192.168.65.1:0.0
[oracle@node2 ~]$ $ORACLE_HOME/oui/bin/runInstaller -updateNodeList ORACLE_HOME=$ORACLE_HOME “CLUSTER_NODES={node1,node2}”
8、禁用node3节点的集群应用和守护进程(Disable the Oracle Clusterware applications and daemons running on the node)
在node3节点上执行:
[root@node3 ~]# su – root
[root@node3 ~]# /oracle/11.2.0/grid/crs/crs/install/rootcrs.pl -deconfig –force
备注:/oracle/11.2.0/grid/crs/crs/install/ --gird用户$ORACLE_HOME/crs/install/
9、删除node3节点的VIP
如果第8步执行顺利的,node3节点node3的VIP此时已被删除,在任一保留节点执行crs_stat -t验证一下:
[root@node1 ~]# crs_stat -t
如果仍然有node3节点的VIP服务存在,执行如下:
[root@node1 ~]# /oracle/11.2.0/grid/crs/bin/srvctl stop vip -i ora.node3.vip -f
[root@node1 ~]# /oracle/11.2.0/grid/crs/bin/srvctl remove vip -i ora.node3.vip -f
[root@node1 ~]# /oracle/11.2.0/grid/crs/bin/crsctl delete resource ora.node3.vip -f
10、在任一保留的节点上删除node3节点
[root@node1 ~]# /oracle/11.2.0/grid/crs/bin/crsctl delete node -n node3
[root@node1 ~]# /oracle/11.2.0/grid/crs/bin/olsnodes -t -s
11、node3节点使用grid用户更新集群列表
在node3节点上执行:
[root@node3 ~]# su – grid
[grid@node3 ~]# $ORACLE_HOME/oui/bin/runInstaller -updateNodeList ORACLE_HOME=$ORACLE_HOME “CLUSTER_NODES={node3}” CRS=true -local
12、node3节点删除集群软件
在node3节点上执行:
[root@node3 ~]# su – grid
[grid@node3 ~]# $ORACLE_HOME/deinstall/deinstall -local — 一路选择“是”
新开一个终端,以root 用户运行提示的脚本,如下:
[root@node3 ~]# /tmp/deinstall2015-01-20_03-28-55PM/perl/bin/perl -I/tmp/deinstall2015-01-20_03-28-55PM/perl/lib -I/tmp/deinstall2015-01-20_03-28-55PM/crs/install /tmp/deinstall2015-01-20_03-28-55PM/crs/install/rootcrs.pl -force -deconfig -paramfile “/tmp/deinstall2015-01-20_03-28-55PM/response/deinstall_Ora11g_gridinfrahome1.rsp”
运行完后,返回原终端按回车,继续运行暂停的脚本。
当会话结束时在节点 ‘node3′ 上以 root 用户身份运行 ‘rm -rf /etc/oraInst.loc’。
当会话结束时在节点 ‘node3′ 上以 root 身份运行 ‘rm -rf /opt/ORCLfmap’。
13、保留节点使用grid用户更新集群列表
在所有保留的节点上执行:
[root@node1 ~]# su – grid
[grid@node1 ~]$ $ORACLE_HOME/oui/bin/runInstaller -updateNodeList ORACLE_HOME=$ORACLE_HOME “CLUSTER_NODES={node1,node2}” CRS=true
[root@node2 ~]# su – grid
[grid@node2 ~]$ $ORACLE_HOME/oui/bin/runInstaller -updateNodeList ORACLE_HOME=$ORACLE_HOME “CLUSTER_NODES={node1,node2}” CRS=true
14、验证node3节点被删除
在任一保留的节点上:
[grid@node1 ~]$ cluvfy stage -post nodedel -n node3
[grid@node1 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ACFSDG.dg
ONLINE ONLINE node1
ONLINE ONLINE node2
ora.LISTENER.lsnr
ONLINE ONLINE node1
ONLINE ONLINE node2
ora.ORAC_VOTE.dg
ONLINE ONLINE node1
ONLINE ONLINE node2
ora.ORADATADG.dg
ONLINE ONLINE node1
ONLINE ONLINE node2
ora.asm
ONLINE ONLINE node1 Started
ONLINE ONLINE node2 Started
ora.gsd
OFFLINE OFFLINE node1
OFFLINE OFFLINE node2
ora.net1.network
ONLINE ONLINE node1
ONLINE ONLINE node2
ora.ons
ONLINE ONLINE node1
ONLINE ONLINE node2
ora.registry.acfs
ONLINE ONLINE node1
ONLINE ONLINE node2
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE node1
ora.cvu
1 ONLINE ONLINE node1
ora.node.db
1 ONLINE ONLINE node1 Open
2 ONLINE ONLINE node2 Open
ora.node1.vip
1 ONLINE ONLINE node1
ora.node2.vip
1 ONLINE ONLINE node2
ora.oc4j
1 ONLINE ONLINE node1
ora.scan1.vip
1 ONLINE ONLINE node1
验证node3节点被删除
查看活动的实例:
[onodele@node1 ~]$ sqlplus / as sysdba
SQL> set line 120
SQL> select thread#,status,instance from v$thread;
THREAD# STATUS INSTANCE
---------- ------ ------------------
1 OPEN node1
2 OPEN node2
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29953799/viewspace-1419027/
,如需转载,请注明出处,否则将追究法律责任。