oracle11gr2_rac_删除节点最佳实践

转载 2013年12月02日 13:47:58

分类: Linux

oracle 11gr2 删除节点最佳实践
oracle 11gr2 添加节点最佳实践可参见我的博文:
http://space.itpub.net/26143577/viewspace-742169
OS信息:
[grid@11grac1 ~]$ uname -a
Linux 11grac1 2.6.32-300.10.1.el5uek #1 SMP Wed Feb 22 17:22:40 EST 2012 i686 i686 i386 GNU/Linux
DB信息:
SQL> select * from v$version where rownum<5;
BANNER
------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
PL/SQL Release 11.2.0.1.0 - Production
CORE    11.2.0.1.0      Production
TNS for Linux: Version 11.2.0.1.0 - Production
查看当前资源状态
[grid@11grac1 ~]$ crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
ora....SM1.asm application    ONLINE    ONLINE    11grac1     
ora....C1.lsnr application    ONLINE    ONLINE    11grac1     
ora....ac1.gsd application    ONLINE    ONLINE    11grac1     
ora....ac1.ons application    ONLINE    ONLINE    11grac1     
ora....ac1.vip ora....t1.type ONLINE    ONLINE    11grac1     
ora....SM2.asm application    ONLINE    ONLINE    11grac2     
ora....C2.lsnr application    ONLINE    ONLINE    11grac2     
ora....ac2.gsd application    ONLINE    ONLINE    11grac2     
ora....ac2.ons application    ONLINE    ONLINE    11grac2     
ora....ac2.vip ora....t1.type ONLINE    ONLINE    11grac2     
ora.DATA.dg    ora....up.type ONLINE    ONLINE    11grac1     
ora....ER.lsnr ora....er.type ONLINE    ONLINE    11grac1     
ora....N1.lsnr ora....er.type ONLINE    ONLINE    11grac1     
ora.asm        ora.asm.type   ONLINE    ONLINE    11grac1     
ora.eons       ora.eons.type  ONLINE    ONLINE    11grac1     
ora.gsd        ora.gsd.type   ONLINE    ONLINE    11grac1     
ora....network ora....rk.type ONLINE    ONLINE    11grac1     
ora.oc4j       ora.oc4j.type  ONLINE    ONLINE    11grac1     
ora.ons        ora.ons.type   ONLINE    ONLINE    11grac1     
ora.racdb.db   ora....se.type ONLINE    ONLINE    11grac1     
ora.scan1.vip  ora....ip.type ONLINE    ONLINE    11grac1     
[grid@11grac1 ~]$ srvctl status database -d racdb
Instance racdb1 is running on node 11grac1
Instance racdb2 is running on node 11grac2
写入测试数据
[oracle@11grac1 ~]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.1.0 Production on Wed Aug 29 10:02:08 2012
Copyright (c) 1982, 2009, Oracle.  All rights reserved.
SQL> conn /as sysdba
Connected.
SQL> sho user
USER is "SYS"
SQL> create table test (id number,name varchar2(10));
Table created.
SQL> insert into test values (1,'yallonking');
1 row created.
SQL> commit;
Commit complete.
SQL> select * from test;
        ID NAME
---------- ----------
         1 yallonking
  
