[原创]RAC管理_删除节点、添加节点(linux-11gR2)(下)[原创]_MySQL, Oracle及数据库讨论区_Weblogic技术|Tuxedo技术|中间件技术|Oracle论坛|JAVA论坛|Linux/Unix技术|hadoop论坛_联动北方技术论坛  
网站首页 | 关于我们 | 服务中心 | 经验交流 | 公司荣誉 | 成功案例 | 合作伙伴 | 联系我们 |
联动北方-国内领先的云技术服务提供商
»  游客             当前位置:  论坛首页 »  自由讨论区 »  MySQL, Oracle及数据库讨论区 »
总帖数
1
每页帖数
101/1页1
返回列表
0
发起投票  发起投票 发新帖子
查看: 2923 | 回复: 0   主题: [原创]RAC管理_删除节点、添加节点(linux-11gR2)(下)[原创]        下一篇 
    本主题由 Administrator 于 2014-11-19 9:34:51 移动
tengfei.dong
注册用户
等级:中尉
经验:461
发帖:15
精华:0
注册:1970-1-1
状态:离线
发送短消息息给tengfei.dong 加好友    发送短消息息给tengfei.dong 发消息
发表于: IP:您无权察看 2014-11-19 9:19:18 | [全部帖] [楼主帖] 楼主

redhat5.8 11gR2 双节点RAC删除一个节点

1.环境概述:
现有的RAC环境是2节点的11.2.0.3的RAC,在本文档中,我们演示删除一个节点:edison2。所有的删除操作都在环境正常运行状态
下进行。

RAC删除节点操作正好和添加节点完全相反。

RAC的相关配置如下表:
服务器主机名 edison1.oracle.com edison2.oracle.com
公共IP地址(eth0) 192.168.10.181 192.168.10.183
虚拟IP地址(eth0) 192.168.10.182 192.168.10.184
私有IP地址(eth1) 172.168.10.191 172.168.10.192

ORACLE RAC SID PROD1 PROD2


集群数据库名 prod

SCANIP 192.168.10.186


操作系统 Red Hat 5.8
存储 ASM
Oracle版本 11.2.0.3

当前RAC环境信息:

[root@edison1 ~]# olsnodes -s
edison1 Active
edison2 Active
[root@edison1 ~]# olsnodes -i
edison1 192.168.10.182
edison2 192.168.10.184
[root@edison1 ~]#
[root@edison1 ~]# crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.BACKUPDG.dg
ONLINE ONLINE edison1
ONLINE ONLINE edison2
ora.DATA.dg
ONLINE ONLINE edison1
ONLINE ONLINE edison2
ora.LISTENER.lsnr
ONLINE ONLINE edison1
ONLINE ONLINE edison2
ora.SYSTEMDG.dg
ONLINE ONLINE edison1
ONLINE ONLINE edison2
ora.asm
ONLINE ONLINE edison1 Started
ONLINE ONLINE edison2 Started
ora.gsd
OFFLINE OFFLINE edison1
OFFLINE OFFLINE edison2
ora.net1.network
ONLINE ONLINE edison1
ONLINE ONLINE edison2
ora.ons
ONLINE ONLINE edison1
ONLINE ONLINE edison2
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE edison2
ora.cvu
1 OFFLINE OFFLINE
ora.edison1.vip
1 ONLINE ONLINE edison1
ora.edison2.vip
1 ONLINE ONLINE edison2
ora.oc4j
1 OFFLINE OFFLINE
ora.prod.db
1 ONLINE ONLINE edison1 Open
2 ONLINE ONLINE edison2 Open
ora.prod.edison_taf.svc
1 ONLINE ONLINE edison2
ora.scan1.vip
1 ONLINE ONLINE edison2
[root@edison1 ~]#
SQL> col host_name for a20
SQL> select inst_id,host_name,instance_name,status from gv$instance;
INST_ID HOST_NAME INSTANCE_NAME STATUS
---------- -------------------- ---------------- ------------
1 edison1.oracle.com PROD1 OPEN
2 edison2.oracle.com PROD2 OPEN
SQL>
[root@edison1 ~]# crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....UPDG.dg ora....up.type ONLINE ONLINE edison1
ora.DATA.dg ora....up.type ONLINE ONLINE edison1
ora....ER.lsnr ora....er.type ONLINE ONLINE edison1
ora....N1.lsnr ora....er.type ONLINE ONLINE edison2
ora....EMDG.dg ora....up.type ONLINE ONLINE edison1
ora.asm ora.asm.type ONLINE ONLINE edison1
ora.cvu ora.cvu.type OFFLINE OFFLINE
ora.gsd ora.gsd.type OFFLINE OFFLINE
ora....SM1.asm application ONLINE ONLINE edison1
ora....N1.lsnr application ONLINE ONLINE edison1
ora....an1.gsd application OFFLINE OFFLINE
ora....an1.ons application ONLINE ONLINE edison1
ora....an1.vip ora....t1.type ONLINE ONLINE edison1
ora....SM2.asm application ONLINE ONLINE edison2
ora....N2.lsnr application ONLINE ONLINE edison2
ora....an2.gsd application OFFLINE OFFLINE
ora....an2.ons application ONLINE ONLINE edison2
ora....an2.vip ora....t1.type ONLINE ONLINE edison2
ora....network ora....rk.type ONLINE ONLINE edison1
ora.oc4j ora.oc4j.type OFFLINE OFFLINE
ora.ons ora.ons.type ONLINE ONLINE edison1
ora.prod.db ora....se.type ONLINE ONLINE edison1
ora....taf.svc ora....ce.type ONLINE ONLINE edison2
ora.scan1.vip ora....ip.type ONLINE ONLINE edison2


