Oracle11gR2 RAC添加节点

RHEL5.5 ORACLE11gR2 RAC 2节点


  • 安装操作系统并配置yum源 安装oracle所需要的包

点击(此处)折叠或打开

  1. [root@node3 ~]# cat /etc/yum.repos.d/oracle.repo
  2. [server]
  3. name=oracle
  4. baseurl=file:///mnt/Server
  5. enabled=1
  6. gpgcheck=0
  7. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release


  •  配置node3各种参数

修改每个节点的 /etc/hosts

点击(此处)折叠或打开

  1. [root@node3 ~]# cat /etc/hosts
  2. # Do not remove the following line, or various programs
  3. # that require network functionality will fail.
  4. 127.0.0.1 node3.rac node3 localhost.localdomain localhost
  5. ::1 localhost6.localdomain6 localhost6
  6. #Public
  7. 192.168.0.231 node1
  8. 192.168.0.232 node2
  9. 192.168.0.233 node3
  10. #Virtual
  11. 192.168.0.221 node1-vip
  12. 192.168.0.222 node2-vip
  13. 192.168.0.223 node3-vip
  14. #Private
  15. 192.168.8.20 node1-priv
  16. 192.168.8.24 node2-priv
  17. 192.168.8.27 node3-priv

[root@node3 ~]# /sbin/service ntpd stop
Shutting down ntpd:                                        [FAILED]
[root@node3 ~]# /sbin/service ntpd status
ntpd is stopped
[root@node3 ~]# chkconfig ntpd off
[root@node3 ~]# mv /etc/ntp.conf /etc/ntp.conf.bak


配置系统内核参数,以root用户登录,修改在/etc/sysctl.conf文件,在该文件中添加以下参数
#Install oracle setting
fs.aio-max-nr = 1048576
fs.file-max = 6815744
#kernel.shmall = 4294967296
#kernel.shmmax = 68719476736
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
完成后,运行以下命令激活更改:
[root@rac1 ~]# /sbin/sysctl -p


创建grid和oracle用户,在每一个节点操作
groupadd -g 1000 oinstall
groupadd -g 1020 asmadmin
groupadd -g 1021 asmdba
groupadd -g 1022 asmoper
useradd -u 1100 -g oinstall -G asmadmin,asmdba -c "Grid Infrastructure Owner" grid
groupadd -g 1300 dba
groupadd -g 1301 oper
useradd -u 1101 -g oinstall -G dba,asmdba -c "Oracle Software Owner" oracle
passwd oracle
passwd grid
--创建oracle和grid的Oracle Base目录
mkdir -p /u01/app/11.2.0/grid
mkdir -p /u01/app/grid
chown -R grid:oinstall /u01
mkdir -p /u01/app/oracle
chown oracle:oinstall /u01/app/oracle
chmod -R 775 /u01
--配置grid,oralce用户环境变量
[grid@rac1 ~]$ vi .bash_profile
export PATH
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/11.2.0/grid
export PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_SID=+ASM3
umask=022
stty erase ^H
# stty erase ^H 由于终端默认ctrl + backspace 为删除 操作很不方便,这样设置后 直接backspace就能删除了

[oracle@rac1 ~]$ vi .bash_profile
export PATH
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_SID=rac3
umask=022
stty erase ^H

--设置用户资源限制
在文件 /etc/security/limits.conf 加以下参数:

#Install oracle setting
oracle              soft    nproc   2047
oracle              hard    nproc   16384
oracle              soft    nofile  1024
oracle              hard    nofile  65536
oracle              soft    stack   10240
grid                soft    nproc   2047
grid                hard    nproc   16384
grid                soft    nofile  1024
grid                hard    nofile  65536
grid                soft    stack   10240

配置SSH互信(grid和oracle用户下)

点击(此处)折叠或打开

  1. mkdir 755 .ssh
  2. ssh-keygen -t rsa
  3. ssh-keygen -t dsa
  4. cd .ssh
  5. cat id_rsa.pub id_rsa2.pub id_rsa3.pub id_dsa.pub id_dsa2.pub id_dsa3.pub>>authorized_keys

将节点3关机,配置共享磁盘并安装ASM包

点击(此处)折叠或打开

  1. [root@node3 yum.repos.d]# yum repolist
  2. Loaded plugins: rhnplugin, security
  3. This system is not registered with RHN.
  4. RHN support will be disabled.
  5. repo id repo name status
  6. oracleasm Oracle ASMLib Kernel Drivers for Red Hat Enterprise enabled: 176
  7. server oracle enabled: 3,116
  8. repolist: 3,292
  9. [root@node3 yum.repos.d]#









 [root@node3 ~]# rpm -qa|grep oracleasm
oracleasm-2.6.18-194.el5-2.0.5-1.el5
oracleasm-support-2.1.8-1.el5
oracleasmlib-2.0.4-1.el5
[root@node3 ~]#