删除节点实例(可用DBCA,也可用后边的命令静默删除)
运行dbca,根据向导删除相关信息
instance management-> delete an instance-> 输入sysdba用户的账户和密码-> 选定删除的节点实例
[oracle@11grac1 ~]$ export DISPLAY=192.168.137.1:0.0
[oracle@11grac1 ~]$ dbca
查看数据库状态
[grid@11grac1 ~]$ srvctl status database -d racdb
Instance racdb1 is running on node 11grac1
[grid@11grac1 ~]$ crsctl check cluster -all
**************************************************************
11grac1:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************
11grac2:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************
[grid@11grac1 ~]$
删除EM
[oracle@11grac1 ~]$ emca -deconfig dbcontrol db -repos drop -cluster
STARTED EMCA at Aug 29, 2012 10:29:12 AM
EM Configuration Assistant, Version 11.2.0.0.2 Production
Copyright (c) 2003, 2005, Oracle.  All rights reserved.
Enter the following information:
Database unique name: racdb
Service name: racdb
Listener port number: 1521
Listener ORACLE_HOME [ /u01/11.2.0/grid ]: 
Password for SYS user:  
Password for SYSMAN user:  
Do you wish to continue? [yes(Y)/no(N)]: y
Aug 29, 2012 10:29:35 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/racdb/emca_2012_08_29_10_29_11.log.
Aug 29, 2012 10:29:36 AM oracle.sysman.emcp.EMDBPreConfig performDeconfiguration
WARNING: EM is not configured for this database. No EM-specific actions can be performed.
Aug 29, 2012 10:29:45 AM oracle.sysman.emcp.ParamsManager checkListenerStatusForDBControl
WARNING: Error initializing SQL connection. SQL operations cannot be performed
Aug 29, 2012 10:29:45 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Dropping the EM repository (this may take a while) ...
Aug 29, 2012 10:43:38 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
Enterprise Manager configuration completed successfully
FINISHED EMCA at Aug 29, 2012 10:43:38 AM
[oracle@11grac1 ~]$
备份OCR
[root@11grac1 ~]# /u01/11.2.0/grid/bin/ocrconfig -manualbackup
11grac1     2012/08/29 10:47:33     /u01/11.2.0/grid/cdata/racscan/backup_20120829_104733.ocr
[root@11grac1 ~]#
删除实例(静默状态下)
[oracle@11grac1 ~]$ dbca -silent -deleteinstance -nodelist 11grac2 -gdbname racdb -instancename racdb2 -sysdbausername sys -sysdbapassword oracle
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/racdb.log" for further details.
查看数据库配置信息
[oracle@11grac1 ~]$ srvctl config database -d racdb
Database unique name: racdb
Database name: racdb
Oracle home: /u01/app/oracle/product/11.2.0/db_1
Oracle user: oracle
Spfile: +DATA/racdb/spfileracdb.ora
Domain: 
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: racdb
Database instances: racdb1
Disk Groups: DATA
Services: 
Database is administrator managed
查看数据库实例和redo情况
[oracle@11grac1 ~]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.1.0 Production on Wed Aug 29 10:51:31 2012
Copyright (c) 1982, 2009, Oracle.  All rights reserved.
SQL> conn /as sysdba
Connected.
SQL> select inst_id,instance_name from gv$instance;
   INST_ID INSTANCE_NAME
---------- ----------------
         1 racdb1
SQL> select group#,thread# from v$log;
    GROUP#    THREAD#
---------- ----------
         1          1
         2          1
   
查看节点监听配置信息
[oracle@11grac2 ~]$ srvctl config listener -a
Name: LISTENER
Network: 1, Owner: grid
Home: <CRS home>
  /u01/11.2.0/grid on node(s) 11grac2,11grac1
End points: TCP:1521
更新oracle inventory
[oracle@11grac2 db_1]$ /u01/app/oracle/product/11.2.0/db_1/oui/bin/runInstaller -updateNodeList ORACLE_HOME=$ORACLE_HOME "CLUSTER_NODES={11grac2}" -local
Starting Oracle Universal Installer...
Checking swap space: must be greater than 500 MB.   Actual 4094 MB    Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /u01/app/oraInventory
'UpdateNodeList' was successful.
删除oracle软件
[oracle@11grac2 db_1]$ cd $ORACLE_HOME/deinstall
[oracle@11grac2 deinstall]$ ./deinstall -local
Checking for required files and bootstrapping ...
Please wait ...

