Chinaunix首页 | 论坛 | 博客
  • 博客访问: 239135
  • 博文数量: 59
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 592
  • 用 户 组: 普通用户
  • 注册时间: 2014-04-01 12:51
个人简介

你们都是我的客户,所以,我对你们是透明的

文章分类

全部博文(59)

文章存档

2016年(29)

2015年(30)

分类: Oracle

2016-04-04 22:21:34

删除节点
1、关闭二节点监听
[oracle@rac1 dbs]$ srvctl disable listener -l LISTENER -n rac2
[oracle@rac1 dbs]$ srvctl stop listener -l LISTENER -n rac2

2、关闭二节点实例
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

3、disable 二节点
SQL> ALTER DATABASE DISABLE THREAD 2;
Database altered.

4、更新一节点inentory
[oracle@rac1 dbs]$ /oracle/app/oracle/product/11.2.0/dbhome_1/oui/bin/runInstaller -updateNodeList ORACLE_HOME=/oracle/app/oracle/product/11.2.0/dbhome_1 "CLUSTER_NODES=rac1"
Starting Oracle Universal Installer...
Checking swap space: must be greater than 500 MB.   Actual 3996 MB    Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /oracle/app/oraInventory
'UpdateNodeList' was successful.
[oracle@rac1 dbs]$

5、确认unpinned
[grid@rac1 ~]$ olsnodes -s -t
rac1    Active  Unpinned
rac2    Active  Unpinned
[grid@rac1 ~]$

6、删除二节点grid配置信息
[root@rac2 ~]# /oracle/app/11.2.0/grid/crs/install/rootcrs.pl -deconfig -deinstall -force
Using configuration parameter file: /oracle/app/11.2.0/grid/crs/install/crsconfig_params
Network exists: 1/192.168.56.0/255.255.255.0/, type static
VIP exists: /rac1-vip/192.168.56.103/192.168.56.0/255.255.255.0/, hosting node rac1
VIP exists: /rac2-vip/192.168.56.104/192.168.56.0/255.255.255.0/, hosting node rac2
GSD exists
ONS exists: Local port 6100, remote port 6200, EM port 2016
CRS-2673: Attempting to stop 'ora.registry.acfs' on 'rac2'
CRS-2677: Stop of 'ora.registry.acfs' on 'rac2' succeeded
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'rac2'
CRS-2673: Attempting to stop 'ora.crsd' on 'rac2'
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'rac2'
CRS-2673: Attempting to stop 'ora.DATA.dg' on 'rac2'
CRS-2673: Attempting to stop 'ora.OCRVT.dg' on 'rac2'
CRS-2677: Stop of 'ora.DATA.dg' on 'rac2' succeeded
CRS-2677: Stop of 'ora.OCRVT.dg' on 'rac2' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'rac2'
CRS-2677: Stop of 'ora.asm' on 'rac2' succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'rac2' has completed
CRS-2677: Stop of 'ora.crsd' on 'rac2' succeeded
CRS-2673: Attempting to stop 'ora.crf' on 'rac2'
CRS-2673: Attempting to stop 'ora.ctssd' on 'rac2'
CRS-2673: Attempting to stop 'ora.evmd' on 'rac2'
CRS-2673: Attempting to stop 'ora.asm' on 'rac2'
CRS-2673: Attempting to stop 'ora.drivers.acfs' on 'rac2'
CRS-2673: Attempting to stop 'ora.mdnsd' on 'rac2'
CRS-2677: Stop of 'ora.crf' on 'rac2' succeeded
CRS-2677: Stop of 'ora.evmd' on 'rac2' succeeded
CRS-2677: Stop of 'ora.mdnsd' on 'rac2' succeeded
CRS-2677: Stop of 'ora.asm' on 'rac2' succeeded
CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'rac2'
CRS-2677: Stop of 'ora.ctssd' on 'rac2' succeeded
CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'rac2' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'rac2'
CRS-2677: Stop of 'ora.cssd' on 'rac2' succeeded
CRS-2673: Attempting to stop 'ora.gipcd' on 'rac2'
CRS-2677: Stop of 'ora.drivers.acfs' on 'rac2' succeeded
CRS-2677: Stop of 'ora.gipcd' on 'rac2' succeeded
CRS-2673: Attempting to stop 'ora.gpnpd' on 'rac2'
CRS-2677: Stop of 'ora.gpnpd' on 'rac2' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'rac2' has completed
CRS-4133: Oracle High Availability Services has been stopped.
Removing Trace File Analyzer
Successfully deconfigured Oracle clusterware stack on this node
[root@rac2 ~]#