2.备份OCR:

在删除节点前,建议手工备份OCR,以便出现问题时,可以恢复OCR。在节点1上root执行备份:

[root@edison1 ~]# ocrconfig -manualbackup
edison1 2014/10/07 06:13:19 /g01/grid/app/11.2.0/grid/cdata/edison-cluster/backup_20141007_061319.ocr
edison1 2014/10/06 10:03:01 /g01/grid/app/11.2.0/grid/cdata/edison-cluster/backup_20141006_100301.ocr
edison1 2014/10/04 01:17:04 /g01/grid/app/11.2.0/grid/cdata/edison-cluster/backup_20141004_011704.ocr
[root@edison1 ~]# ocrconfig -showbackup manual
edison1 2014/10/07 06:13:19 /g01/grid/app/11.2.0/grid/cdata/edison-cluster/backup_20141007_061319.ocr
edison1 2014/10/06 10:03:01 /g01/grid/app/11.2.0/grid/cdata/edison-cluster/backup_20141006_100301.ocr
edison1 2014/10/04 01:17:04 /g01/grid/app/11.2.0/grid/cdata/edison-cluster/backup_20141004_011704.ocr
[root@edison1 ~]#


3.DBCA删除数据库示例:

3.1.调整service信息:
如果RAC环境配置了Service-Side TAT的操作,并且待删除的节点的service是preferred的,那么在删除该节点前,需要把该节点的
连接转移到其他节点上去,使用relocate service进行操作。
当preferred instance不可用时,service会自动reloacate到available的实例上,这个过程也可以手工来执行,命令如下:

srvctl relocate service -d dbname -s servicename -i instancename -t newinstancename [-f]
[root@edison1 ~]# srvctl config service -d prod
Service name: edison_taf
Service is enabled
Server pool: prod_edison_taf
Cardinality: 1
Disconnect: false
Service role: PRIMARY
Management policy: AUTOMATIC
DTP transaction: false
AQ HA notifications: false
Failover type: SELECT
Failover method: BASIC
TAF failover retries: 180
TAF failover delay: 5
Connection Load Balancing Goal: LONG
Runtime Load Balancing Goal: NONE
TAF policy specification: BASIC
Edition:
Preferred instances: PROD1
Available instances: PROD2
[root@edison1 ~]#
[root@edison1 ~]# srvctl status service -d prod
Service edison_taf is running on instance(s) PROD2
[root@edison1 ~]#
--将节点2上的服务edison_taf转移到节点1上(可以oracle用户执行):
[root@edison1 ~]# srvctl relocate service -d prod -s edison_taf -i PROD2 -t PROD1
[root@edison1 ~]# srvctl status service -d prod
Service edison_taf is running on instance(s) PROD1
[root@edison1 ~]#
--也可以配置service信息,删除2节点service,命令如下,这里就不删除了:
srvctl stop service -d prod -s edison_taf -i PROD2
srvctl status service -d prod
srvctl modify service -d prod -s edison_taf -n -i PROD1 -f
srvctl status service -d prod
srvctl config service -d prod


3.2.DBCA删除实例:
在节点上用oracle用户运行dbca。这里可以用图形界面来删除:
dbca->RAC database->Instance Management->Delete Instance->选择实例,输入sys用户和密码->选择准备删除的数据库实例。

也可以使用dbca的silent来操作,语法如下:

dbca -silent -deleteInstance [-nodeList node_name] -gdbName gdb_name -instanceName instance_name -sysDBAUserName sysdba -sysDBAPassword password


在节点1上用oracle用户执行:

dbca -silent -deleteInstance -nodeList edison2 -gdbName prod -instanceName PROD2 -sysDBAUserName sys -sysDBAPassword oracle