更新oracle inventory
[oracle@11grac1 ~]$ $ORACLE_HOME/oui/bin/runInstaller -updatenodelist ORACLE_HOME=$ORACLE_HOME "CLUSTER_NODES={11grac1}"
Starting Oracle Universal Installer...
Checking swap space: must be greater than 500 MB.   Actual 3854 MB    Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /u01/app/oraInventory
'UpdateNodeList' was successful.

查看节点状态
[root@11grac1 ~]# /u01/11.2.0/grid/bin/olsnodes -s -t
11grac1 Active  Unpinned
11grac2 Active  Unpinned
禁用节点cluster
[root@11grac2 ~]# cd /u01/11.2.0/grid/crs/install/
[root@11grac2 install]# ./rootcrs.pl -deconfig -force
2012-08-29 11:06:54: Parsing the host name
2012-08-29 11:06:54: Checking for super user privileges
2012-08-29 11:06:54: User has super user privileges
Using configuration parameter file: ./crsconfig_params
VIP exists.:11grac1
VIP exists.: /11grac1-vip/192.168.137.163/255.255.255.0/eth0
VIP exists.:11grac2
VIP exists.: /11grac2-vip/192.168.137.164/255.255.255.0/eth0
GSD exists.
ONS daemon exists. Local port 6100, remote port 6200
eONS daemon exists. Multicast port 18611, multicast IP address 234.228.184.247, listening port 2016
ADVM/ACFS is not supported on oraclelinux-release-5-8.0.2
ACFS-9201: Not Supported
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on '11grac2'
CRS-2673: Attempting to stop 'ora.crsd' on '11grac2'
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on '11grac2'
CRS-2673: Attempting to stop 'ora.DATA.dg' on '11grac2'
CRS-2677: Stop of 'ora.DATA.dg' on '11grac2' succeeded
CRS-2673: Attempting to stop 'ora.asm' on '11grac2'
CRS-2677: Stop of 'ora.asm' on '11grac2' succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources on '11grac2' has completed
CRS-2677: Stop of 'ora.crsd' on '11grac2' succeeded
CRS-2673: Attempting to stop 'ora.mdnsd' on '11grac2'
CRS-2673: Attempting to stop 'ora.gpnpd' on '11grac2'
CRS-2673: Attempting to stop 'ora.cssdmonitor' on '11grac2'
CRS-2673: Attempting to stop 'ora.ctssd' on '11grac2'
CRS-2673: Attempting to stop 'ora.evmd' on '11grac2'
CRS-2673: Attempting to stop 'ora.asm' on '11grac2'
CRS-2677: Stop of 'ora.cssdmonitor' on '11grac2' succeeded
CRS-2677: Stop of 'ora.mdnsd' on '11grac2' succeeded
CRS-2677: Stop of 'ora.gpnpd' on '11grac2' succeeded
CRS-2677: Stop of 'ora.evmd' on '11grac2' succeeded
CRS-2677: Stop of 'ora.ctssd' on '11grac2' succeeded
CRS-2675: Stop of 'ora.asm' on '11grac2' failed
CRS-2679: Attempting to clean 'ora.asm' on '11grac2'
ORA-01089: immediate shutdown in progress - no operations are permitted
Process ID: 0
Session ID: 0 Serial number: 0
CRS-2681: Clean of 'ora.asm' on '11grac2' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on '11grac2'
CRS-2677: Stop of 'ora.cssd' on '11grac2' succeeded
CRS-2673: Attempting to stop 'ora.diskmon' on '11grac2'
CRS-2673: Attempting to stop 'ora.gipcd' on '11grac2'
CRS-2677: Stop of 'ora.gipcd' on '11grac2' succeeded
CRS-2677: Stop of 'ora.diskmon' on '11grac2' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on '11grac2' has completed
CRS-4133: Oracle High Availability Services has been stopped.
Successfully deconfigured Oracle clusterware stack on this node
[root@11grac2 install]#

