代码改变世界

Linux平台 Oracle 11gR2 RAC安装Part2:GI安装

2015-07-27 17:23  AlfredZhao  阅读(...)  评论(... 编辑 收藏

三、GI(Grid Infrastructure)安装

Linux平台 Oracle 11gR2 RAC安装指导:
Part1:Linux平台 Oracle 11gR2 RAC安装Part1:准备工作
Part2:Linux平台 Oracle 11gR2 RAC安装Part2:GI安装
Part3:Linux平台 Oracle 11gR2 RAC安装Part3:DB安装

三、GI(Grid Infrastructure)安装

3.1 解压GI的安装包

首先grid用户登录,创建解压介质的目录:

mkdir -p /opt/app/media && chmod 777 /opt/app/media && cd /opt/app/media

然后unzip解压安装GI的安装介质p13390677_112040_Linux-x86-64_3of7.zip到/opt/app/media这个目录下:

unzip p13390677_112040_Linux-x86-64_3of7.zip -d /opt/app/media

3.2 安装配置Xmanager软件

在自己的Windows系统上成功安装Xmanager Enterprise之后,运行Xstart.exe可执行程序,
配置如下

Session:RAC1
Host:172.16.7.112
Protocol:SSH
User Name:grid 
Execution Command:/usr/bin/xterm -ls -display $DISPLAY

点击RUN,输入grid用户的密码可以正常弹出命令窗口界面,即配置成功。

3.3 共享存储LUN的赋权

chown grid:asmadmin /dev/mapper/mpath*

这个重启验证过,multipath对应的原始设备/dev/dm-*的权限重启后会变更为root:disk,而我们需要的权限是grid:asmadmin
chown grid:asmadmin /dev/mapper/mpath*将这个加入开机启动脚本/etc/rc.local中。

3.4 使用Xmanager图形化界面安装GI

Xmanager通过grid用户登录,进入介质解压目录,运行runInstaller安装GI

$ cd /opt/app/media/grid/
$ ls
install  readme.html  response  rpm  runcluvfy.sh  runInstaller  sshsetup  stage  welcome.html
$ ./runInstaller 

我这里设定ASM密码:orclasm
创建SYSDG作为OCR和Voting Disk的ASM磁盘组(3个10G的LUN,冗余级别:normal)
安装过程中可忽略的检查项(如果你的检查项中还有其他的,则不可以忽略):

Package:pdksh-5.2.14         //这个RHEL中光盘中没有pdksh这个包,之前准备工作中已安装ksh代替
Package:cvuqdisk-1.0.9-1      //这个可以按提示手工修复,也可以忽略安装后自动修复
Device Checks for ASM         
Network Time Protocol(NTP)
Task resolv.conf Integrity

root用户执行2个脚本,需要在各节点分别执行

节点1执行两个脚本的屏幕输出如下:

[root@jyracdb1 ~]# /opt/app/oraInventory/orainstRoot.sh
Changing permissions of /opt/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

Changing groupname of /opt/app/oraInventory to oinstall.
The execution of the script is complete.
[root@jyracdb1 ~]# /opt/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=  /opt/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: /opt/app/11.2.0/grid/crs/install/crsconfig_params
Creating trace directory
User ignored Prerequisites during installation
Installing Trace File Analyzer
OLR initialization - successful
  root wallet
  root wallet cert
  root cert export
  peer wallet
  profile reader wallet
  pa wallet
  peer wallet keys
  pa wallet keys
  peer cert request
  pa cert request
  peer cert
  pa cert
  peer root cert TP
  profile reader root cert TP
  pa root cert TP
  peer pa cert TP
  pa peer cert TP
  profile reader pa cert TP
  profile reader peer cert TP
  peer user cert
  pa user cert
Adding Clusterware entries to upstart
CRS-2672: Attempting to start 'ora.mdnsd' on 'jyracdb1'
CRS-2676: Start of 'ora.mdnsd' on 'jyracdb1' succeeded
CRS-2672: Attempting to start 'ora.gpnpd' on 'jyracdb1'
CRS-2676: Start of 'ora.gpnpd' on 'jyracdb1' succeeded
CRS-2672: Attempting to start 'ora.cssdmonitor' on 'jyracdb1'
CRS-2672: Attempting to start 'ora.gipcd' on 'jyracdb1'
CRS-2676: Start of 'ora.cssdmonitor' on 'jyracdb1' succeeded
CRS-2676: Start of 'ora.gipcd' on 'jyracdb1' succeeded
CRS-2672: Attempting to start 'ora.cssd' on 'jyracdb1'
CRS-2672: Attempting to start 'ora.diskmon' on 'jyracdb1'
CRS-2676: Start of 'ora.diskmon' on 'jyracdb1' succeeded
CRS-2676: Start of 'ora.cssd' on 'jyracdb1' succeeded

ASM created and started successfully.

Disk Group SYSDG created successfully.

clscfg: -install mode specified
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
CRS-4256: Updating the profile
Successful addition of voting disk a64ad5c2080d4fcabfedb69225c4450e.
Successful addition of voting disk 7fee3d0e83e04f4dbf8dac2903b7c575.
Successful addition of voting disk 6cb439677d774ff8bfeea0de9774de7a.
Successfully replaced voting disk group with +SYSDG.
CRS-4256: Updating the profile
CRS-4266: Voting file(s) successfully replaced
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   a64ad5c2080d4fcabfedb69225c4450e (/dev/mapper/mpath_10G_a) [SYSDG]
 2. ONLINE   7fee3d0e83e04f4dbf8dac2903b7c575 (/dev/mapper/mpath_10G_b) [SYSDG]
 3. ONLINE   6cb439677d774ff8bfeea0de9774de7a (/dev/mapper/mpath_10G_c) [SYSDG]
Located 3 voting disk(s).
CRS-2672: Attempting to start 'ora.asm' on 'jyracdb1'
CRS-2676: Start of 'ora.asm' on 'jyracdb1' succeeded
CRS-2672: Attempting to start 'ora.SYSDG.dg' on 'jyracdb1'
CRS-2676: Start of 'ora.SYSDG.dg' on 'jyracdb1' succeeded
Preparing packages for installation...
cvuqdisk-1.0.9-1
Configure Oracle Grid Infrastructure for a Cluster ... succeeded

节点2执行两个脚本的屏幕输出如下:

[root@jyracdb2 app]# /opt/app/oraInventory/orainstRoot.sh
Changing permissions of /opt/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

Changing groupname of /opt/app/oraInventory to oinstall.
The execution of the script is complete.
[root@jyracdb2 app]# /opt/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=  /opt/app/11.2.0/grid

Enter the full pathname of the local bin directory: [/usr/local/bin]: 
   Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ...


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: /opt/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 jyracdb1, number 1, and is terminating
An active cluster was found during exclusive startup, restarting to join the cluster
Preparing packages for installation...
cvuqdisk-1.0.9-1
Configure Oracle Grid Infrastructure for a Cluster ... succeeded

执行完root脚本之后点击OK继续,等待完成安装。

3.5 验证crsctl的状态

[grid@jyracdb1 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.LISTENER.lsnr
               ONLINE  ONLINE       jyracdb1                                   
               ONLINE  ONLINE       jyracdb2                                   
ora.SYSDG.dg
               ONLINE  ONLINE       jyracdb1                                   
               ONLINE  ONLINE       jyracdb2                                   
ora.asm
               ONLINE  ONLINE       jyracdb1               Started             
               ONLINE  ONLINE       jyracdb2               Started             
ora.gsd
               OFFLINE OFFLINE      jyracdb1                                   
               OFFLINE OFFLINE      jyracdb2                                   
ora.net1.network
               ONLINE  ONLINE       jyracdb1                                   
               ONLINE  ONLINE       jyracdb2                                   
ora.ons
               ONLINE  ONLINE       jyracdb1                                   
               ONLINE  ONLINE       jyracdb2                                   
ora.registry.acfs
               ONLINE  ONLINE       jyracdb1                                   
               ONLINE  ONLINE       jyracdb2                                   
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       jyracdb1                                   
ora.cvu
      1        ONLINE  ONLINE       jyracdb1                                   
ora.jyracdb1.vip
      1        ONLINE  ONLINE       jyracdb1                                   
ora.jyracdb2.vip
      1        ONLINE  ONLINE       jyracdb2                                   
ora.oc4j
      1        ONLINE  ONLINE       jyracdb1                                   
ora.scan1.vip
      1        ONLINE  ONLINE       jyracdb1                                   
[grid@jyracdb1 ~]$ 

3.6 测试集群的FAILED OVER功能

重启节点2,查看集群状态:

[grid@jyracdb1 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.LISTENER.lsnr
               ONLINE  ONLINE       jyracdb1                                   
ora.SYSDG.dg
               ONLINE  ONLINE       jyracdb1                                   
ora.asm
               ONLINE  ONLINE       jyracdb1               Started             
ora.gsd
               OFFLINE OFFLINE      jyracdb1                                   
ora.net1.network
               ONLINE  ONLINE       jyracdb1                                   
ora.ons
               ONLINE  ONLINE       jyracdb1                                   
ora.registry.acfs
               ONLINE  ONLINE       jyracdb1                                   
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       jyracdb1                                   
ora.cvu
      1        ONLINE  ONLINE       jyracdb1                                   
ora.jyracdb1.vip
      1        ONLINE  ONLINE       jyracdb1                                   
ora.jyracdb2.vip
      1        ONLINE  INTERMEDIATE jyracdb1               FAILED OVER         
ora.oc4j
      1        ONLINE  ONLINE       jyracdb1                                   
ora.scan1.vip
      1        ONLINE  ONLINE       jyracdb1 

重启节点1:

[grid@jyracdb2 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.LISTENER.lsnr
               ONLINE  OFFLINE      jyracdb1                                   
               ONLINE  ONLINE       jyracdb2                                   
ora.SYSDG.dg
               ONLINE  ONLINE       jyracdb1               STOPPING            
               ONLINE  ONLINE       jyracdb2                                   
ora.asm
               ONLINE  ONLINE       jyracdb1               Started             
               ONLINE  ONLINE       jyracdb2               Started             
ora.gsd
               OFFLINE OFFLINE      jyracdb1                                   
               OFFLINE OFFLINE      jyracdb2                                   
ora.net1.network
               ONLINE  ONLINE       jyracdb1                                   
               ONLINE  ONLINE       jyracdb2                                   
ora.ons
               ONLINE  ONLINE       jyracdb1                                   
               ONLINE  ONLINE       jyracdb2                                   
ora.registry.acfs
               ONLINE  OFFLINE      jyracdb1                                   
               ONLINE  ONLINE       jyracdb2                                   
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  OFFLINE                                                   
ora.cvu
      1        ONLINE  ONLINE       jyracdb2                                   
ora.jyracdb1.vip
      1        ONLINE  OFFLINE                               STARTING            
ora.jyracdb2.vip
      1        ONLINE  ONLINE       jyracdb2                                   
ora.oc4j
      1        ONLINE  ONLINE       jyracdb1               STOPPING            
ora.scan1.vip
      1        ONLINE  OFFLINE                               STARTING      

之后;

[grid@jyracdb2 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.LISTENER.lsnr
               ONLINE  ONLINE       jyracdb2                                   
ora.SYSDG.dg
               ONLINE  ONLINE       jyracdb2                                   
ora.asm
               ONLINE  ONLINE       jyracdb2               Started             
ora.gsd
               OFFLINE OFFLINE      jyracdb2                                   
ora.net1.network
               ONLINE  ONLINE       jyracdb2                                   
ora.ons
               ONLINE  ONLINE       jyracdb2                                   
ora.registry.acfs
               ONLINE  ONLINE       jyracdb2                                   
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       jyracdb2                                   
ora.cvu
      1        ONLINE  ONLINE       jyracdb2                                   
ora.jyracdb1.vip
      1        ONLINE  INTERMEDIATE jyracdb2               FAILED OVER         
ora.jyracdb2.vip
      1        ONLINE  ONLINE       jyracdb2                                   
ora.oc4j
      1        ONLINE  ONLINE       jyracdb2                                   
ora.scan1.vip
      1        ONLINE  ONLINE       jyracdb2