3.3.确认PROD2已经从CRS中清除:

注意:用oracle用户执行,还要注意oracle用户的属组信息。

[oracle@edison1 grid]$ srvctl config database -d prod
Database unique name: PROD
Database name: PROD
Oracle home: /s01/oracle/app/oracle/product/11.2.0/dbhome_1
Oracle user: oracle
Spfile: +DATA/PROD/spfilePROD.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: PROD
Database instances: PROD1
Disk Groups: DATA,BACKUPDG
Mount point paths:
Services: edison_taf
Type: RAC
Database is administrator managed
[oracle@edison1 grid]$


这里已经没有实例PROD2了。

4.从RAC层面删除节点(ORACLE软件):

4.1.停止节点2的监听:

[grid@edison1 ~]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 07-OCT-2014 07:05:55
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date 07-OCT-2014 05:25:06
Uptime 0 days 1 hr. 40 min. 49 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /g01/grid/app/11.2.0/grid/network/admin/listener.ora
Listener Log File /g01/diag/tnslsnr/edison1/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.10.181)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.10.182)(PORT=1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "PROD" has 1 instance(s).
Instance "PROD1", status READY, has 1 handler(s) for this service...
Service "edison_taf" has 1 instance(s).
Instance "PROD1", status READY, has 1 handler(s) for this service...
The command completed successfully
[grid@edison1 ~]$
[grid@edison1 ~]$ ./crs_stat
Name Target State Host
------------------------------ ---------- --------- -------
ora.BACKUPDG.dg ONLINE ONLINE edison1
ora.DATA.dg ONLINE ONLINE edison1
ora.LISTENER.lsnr ONLINE ONLINE edison1
ora.LISTENER_SCAN1.lsnr ONLINE ONLINE edison2 ----relocate这个资源 
ora.SYSTEMDG.dg ONLINE ONLINE edison1
ora.asm ONLINE ONLINE edison1
ora.cvu OFFLINE OFFLINE
ora.gsd OFFLINE OFFLINE
ora.edison1.ASM1.asm ONLINE ONLINE edison1
ora.edison1.LISTENER_edison1.lsnr ONLINE ONLINE edison1
ora.edison1.gsd OFFLINE OFFLINE
ora.edison1.ons ONLINE ONLINE edison1
ora.edison1.vip ONLINE ONLINE edison1
ora.edison2.ASM2.asm ONLINE ONLINE edison2
ora.edison2.LISTENER_edison2.lsnr ONLINE ONLINE edison2 ----停掉这个监听 
ora.edison2.gsd OFFLINE OFFLINE
ora.edison2.ons ONLINE ONLINE edison2
ora.edison2.vip ONLINE ONLINE edison2
ora.net1.network ONLINE ONLINE edison1
ora.oc4j OFFLINE OFFLINE
ora.ons ONLINE ONLINE edison1
ora.prod.db ONLINE ONLINE edison1
ora.prod.edison_taf.svc ONLINE ONLINE edison1
ora.scan1.vip ONLINE ONLINE edison2 ----relocate这个资源 
[grid@edison1 ~]$ ls
[grid@edison1 ~]$ srvctl disable listener -l LISTENER -n edison2
[grid@edison1 ~]$ srvctl stop listener -l LISTENER -n edison2
[grid@edison1 ~]$ srvctl status listener -l listener
Listener LISTENER is enabled
Listener LISTENER is running on node(s): edison1
[grid@edison1 ~]$
[grid@edison1 ~]$ crsctl relocate resource ora.LISTENER_SCAN1.lsnr -f
CRS-2673: Attempting to stop 'ora.LISTENER_SCAN1.lsnr' on 'edison2'
CRS-2677: Stop of 'ora.LISTENER_SCAN1.lsnr' on 'edison2' succeeded
CRS-2673: Attempting to stop 'ora.scan1.vip' on 'edison2'
CRS-2677: Stop of 'ora.scan1.vip' on 'edison2' succeeded
CRS-2672: Attempting to start 'ora.scan1.vip' on 'edison1'
CRS-2676: Start of 'ora.scan1.vip' on 'edison1' succeeded
CRS-2672: Attempting to start 'ora.LISTENER_SCAN1.lsnr' on 'edison1'
CRS-2676: Start of 'ora.LISTENER_SCAN1.lsnr' on 'edison1' succeeded
[grid@edison1 ~]$
[grid@edison1 ~]$ ./crs_stat
Name Target State Host
------------------------------ ---------- --------- -------
ora.BACKUPDG.dg ONLINE ONLINE edison1
ora.DATA.dg ONLINE ONLINE edison1
ora.LISTENER.lsnr ONLINE ONLINE edison1
ora.LISTENER_SCAN1.lsnr ONLINE ONLINE edison1
ora.SYSTEMDG.dg ONLINE ONLINE edison1
ora.asm ONLINE ONLINE edison1
ora.cvu OFFLINE OFFLINE
ora.gsd OFFLINE OFFLINE
ora.edison1.ASM1.asm ONLINE ONLINE edison1
ora.edison1.LISTENER_edison1.lsnr ONLINE ONLINE edison1
ora.edison1.gsd OFFLINE OFFLINE
ora.edison1.ons ONLINE ONLINE edison1
ora.edison1.vip ONLINE ONLINE edison1
ora.edison2.ASM2.asm ONLINE ONLINE edison2
ora.edison2.LISTENER_edison2.lsnr OFFLINE OFFLINE
ora.edison2.gsd OFFLINE OFFLINE
ora.edison2.ons ONLINE ONLINE edison2
ora.edison2.vip ONLINE ONLINE edison2
ora.net1.network ONLINE ONLINE edison1
ora.oc4j OFFLINE OFFLINE
ora.ons ONLINE ONLINE edison1
ora.prod.db ONLINE ONLINE edison1
ora.prod.edison_taf.svc ONLINE ONLINE edison1
ora.scan1.vip ONLINE ONLINE edison1
[grid@edison1 ~]$


4.2.在节点2用oracle用户更新InVentory

[oracle@edison2 bin]$ ./runInstaller -updateNodeList ORACLE_HOME=/s01/oracle/app/oracle/product/11.2.0/dbhome_1 "CLUSTER_NODES=edison2"
Starting Oracle Universal Installer...
Checking swap space: must be greater than 500 MB. Actual 5901 MB Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /g01/grid/app/oraInventory
'UpdateNodeList' was successful.
[oracle@edison2 bin]$


4.3.删除节点3的ORACLE_HOME,用oracle用户执行Deinstall命令:

[oracle@edison2 ~]$ id oracle
uid=501(oracle) gid=6000(oinstall) groups=6000(oinstall),5001(asmdba),6001(dba)
[oracle@edison2 ~]$ $ORACLE_HOME/deinstall/deinstall -local
Checking for required files and bootstrapping ...
Please wait ...
Location of logs /g01/grid/app/oraInventory/logs/
############ ORACLE DEINSTALL & DECONFIG TOOL START ############
######################### CHECK OPERATION START #########################
## [START] Install check configuration ##
Checking for existence of the Oracle home location /s01/oracle/app/oracle/product/11.2.0/dbhome_1
Oracle Home type selected for deinstall is: Oracle Real Application Cluster Database
Oracle Base selected for deinstall is: /s01/oracle/app/oracle
Checking for existence of central inventory location /g01/grid/app/oraInventory
Checking for existence of the Oracle Grid Infrastructure home /g01/grid/app/11.2.0/grid
The following nodes are part of this cluster: edison2
Checking for sufficient temp space availability on node(s) : 'edison2'
## [END] Install check configuration ##
Network Configuration check config START
Network de-configuration trace file location: /g01/grid/app/oraInventory/logs/netdc_check2014-10-07_07-50-35-AM.log
Network Configuration check config END
Database Check Configuration START
Database de-configuration trace file location: /g01/grid/app/oraInventory/logs/databasedc_check2014-10-07_07-50-38-AM.log
ERROR: The option -local will not modify any database configuration for this Oracle home.
Following databases have instances configured on local node : 'PROD'. Remove these database instances using dbca before de-installing the local Oracle home.
Enterprise Manager Configuration Assistant START
EMCA de-configuration trace file location: /g01/grid/app/oraInventory/logs/emcadc_check2014-10-07_07-50-39-AM.log
Enterprise Manager Configuration Assistant END
Oracle Configuration Manager check START
OCM check log file location : /g01/grid/app/oraInventory/logs//ocm_check4335.log
Oracle Configuration Manager check END
######################### CHECK OPERATION END #########################
####################### CHECK OPERATION SUMMARY #######################
Oracle Grid Infrastructure Home is: /g01/grid/app/11.2.0/grid
The cluster node(s) on which the Oracle home deinstallation will be performed are:edison2
Since -local option has been specified, the Oracle home will be deinstalled only on the local node, 'edison2', and the global configuration will be removed.
Oracle Home selected for deinstall is: /s01/oracle/app/oracle/product/11.2.0/dbhome_1
Inventory Location where the Oracle home registered is: /g01/grid/app/oraInventory
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
A log of this session will be written to: '/g01/grid/app/oraInventory/logs/deinstall_deconfig2014-10-07_07-50-20-AM.out'
Any error messages from this session will be written to: '/g01/grid/app/oraInventory/logs/deinstall_deconfig2014-10-07_07-50-20-AM.err'
############# ORACLE DEINSTALL & DECONFIG TOOL END #############
[oracle@edison2 ~]$


4.4在节点1上用oracle用户更新inventory:

$ORACLE_HOME/oui/bin/runInstaller -updateNodeList ORACLE_HOME=/s01/oracle/app/oracle/product/11.2.0/dbhome_1 "CLUSTER_NODES=edison1"
[oracle@edison1 ~]$ $ORACLE_HOME/oui/bin/runInstaller -updateNodeList ORACLE_HOME=/s01/oracle/app/oracle/product/11.2.0/dbhome_1 "CLUSTER_NODES=edison1"
Starting Oracle Universal Installer...
Checking swap space: must be greater than 500 MB. Actual 5644 MB Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /g01/grid/app/oraInventory
'UpdateNodeList' was successful.
[oracle@edison1 ~]$


5.GRID层面删除节点(clusterware):

上一小节主要由oracle用户操作完成,该小节主要由grid或者root用户操作完成。

5.1.查看节点都是unpin状态:

[grid@edison1 ~]$ olsnodes -s -t
edison1 Active Unpinned
edison2 Active Pinned
[grid@edison1 ~]$
[root@edison1 ~]# crsctl unpin css -n edison2
[root@edison1 ~]# olsnodes -s -t
edison1 Active Unpinned
edison2 Active Unpinned
[root@edison1 ~]#


5.2.在节点2以root用户运行deconfig:

[root@edison2 ~]# /g01/grid/app/11.2.0/grid/crs/install/rootcrs.pl -deconfig -deinstall -force
Using configuration parameter file: /g01/grid/app/11.2.0/grid/crs/install/crsconfig_params
Network exists: 1/192.168.10.0/255.255.255.0/eth0, type static
VIP exists: /192.168.10.182/192.168.10.182/192.168.10.0/255.255.255.0/eth0, hosting node edison1
VIP exists: /192.168.10.184/192.168.10.184/192.168.10.0/255.255.255.0/eth0, hosting node edison2
GSD exists
ONS exists: Local port 6100, remote port 6200, EM port 2016
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'edison2'
CRS-2673: Attempting to stop 'ora.crsd' on 'edison2'
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'edison2'
CRS-2673: Attempting to stop 'ora.BACKUPDG.dg' on 'edison2'
CRS-2673: Attempting to stop 'ora.DATA.dg' on 'edison2'
CRS-2673: Attempting to stop 'ora.SYSTEMDG.dg' on 'edison2'
CRS-2677: Stop of 'ora.DATA.dg' on 'edison2' succeeded
CRS-2677: Stop of 'ora.BACKUPDG.dg' on 'edison2' succeeded
CRS-2677: Stop of 'ora.SYSTEMDG.dg' on 'edison2' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'edison2'
CRS-2677: Stop of 'ora.asm' on 'edison2' succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'edison2' has completed
CRS-2677: Stop of 'ora.crsd' on 'edison2' succeeded
CRS-2673: Attempting to stop 'ora.mdnsd' on 'edison2'
CRS-2673: Attempting to stop 'ora.crf' on 'edison2'
CRS-2673: Attempting to stop 'ora.ctssd' on 'edison2'
CRS-2673: Attempting to stop 'ora.evmd' on 'edison2'
CRS-2673: Attempting to stop 'ora.asm' on 'edison2'
CRS-2677: Stop of 'ora.crf' on 'edison2' succeeded
CRS-2677: Stop of 'ora.ctssd' on 'edison2' succeeded
CRS-2677: Stop of 'ora.evmd' on 'edison2' succeeded
CRS-2677: Stop of 'ora.mdnsd' on 'edison2' succeeded
CRS-2677: Stop of 'ora.asm' on 'edison2' succeeded
CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'edison2'
CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'edison2' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'edison2'
CRS-2677: Stop of 'ora.cssd' on 'edison2' succeeded
CRS-2673: Attempting to stop 'ora.gipcd' on 'edison2'
CRS-2677: Stop of 'ora.gipcd' on 'edison2' succeeded
CRS-2673: Attempting to stop 'ora.gpnpd' on 'edison2'
CRS-2677: Stop of 'ora.gpnpd' on 'edison2' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'edison2' has completed
CRS-4133: Oracle High Availability Services has been stopped.
Successfully deconfigured Oracle clusterware stack on this node
[root@edison2 ~]#


验证:

[root@edison1 ~]# olsnodes -s
edison1 Active
edison2 Inactive
[root@edison1 ~]#


5.3.在节点1上root运行删除节点:

[root@edison1 ~]# crsctl delete node -n edison2
CRS-4661: Node edison2 successfully deleted.
[root@edison1 ~]#


5.4.在节点2更新inventory:

grid用户执行:

[grid@edison2 ~]$ $ORACLE_HOME/oui/bin/runInstaller -updateNodeList ORACLE_HOME=/g01/grid/app/11.2.0/grid "CLUSTER_NODES=edison2" -silent -local
Starting Oracle Universal Installer...
Checking swap space: must be greater than 500 MB. Actual 5922 MB Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /g01/grid/app/oraInventory
'UpdateNodeList' was successful.
[grid@edison2 ~]$


5.5.删除GRID_HOME在节点2运行DEinstall:

grid用户执行:

[grid@edison2 ~]$ $ORACLE_HOME/oui/bin/runInstaller -updateNodeList ORACLE_HOME=/g01/grid/app/11.2.0/grid "CLUSTER_NODES=edison2" -silent -local
Starting Oracle Universal Installer...
Checking swap space: must be greater than 500 MB. Actual 5922 MB Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /g01/grid/app/oraInventory
'UpdateNodeList' was successful.
[grid@edison2 ~]$ $ORACLE_HOME/deinstall/deinstall -local
Checking for required files and bootstrapping ...
Please wait ...
Location of logs /g01/grid/app/oraInventory/logs/
############ ORACLE DEINSTALL & DECONFIG TOOL START ############
######################### CHECK OPERATION START #########################
## [START] Install check configuration ##
Checking for existence of the Oracle home location /g01/grid/app/11.2.0/grid
Oracle Home type selected for deinstall is: Oracle Grid Infrastructure for a Cluster
Oracle Base selected for deinstall is: /g01/grid/app/grid
Checking for existence of central inventory location /g01/grid/app/oraInventory
Checking for existence of the Oracle Grid Infrastructure home
The following nodes are part of this cluster: edison2
Checking for sufficient temp space availability on node(s) : 'edison2'
## [END] Install check configuration ##
Traces log file: /g01/grid/app/oraInventory/logs//crsdc.log
Enter an address or the name of the virtual IP used on node "edison2"[edison2-vip]
>
The following information can be collected by running "/sbin/ifconfig -a" on node "edison2"
Enter the IP netmask of Virtual IP "192.168.10.184" on node "edison2"[255.255.255.0]
>
Enter the network interface name on which the virtual IP address "192.168.10.184" is active
>
Enter an address or the name of the virtual IP[]
>
Network Configuration check config START
Network de-configuration trace file location: /g01/grid/app/oraInventory/logs/netdc_check2014-10-07_08-22-10-AM.log
Specify all RAC listeners (do not include SCAN listener) that are to be de-configured [LISTENER,LISTENER_SCAN1]:
Network Configuration check config END
Asm Check Configuration START
ASM de-configuration trace file location: /g01/grid/app/oraInventory/logs/asmcadc_check2014-10-07_08-22-12-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:edison2
Since -local option has been specified, the Oracle home will be deinstalled only on the local node, 'edison2', and the global configuration will be removed.
Oracle Home selected for deinstall is: /g01/grid/app/11.2.0/grid
Inventory Location where the Oracle home registered is: /g01/grid/app/oraInventory
Following RAC listener(s) will be de-configured: LISTENER,LISTENER_SCAN1
Option -local will not modify any ASM configuration.
Do you want to continue (y - yes, n - no)? [n]: y
A log of this session will be written to: '/g01/grid/app/oraInventory/logs/deinstall_deconfig2014-10-07_08-19-39-AM.out'
Any error messages from this session will be written to: '/g01/grid/app/oraInventory/logs/deinstall_deconfig2014-10-07_08-19-39-AM.err'
######################## CLEAN OPERATION START ########################
ASM de-configuration trace file location: /g01/grid/app/oraInventory/logs/asmcadc_clean2014-10-07_08-22-21-AM.log
ASM Clean Configuration END
Network Configuration clean config START
Network de-configuration trace file location: /g01/grid/app/oraInventory/logs/netdc_clean2014-10-07_08-22-21-AM.log
De-configuring RAC listener(s): LISTENER,LISTENER_SCAN1
De-configuring listener: LISTENER
Stopping listener on node "edison2": LISTENER
Warning: Failed to stop listener. Listener may not be running.
Listener de-configured successfully.
De-configuring listener: LISTENER_SCAN1
Stopping listener on node "edison2": LISTENER_SCAN1
Warning: Failed to stop listener. Listener may not be running.
Listener 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 "edison2".
/tmp/deinstall2014-10-07_08-18-47AM/perl/bin/perl -I/tmp/deinstall2014-10-07_08-18-47AM/perl/lib -I/tmp/deinstall2014-10-07_08-18-47AM/crs/install /tmp/deinstall2014-10-07_08-18-47AM/crs/install/rootcrs.pl -force -deconfig -paramfile "/tmp/deinstall2014-10-07_08-18-47AM/response/deinstall_Ora11g_gridinfrahome1.rsp"
Press Enter after you finish running the above commands
<----------------------------------------
---------------------------------------->
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.
Press Enter after you finish running the above commands
<----------------------------------------
Remove the directory: /tmp/deinstall2014-10-07_08-18-47AM 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 '/g01/grid/app/11.2.0/grid' from the central inventory on the local node : Done
Delete directory '/g01/grid/app/11.2.0/grid' on the local node : Done
Delete directory '/g01/grid/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/deinstall2014-10-07_08-18-47AM' on node 'edison2'
## [END] Oracle install clean ##
######################### CLEAN OPERATION END #########################
####################### CLEAN OPERATION SUMMARY #######################
Following RAC listener(s) were de-configured successfully: LISTENER,LISTENER_SCAN1
Oracle Clusterware is stopped and successfully de-configured on node "edison2"
Oracle Clusterware is stopped and de-configured successfully.
Successfully detached Oracle home '/g01/grid/app/11.2.0/grid' from the central inventory on the local node.
Successfully deleted directory '/g01/grid/app/11.2.0/grid' on the local node.
Successfully deleted directory '/g01/grid/app/grid' on the local node.
Oracle Universal Installer cleanup was successful.
Oracle deinstall tool successfully cleaned up temporary directories.
#######################################################################
############# ORACLE DEINSTALL & DECONFIG TOOL END #############
[grid@edison2 ~]$


注意:上面脚本执行过程中有这么一段提示:

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 "edison2".
/tmp/deinstall2014-10-07_08-18-47AM/perl/bin/perl -I/tmp/deinstall2014-10-07_08-18-47AM/perl/lib -I/tmp/deinstall2014-10-07_08-18-47AM/crs/install /tmp/deinstall2014-10-07_08-18-47AM/crs/install/rootcrs.pl -force -deconfig -paramfile "/tmp/deinstall2014-10-07_08-18-47AM/response/deinstall_Ora11g_gridinfrahome1.rsp"
Press Enter after you finish running the above commands
<----------------------------------------


按照这个提示再另一个节点2的窗口以root用户执行提示的脚本:

/tmp/deinstall2014-10-07_08-18-47AM/perl/bin/perl -I/tmp/deinstall2014-10-07_08-18-47AM/perl/lib -I/tmp/deinstall2014-10-07_08-18-47AM/crs/install /tmp/deinstall2014-10-07_08-18-47AM/crs/install/rootcrs.pl -force -deconfig -paramfile "/tmp/deinstall2014-10-07_08-18-47AM/response/deinstall_Ora11g_gridinfrahome1.rsp"


执行完再回来回车建继续执行,否则会卡着不动!

另一个窗口执行提示的脚本的过程:

[root@edison2 ~]# /tmp/deinstall2014-10-07_08-18-47AM/perl/bin/perl -I/tmp/deinstall2014-10-07_08-18-47AM/perl/lib -I/tmp/deinstall2014-10-07_08-18-47AM/crs/install /tmp/deinstall2014-10-07_08-18-47AM/crs/install/rootcrs.pl -force -deconfig -paramfile "/tmp/deinstall2014-10-07_08-18-47AM/response/deinstall_Ora11g_gridinfrahome1.rsp"
Using configuration parameter file: /tmp/deinstall2014-10-07_08-18-47AM/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
[root@edison2 ~]#


5.6.在保留节点跟新inventory:

在节点1上grid执行:

[grid@edison1 ~]$ $ORACLE_HOME/oui/bin/runInstaller -updateNodeList ORACLE_HOME=/g01/grid/app/11.2.0/grid "CLUSTER_NODES=edison1" -silent
Starting Oracle Universal Installer...
Checking swap space: must be greater than 500 MB. Actual 5647 MB Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /g01/grid/app/oraInventory
'UpdateNodeList' was successful.
[grid@edison1 ~]$


5.7.CVU检查节点是否删除成功:

在节点1上grid用户执行:

[grid@edison1 ~]$ cluvfy stage -post nodedel -n edison2 -verbose
Performing post-checks for node removal
Checking CRS integrity...
Clusterware version consistency passed
The Oracle Clusterware is healthy on node "edison1"
CRS integrity check passed
Result:
Node removal check passed
Post-check for node removal was successful.
[grid@edison1 ~]$


6.1.验证:

[grid@edison1 ~]$ olsnodes -s
edison1 Active
[grid@edison1 ~]$
[grid@edison1 ~]$ olsnodes -n
edison1 1
[grid@edison1 ~]$
[grid@edison1 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.BACKUPDG.dg
ONLINE ONLINE edison1
ora.DATA.dg
ONLINE ONLINE edison1
ora.LISTENER.lsnr
ONLINE ONLINE edison1
ora.SYSTEMDG.dg
ONLINE ONLINE edison1
ora.asm
ONLINE ONLINE edison1 Started
ora.gsd
OFFLINE OFFLINE edison1
ora.net1.network
ONLINE ONLINE edison1
ora.ons
ONLINE ONLINE edison1
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE edison1
ora.cvu
1 OFFLINE OFFLINE
ora.edison1.vip
1 ONLINE ONLINE edison1
ora.oc4j
1 OFFLINE OFFLINE
ora.prod.db
1 ONLINE ONLINE edison1 Open
ora.prod.edison_taf.svc
1 ONLINE ONLINE edison1
ora.scan1.vip
1 ONLINE ONLINE edison1
[grid@edison1 ~]$
[grid@edison1 ~]$ ./crs_stat
Name Target State Host
------------------------------ ---------- --------- -------
ora.BACKUPDG.dg ONLINE ONLINE edison1
ora.DATA.dg ONLINE ONLINE edison1
ora.LISTENER.lsnr ONLINE ONLINE edison1
ora.LISTENER_SCAN1.lsnr ONLINE ONLINE edison1
ora.SYSTEMDG.dg ONLINE ONLINE edison1
ora.asm ONLINE ONLINE edison1
ora.cvu OFFLINE OFFLINE
ora.gsd OFFLINE OFFLINE
ora.edison1.ASM1.asm ONLINE ONLINE edison1
ora.edison1.LISTENER_edison1.lsnr ONLINE ONLINE edison1
ora.edison1.gsd OFFLINE OFFLINE
ora.edison1.ons ONLINE ONLINE edison1
ora.edison1.vip ONLINE ONLINE edison1
ora.net1.network ONLINE ONLINE edison1
ora.oc4j OFFLINE OFFLINE
ora.ons ONLINE ONLINE edison1
ora.prod.db ONLINE ONLINE edison1
ora.prod.edison_taf.svc ONLINE ONLINE edison1
ora.scan1.vip ONLINE ONLINE edison1
[grid@edison1 ~]$


6.2.清除残留文件:

在节点2上还可能有一些目录存在,使用以下命令清除:

清除家目录:

[root@edison2 ~]# rm -rf /g01/grid/11.2.0
[root@edison2 ~]# rm -rf /home/oracle


清除相关文件:

[root@edison2 ~]# rm -rf /tmp/.oracle
[root@edison2 ~]# rm -rf /var/tmp/.oracle
[root@edison2 ~]# rm -rf /etc/init/oracle-ohasd.conf
[root@edison2 ~]# rm -rf /etc/init.d/ohasd
[root@edison2 ~]# rm -rf /etc/init.d/init.ohasd
[root@edison2 ~]# rm -rf /etc/oraInst.loc
[root@edison2 ~]# rm -rf /etc/oratab
[root@edison2 ~]# rm -rf /etc/oracle


7.11gR2 添加删除节点小结:

11gR2 RAC添加节点分3个阶段:
(1)、第一阶段主要工作是复制GRID HOME到新节点,配置GRID,并且启动GRID,同时更新OCR信息,更新inventory信息。
(2)、第二阶段主要工作是复制RDBMS HOME到新节点,更新invertory信息。
(3)、第三阶段主要工作是DBCA创建新的数据库实例(包括创建undo表空间,redo log,初始化参数等),更新OCR信息(包括注册新的
数据库实例等)。

11gR2的卸载步骤正好和上面步骤相反。步骤还是三个步骤。

在添加、删除节点的过程中,原有的节点一直都是online状态,不需要停机,对客户端业务没有什么影响。新节点的ORACLE_BASE和
ORACLE_HOME路径在添加过程中会自动创建,无需手动创建。

注意事项:
(1)、在添加、删除节点,建议手工备份以下OCR,在某些情况下添加、删除节点失败,可以通过恢复原来的OCR来解决问题。
(2)、在正常安装11.2GRID时,OUI界面提供SSH配置功能,但是在添加节点脚本addNode.sh没有这个功能,因此需要手动配置oracle
用户和grid用户的SSH用户等效性。

该贴由system转至本版2014-11-19 9:34:51




赞(0)    操作        顶端 
总帖数
1
每页帖数
101/1页1
返回列表
发新帖子
请输入验证码: 点击刷新验证码
您需要登录后才可以回帖 登录 | 注册
技术讨论