7、删除二节点
/oracle/app/11.2.0/grid/bin/crsctl delete node -n rac2(一节点root执行)
[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/crsctl delete node -n rac2
CRS-4661: Node rac2 successfully deleted.
[root@rac1 ~]#


8、一节点更新inventory信息
[grid@rac01 ~]$ /oracle/app/11.2.0/grid/oui/bin/runInstaller -updateNodeList ORACLE_HOME=/oracle/app/11.2.0/grid  "CLUSTER_NODES=rac1" CRS=TRUE -silent
Starting Oracle Universal Installer...
Checking swap space: must be greater than 500 MB.   Actual 3537 MB    Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /oracle/app/oraInventory
'UpdateNodeList' was successful.

9、检查整个删除过程
[grid@rac1 ~]$ cluvfy stage -post nodedel -n rac2 -verbose
Performing post-checks for node removal
Checking CRS integrity...
Clusterware version consistency passed
The Oracle Clusterware is healthy on node "rac1"
CRS integrity check passed
Result:
Node removal check passed
Post-check for node removal was successful.
[grid@rac1 ~]$

添加节点
1、预检查中ntp的问题可以忽略,其他问题请确认
cluvfy stage -pre nodeadd -n rac2 -verbos

2、添加grid
export IGNORE_PREADDNODE_CHECKS=Y
[grid@rac01 bin]$ /oracle/app/11.2.0/grid/oui/bin/addNode.sh "CLUSTER_NEW_NODES={rac2}" "CLUSTER_NEW_VIRTUAL_HOSTNAMES={rac2-vip}"
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB.   Actual 3541 MB    Passed
Oracle Universal Installer, Version 11.2.0.4.0 Production
Copyright (C) 1999, 2013, Oracle. All rights reserved.


Performing tests to see whether nodes rac2 are available
............................................................... 100% Done.

...
-----------------------------------------------------------------------------
Cluster Node Addition Summary
Global Settings
   Source: /oracle/app/11.2.0/grid
   New Nodes
Space Requirements
   New Nodes
      rac2
         /: Required 4.58GB : Available 19.02GB
Installed Products
   Product Names
      Oracle Grid Infrastructure 11g 11.2.0.4.0
      Java Development Kit 1.5.0.51.10
      Installer SDK Component 11.2.0.4.0
      Oracle One-Off Patch Installer 11.2.0.3.4
      Oracle Universal Installer 11.2.0.4.0
      Oracle RAC Required Support Files-HAS 11.2.0.4.0
      Oracle USM Deconfiguration 11.2.0.4.0
      Oracle Configuration Manager Deconfiguration 10.3.1.0.0
      Enterprise Manager Common Core Files 10.2.0.4.5
      Oracle DBCA Deconfiguration 11.2.0.4.0
      Oracle RAC Deconfiguration 11.2.0.4.0
      Oracle Quality of Service Management (Server) 11.2.0.4.0
      Installation Plugin Files 11.2.0.4.0
      Universal Storage Manager Files 11.2.0.4.0
      Oracle Text Required Support Files 11.2.0.4.0
      Automatic Storage Management Assistant 11.2.0.4.0
      Oracle Database 11g Multimedia Files 11.2.0.4.0
      Oracle Multimedia Java Advanced Imaging 11.2.0.4.0
      Oracle Globalization Support 11.2.0.4.0
      Oracle Multimedia Locator RDBMS Files 11.2.0.4.0
      Oracle Core Required Support Files 11.2.0.4.0
      Bali Share 1.1.18.0.0
      Oracle Database Deconfiguration 11.2.0.4.0
      Oracle Quality of Service Management (Client) 11.2.0.4.0
      Expat libraries 2.0.1.0.1
      Oracle Containers for Java 11.2.0.4.0
      Perl Modules 5.10.0.0.1
      Secure Socket Layer 11.2.0.4.0
      Oracle JDBC/OCI Instant Client 11.2.0.4.0
      Oracle Multimedia Client Option 11.2.0.4.0
      LDAP Required Support Files 11.2.0.4.0
      Character Set Migration Utility 11.2.0.4.0
      Perl Interpreter 5.10.0.0.2
      PL/SQL Embedded Gateway 11.2.0.4.0
      OLAP SQL Scripts 11.2.0.4.0
      Database SQL Scripts 11.2.0.4.0
      Oracle Extended Windowing Toolkit 3.4.47.0.0
      SSL Required Support Files for InstantClient 11.2.0.4.0
      SQL*Plus Files for Instant Client 11.2.0.4.0
      Oracle Net Required Support Files 11.2.0.4.0
      Oracle Database User Interface 2.2.13.0.0
      RDBMS Required Support Files for Instant Client 11.2.0.4.0
      RDBMS Required Support Files Runtime 11.2.0.4.0
      XML Parser for Java 11.2.0.4.0
      Oracle Security Developer Tools 11.2.0.4.0
      Oracle Wallet Manager 11.2.0.4.0
      Enterprise Manager plugin Common Files 11.2.0.4.0
      Platform Required Support Files 11.2.0.4.0
      Oracle JFC Extended Windowing Toolkit 4.2.36.0.0
      RDBMS Required Support Files 11.2.0.4.0
      Oracle Ice Browser 5.2.3.6.0
      Oracle Help For Java 4.2.9.0.0
      Enterprise Manager Common Files 10.2.0.4.5
      Deinstallation Tool 11.2.0.4.0
      Oracle Java Client 11.2.0.4.0
      Cluster Verification Utility Files 11.2.0.4.0
      Oracle Notification Service (eONS) 11.2.0.4.0
      Oracle LDAP administration 11.2.0.4.0
      Cluster Verification Utility Common Files 11.2.0.4.0
      Oracle Clusterware RDBMS Files 11.2.0.4.0
      Oracle Locale Builder 11.2.0.4.0
      Oracle Globalization Support 11.2.0.4.0
      Buildtools Common Files 11.2.0.4.0
      HAS Common Files 11.2.0.4.0
      SQL*Plus Required Support Files 11.2.0.4.0
      XDK Required Support Files 11.2.0.4.0
      Agent Required Support Files 10.2.0.4.5
      Parser Generator Required Support Files 11.2.0.4.0
      Precompiler Required Support Files 11.2.0.4.0
      Installation Common Files 11.2.0.4.0
      Required Support Files 11.2.0.4.0
      Oracle JDBC/THIN Interfaces 11.2.0.4.0
      Oracle Multimedia Locator 11.2.0.4.0
      Oracle Multimedia 11.2.0.4.0
      Assistant Common Files 11.2.0.4.0
      Oracle Net 11.2.0.4.0
      PL/SQL 11.2.0.4.0
      HAS Files for DB 11.2.0.4.0
      Oracle Recovery Manager 11.2.0.4.0
      Oracle Database Utilities 11.2.0.4.0
      Oracle Notification Service 11.2.0.3.0
      SQL*Plus 11.2.0.4.0
      Oracle Netca Client 11.2.0.4.0
      Oracle Advanced Security 11.2.0.4.0
      Oracle JVM 11.2.0.4.0
      Oracle Internet Directory Client 11.2.0.4.0
      Oracle Net Listener 11.2.0.4.0
      Cluster Ready Services Files 11.2.0.4.0
      Oracle Database 11g 11.2.0.4.0
-----------------------------------------------------------------------------


Instantiating scripts for add node (Sunday, March 27, 2016 3:25:03 AM CST)
.                                                                 1% Done.
Instantiation of add node scripts complete

Copying to remote nodes (Sunday, March 27, 2016 3:25:09 AM CST)
...............................................................................................                                 96% Done.
Home copied to new nodes

Saving inventory on nodes (Sunday, March 27, 2016 3:35:15 AM CST)
.                                                               100% Done.
Save inventory complete
WARNING:A new inventory has been created on one or more nodes in this session. However, it has not yet been registered as the central inventory of this system.
To register the new inventory please run the script at '/oracle/app/oraInventory/orainstRoot.sh' with root privileges on nodes 'rac2'.
If you do not register the inventory, you may not be able to update or patch the products you installed.
The following configuration scripts need to be executed as the "root" user in each new cluster node. Each script in the list below is followed by a list of nodes.
/oracle/app/oraInventory/orainstRoot.sh #On nodes rac2
/oracle/app/11.2.0/grid/root.sh #On nodes rac2
To execute the configuration scripts:
    1. Open a terminal window
    2. Log in as "root"
    3. Run the scripts in each cluster node
    
The Cluster Node Addition of /oracle/app/11.2.0/grid was successful.
Please check '/tmp/silentInstall.log' for more details.
[grid@rac01 bin]$


二节点执行root脚本
[root@rac2 etc]# /oracle/app/oraInventory/orainstRoot.sh
Creating the Oracle inventory pointer file (/etc/oraInst.loc)
Changing permissions of /oracle/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

Changing groupname of /oracle/app/oraInventory to oinstall.
The execution of the script is complete.
[root@rac2 etc]# /oracle/app/11.2.0/grid/root.sh
Performing root user operation for Oracle 11g

The following environment variables are set as:
    ORACLE_OWNER= grid
    ORACLE_HOME=  /oracle/app/11.2.0/grid

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.


Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Using configuration parameter file: /oracle/app/11.2.0/grid/crs/install/crsconfig_params
Creating trace directory
User ignored Prerequisites during installation
Installing Trace File Analyzer
OLR initialization - successful
Adding Clusterware entries to upstart
CRS-4402: The CSS daemon was started in exclusive mode but found an active CSS daemon on node rac01, number 1, and is terminating
An active cluster was found during exclusive startup, restarting to join the cluster
clscfg: EXISTING configuration version 5 detected.
clscfg: version 5 is 11g Release 2.
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
Preparing packages for installation...
cvuqdisk-1.0.9-1
Configure Oracle Grid Infrastructure for a Cluster ... succeeded
[root@rac2 etc]#

3、检查是否添加成功
cluvfy stage -post nodeadd -n rac2

4、添加rdbms
/oracle/app/oracle/product/11.2.0/dbhome_1/oui/bin/addNode.sh "CLUSTER_NEW_NODES={rac2}"

5、二节点instance启动
5.1创建二节点redolog
alter database add logfile thread 2 group 3  '+DATA/orcl/redo03.log' size 50m reuse;
alter database add logfile thread 2 group 4  '+DATA/orcl/redo04.log' size 50m reuse;

5.2创建UNDO2
SQL> create undo tablespace undo2 datafile '/oracle/oradata/orcl/undo2.dbf' size 20m autoextend off;
Tablespace created.

5.3enable 二节点
ALTER DATABASE ENABLE THREAD 2;

5.4一节点创建pfile
SQL> create pfile='/home/oracle/initorcl.ora' from spfile;
File created.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit

5.5修改spfile
pfile内容
orcl2.__db_cache_size=289406976
orcl1.__db_cache_size=281018368
orcl2.__java_pool_size=4194304
orcl1.__java_pool_size=4194304
orcl2.__large_pool_size=8388608
orcl1.__large_pool_size=8388608
orcl1.__oracle_base='/oracle/app/oracle'#ORACLE_BASE set from environment
orcl2.__pga_aggregate_target=339738624
orcl1.__pga_aggregate_target=339738624
orcl2.__sga_target=503316480
orcl1.__sga_target=503316480
orcl2.__shared_io_pool_size=0
orcl1.__shared_io_pool_size=0
orcl2.__shared_pool_size=192937984
orcl1.__shared_pool_size=201326592
orcl2.__streams_pool_size=0
orcl1.__streams_pool_size=0
*.audit_file_dest='/oracle/app/oracle/admin/orcl/adump'
*.audit_trail='none'
*.cluster_database=true
*.compatible='11.2.0.4.0'
*.control_files='+DATA/orcl/control01.ctl','+DATA/orcl/control02.ctl'
*.db_block_size=8192
*.db_domain=''
*.db_name='orcl'
*.diagnostic_dest='/oracle/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)'
orcl1.instance_number=1
*.memory_target=839909376
*.open_cursors=300
*.processes=150
*.remote_listener='rac-scan:1521'
*.remote_login_passwordfile='exclusive'
orcl1.thread=1
orcl1.undo_tablespace='UNDOTBS1'

修改pfile。添加
orcl2.thread=2
orcl2.instance_number=2
orcl2.undo_tablespace='UNDOTBS2'

两个节点pfile启动看看
SQL> startup pfile='/home/oracle/initorcl.ora';
ORACLE instance started.
Total System Global Area  254738432 bytes
Fixed Size                  2252176 bytes
Variable Size             197132912 bytes
Database Buffers           50331648 bytes
Redo Buffers                5021696 bytes
Database mounted.
Database opened.

然后创建spfile
SQL> create spfile='+DATA/orcl/spfileorcl.ora' from pfile='/home/oracle/initorcl.ora';
File created.


遇到的问题:
1、二节点添加集群失败
[grid@rac1 ~]$ /oracle/app/11.2.0/grid/oui/bin/addNode.sh "CLUSTER_NEW_NODES={rac2}" "CLUSTER_NEW_VIRTUAL_HOSTNAMES={rac2-vip}"
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB.   Actual 4082 MB    Passed
Oracle Universal Installer, Version 11.2.0.4.0 Production
Copyright (C) 1999, 2013, Oracle. All rights reserved.


Performing tests to see whether nodes rac2,rac2 are available
............................................................... 100% Done.

Error ocurred while retrieving node numbers of the existing nodes. Please check if clusterware home is properly configured.
SEVERE:Error ocurred while retrieving node numbers of the existing nodes. Please check if clusterware home is properly configured.


第一次添加失败后新的节点信息已经写入了inventory
更新一节点inventory后继续
[grid@rac1 ~]$ /oracle/app/11.2.0/grid/oui/bin/runInstaller -updateNodeList ORACLE_HOME=/oracle/app/11.2.0/grid  "CLUSTER_NODES=rac1" CRS=TRUE -silent
Starting Oracle Universal Installer...

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



说明:以上步骤为快捷版,并没有删除二节点grid和oracle的步骤。非官方文档步骤。如果删除的二节点还要继续使用(如做添加试验),请分别删除grid用户和oracle用户$ORACLE_BASE下的内容,并删除/etc面ora开头的目录和文件,如cd /etc,rm -rf ora*




阅读(3899) | 评论(0) | 转发(0) |
0

上一篇:exp/imp和expdp/impdp

下一篇:11g RAC半自动打psu

给主人留下些什么吧!~~