查看节点状态
[grid@11grac1 ~]$ olsnodes -s -t
11grac1 Active  Unpinned
11grac2 Inactive        Unpinned
删除节点
[root@11grac1 ~]# /u01/11.2.0/grid/bin/crsctl delete node -n 11grac2
CRS-4661: Node 11grac2 successfully deleted.
查看节点状态
[root@11grac1 ~]# /u01/11.2.0/grid/bin/olsnodes -s -t
11grac1 Active  Unpinned
更新oracle inventory
[grid@11grac2 bin]$ pwd
/u01/11.2.0/grid/oui/bin
[grid@11grac2 bin]$ ./runInstaller -updateNodeList ORACLE_HOME=$ORACLE_HOME "CLUSTER_NODES={11grac2}" CRS=TRUE -local  
Starting Oracle Universal Installer...
Checking swap space: must be greater than 500 MB.   Actual 4094 MB    Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /u01/app/oraInventory
'UpdateNodeList' was successful.
删除GI软件
[grid@11grac2 deinstall]$ pwd
/u01/11.2.0/grid/deinstall
[grid@11grac2 deinstall]$ ./deinstall -local
Checking for required files and bootstrapping ...
Please wait ...
删除相关目录
[root@11grac2 install]# rm -rf /etc/oraInst.loc
[root@11grac2 install]# rm -rf /opt/ORCLfmap/
[root@11grac2 install]# rm -rf /u01
更新oracle inventory
[grid@11grac1 bin]$ pwd
/u01/11.2.0/grid/oui/bin
[grid@11grac1 bin]$ ./runInstaller -updateNodeList ORACLE_HOME=$ORACLE_HOME "CLUSTER_NODES={11grac1}" CRS=TRUE 
Starting Oracle Universal Installer...
Checking swap space: must be greater than 500 MB.   Actual 3826 MB    Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /u01/app/oraInventory
'UpdateNodeList' was successful.
删除后的验证
[grid@11grac1 bin]$ cluvfy stage -post nodedel -n 11grac2 -verbose
Performing post-checks for node removal
Checking CRS integrity...
The Oracle clusterware is healthy on node "11grac1"
CRS integrity check passed
 

Result: 
Node removal check passed
Post-check for node removal was successful.
查看节点资源信息
[grid@11grac1 ~]$ crsctl check cluster -all
**************************************************************
11grac1:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************
[grid@11grac1 ~]$ crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
ora....SM1.asm application    ONLINE    ONLINE    11grac1     
ora....C1.lsnr application    ONLINE    ONLINE    11grac1     
ora....ac1.gsd application    ONLINE    ONLINE    11grac1     
ora....ac1.ons application    ONLINE    ONLINE    11grac1     
ora....ac1.vip ora....t1.type ONLINE    ONLINE    11grac1     
ora.DATA.dg    ora....up.type ONLINE    ONLINE    11grac1     
ora....ER.lsnr ora....er.type ONLINE    ONLINE    11grac1     
ora....N1.lsnr ora....er.type ONLINE    ONLINE    11grac1     
ora.asm        ora.asm.type   ONLINE    ONLINE    11grac1     
ora.eons       ora.eons.type  ONLINE    ONLINE    11grac1     
ora.gsd        ora.gsd.type   ONLINE    ONLINE    11grac1     
ora....network ora....rk.type ONLINE    ONLINE    11grac1     
ora.oc4j       ora.oc4j.type  ONLINE    ONLINE    11grac1     
ora.ons        ora.ons.type   ONLINE    ONLINE    11grac1     
ora.racdb.db   ora....se.type ONLINE    ONLINE    11grac1     
ora.scan1.vip  ora....ip.type ONLINE    ONLINE    11grac1     
[grid@11grac1 ~]$