点击(此处)折叠或打开

  1. [root@node3 ~]# /usr/sbin/oracleasm status
  2. Checking if ASM is loaded: no
  3. Checking if /dev/oracleasm is mounted: no
  4. [root@node3 ~]# /usr/sbin/oracleasm configure -i
  5. Configuring the Oracle ASM library driver.
  6. This will configure the on-boot properties of the Oracle ASM library
  7. driver. The following questions will determine whether the driver is
  8. loaded on boot and what permissions it will have. The current values
  9. will be shown in brackets ('[]'). Hitting without typing an
  10. answer will keep that current value. Ctrl-C will abort.
  11. Default user to own the driver interface []: grid
  12. Default group to own the driver interface []: asmadmin
  13. Start Oracle ASM library driver on boot (y/n) [n]: y
  14. Scan for Oracle ASM disks on boot (y/n) [y]: y
  15. Writing Oracle ASM library driver configuration: done
  16. [root@node3 ~]# /usr/sbin/oracleasm init
  17. Creating /dev/oracleasm mount point: /dev/oracleasm
  18. Loading module "oracleasm": oracleasm
  19. Mounting ASMlib driver filesystem: /dev/oracleasm
  20. [root@node3 ~]# /usr/sbin/oracleasm status
  21. Checking if ASM is loaded: yes
  22. Checking if /dev/oracleasm is mounted: yes
  23. [root@node3 ~]# /usr/sbin/oracleasm scandisks
  24. Reloading disk partitions: done
  25. Cleaning any stale ASM disks...
  26. Scanning system for ASM disks...
  27. Instantiating disk "VOL1"
  28. Instantiating disk "VOL2"
  29. Instantiating disk "VOL3"
  30. [root@node3 ~]# /usr/sbin/oracleasm listdisks
  31. VOL1
  32. VOL2
  33. VOL3
  34. [root@node3 ~]#
参考: http://blog.itpub.net/29065182/viewspace-1071584/

已有节点rac1、rac2,下面做的是添加节点rac3

rac3先安装下cvuqdisk包,这个包在GI安装文件中有。
/home/grid/grid/rpm
[root@rac3 rpm]# rpm -ivh cvuqdisk-1.0.9-1.rpm


1.rac3节点添加集群软件GI
①检查rac3是否满足rac安装条件(在已经有节点下面用grid,oracle用户执行)
[root@rac1 ~]# su - grid
[grid@rac1 ~]$ cluvfy stage -pre nodeadd -n rac3 -fixup -verbose
[grid@rac1 ~]$ cluvfy stage -post hwos -n rac3
 
②添加新节点的软件
在已经有节点下面执行这个命令添加新节点的集群软件(grid用户执行)
[root@rac1 ~]# su - grid
[grid@rac1 ~]$  /app/grid/product/11.2.0/grid/oui/bin/addNode.sh -silent "CLUSTER_NEW_NODES={rac3}" "CLUSTER_NEW_VIRTUAL_HOSTNAMES={rac3-vip}" "CLUSTER_NEW_PRIVATE_NODE_NAMES={vrh3-priv}" #用grid用户执行
运行提示的root.sh脚本
 /app/oraInventory/orainstRoot.sh                                                                        #在新节点 rac3用root用户执行 
/app/grid/product/11.2.0/grid/root.sh                                                                    #在新节点rac3用root用户执行
#On nodes rac3#在节点 rac3用root用户执行#在节点 rac3用root用户执行

③验证集群软件是否添加成功
[grid@rac1 bin]$ cluvfy stage -post nodeadd -n rac3 -verbose


2.添加新节点数据库
①为新节点安装数据库软件(在已经有节点下用oracle用户执行)
[root@rac1 ~]# su - oracle
[oracle@rac1 ~]$ /app/oracle/product/11.2.0/db_1/oui/bin/addNode.sh -silent "CLUSTER_NEW_NODES={rac3}"      
运行提示的root.sh脚本
    #在新节点 rac3用root用户执行                                                                
  /app/oracle/product/11.2.0/db_1/root.sh                                                            

②添加实例
[oracle@rac1 ~]$ dbca
或用命令行直接添加实例(在已经有节点下面用oracle用户执行)
[oracle@rac1 ~]$ dbca -silent -addInstance -nodeList rac3 -gdbName orcl -instanceName orcl3 -sysDBAUserName sys -sysDBAPassword "***"   在oracle用户下面执行


3.验证已添加实例
查看活动的实例:
[oracle@rac1 ~]$ sqlplus / as sysdba
SQL> select thread#,status,instance from gv$thread;

[root@rac1 ~]# crs_stat -t
[root@rac1 ~]# crsctl status resource -t

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/30305095/viewspace-2121123/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/30305095/viewspace-2121123/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值