验证测试数据
Microsoft Windows [版本 6.1.7600]
版权所有 (c) 2009 Microsoft Corporation。保留所有权利。
C:\Users\YallonKing>sqlplus /nolog
SQL*Plus: Release 11.2.0.1.0 Production on 星期三 8月 29 12:29:43 2012
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
SQL> conn sys/oracle@racdb_11g as sysdba
已连接。
SQL> select instance_name from gv$instance;
INSTANCE_NAME
--------------------------------
racdb1
SQL> select * from test;
        ID NAME
---------- --------------------
         1 yallonking
剩下的就是删除被删除节点的GI和ORACLE相关文件、用户、组、裸设备、网络设置等信息。
至此,OK!

oracle11gr2_rac_添加节点最佳实践

oracle11gr2_rac_添加节点最佳实践  分类: Linux oracle 11gr2 添加节点最佳实践 OS信息: [grid@11grac1 ~]$ ...
  • ycgjdb
  • ycgjdb
  • 2013年12月02日 13:45
  • 881

Greenplum在企业生产中的最佳实践(下)

原文地址 今天,我们将分享国内客户在使用GP时遇到的问题及相关建议。同时,架构师就大家经常遇到的技术问题进行了细致的说明,相信对您有所启迪! 第一个案例——底层数据文件报错处理 ...
  • yunqishequ1
  • yunqishequ1
  • 2017年08月03日 13:50
  • 261

《软件需求最佳实践》与《掌握需求过程》对比

最近公司要考察需求技能,抱着总结经验,提升技能的心态,看了两本关于需求的书籍,一本是被公司奉为需求人员教科书的《软件需求最佳实践》徐峰著,一本是《掌握需求过程第三版》James Robertson著。...
  • happymatilian
  • happymatilian
  • 2016年10月27日 16:40
  • 1642

20个数据库设计最佳实践

能够最佳的使用好数据库需要扎实的基础,下面文章详细的说明了20个数据库设计的最佳实践,很适合是实习的程序员学习。 使用明确、统一的标明和列名,例如 Sch...
  • www19940501a
  • www19940501a
  • 2013年07月01日 23:43
  • 969

用spring 集成mybatis的最佳实践

第一篇博文,欢迎各位大神拍砖
  • yeluochengshang
  • yeluochengshang
  • 2014年09月24日 01:46
  • 1399

Java异常处理手册和最佳实践

Java异常处理框架是非常强大并且很容易理解和使用,异常可能产生于不同的情况,例如:用户错误数据的输入,硬件故障,网络连接失败,数据服务器故障等等,下面我们需要学习在java中如何处理这些异常。在程序...
  • hp910315
  • hp910315
  • 2015年10月21日 15:26
  • 2678

Android开发最佳实践

 原文链接:https://github.com/futurice/android-best-practices 转载来源:http://blog.csdn.net/asce1885/arti...
  • myhui123
  • myhui123
  • 2015年02月10日 11:47
  • 6757

WEB前端开发最佳实践(1)

前端代码重构 删除无用代码,精简代码(不起作用的CSS样式和废弃的JavaScript函数) 前端代码规范化,把CSS代码放到独立的文件中,在JS定义局部变量,把部分全局变量改变成局部变量 整理基础类...
  • qq_17358905
  • qq_17358905
  • 2016年05月08日 10:17
  • 1374

业内docker技巧和最佳实践的想法

业内docker技巧和最佳实践的想法
  • yangzhenping
  • yangzhenping
  • 2015年01月20日 16:50
  • 3251

RESTful API 设计最佳实践(6)

RESTful API 设计最佳实践(6) 在本文中,将重点介绍一些实际设计RESTful API的建议,这些API是基于HTTP协议设计的。这些建议是参考网上一些好的资料并结合自己实际经验做了更加...
  • Linux2_SCDN
  • Linux2_SCDN
  • 2016年09月22日 10:03
  • 1002
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:oracle11gr2_rac_删除节点最佳实践
举报原因:
原因补充:

(最多只允许输入30个字)