- CentOS7 安装 Oracle 11g rac(8) —— 安装 grid软件
- 一、根据需要修改 grid 响应文件
- 1、在节点1执行如下操作
- 2、修改 grid 响应文件内容如下
- 二、开始安装 grid 软件
- 1、运行安装脚本 runInstaller
- 2、分别在节点 rac1 和 rac2 上按顺序以 root 用户身份执行以下两个脚本
- (1)执行脚本:/u01/app/oraInventory/orainstRoot.sh
- (2)执行脚本:/u01/app/11.2.0/grid/root.sh
- 3、在节点 rac1 上执行下面的脚本
- 三、查看 grid rac 状态
- 四、查看 crs 状态
- 1、查看本地节点的 CRS 状态
- 2、查看集群的 CRS 状态
- 3、查看集群中节点的配置信息
- 4、查看集群件的表决磁盘信息
- 5、查看系统 DNS 配置相关信息
- 6、查看集群 SCAN VIP 信息
- 7、查看集群 SCAN Listener 信息
- 8、查看集群件 OCR 文件信息
- 9、查看集群件 OCR 备份信息
[grid@rac1 response]$ pwd /home/grid/grid/response [grid@rac1 response]$ ll total 28 -rw-r--r-- 1 grid oinstall 24632 Aug 26 2013 grid_install.rsp [grid@rac1 response]$ cp grid_install.rsp grid_install.rsp.bak [grid@rac1 response]$ vi grid_install.rsp2、修改 grid 响应文件内容如下
# grid 响应文件(grid_install.rsp) oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v11_2_0 # 当前安装节点的计算机名称:rac1 ORACLE_HOSTNAME=rac1 # 版本信息路径:/u01/app/oraInventory INVENTORY_LOCATION=/u01/app/oraInventory #语言:en,zh_CN SELECtED_LANGUAGES=en,zh_CN #指定安装类型:使用默认(CRS_CONFIG——cluster 集群) oracle.install.option=CRS_CONFIG # grid 的 BASE目录:/u01/app/grid ORACLE_BASE=/u01/app/grid # grid 的 HOME 目录:/u01/app/11.2.0/grid ORACLE_HOME=/u01/app/11.2.0/grid # 设置组信息 oracle.install.asm.OSDBA=asmdba oracle.install.asm.OSOPER=asmoper oracle.install.asm.OSASM=asmadmin # scan名称:rac-scan oracle.install.crs.config.gpnp.scanName=rac-scan # 集群监听端口号:1521 oracle.install.crs.config.gpnp.scanPort=1521 # cluster名称:rac-cluster oracle.install.crs.config.clusterName=rac-cluster # 不使用GNS:以下四个选项不用设置 oracle.install.crs.config.gpnp.configureGNS=false oracle.install.crs.config.gpnp.gnsSubDomain= oracle.install.crs.config.gpnp.gnsVIPAddress= oracle.install.crs.config.autoConfigureClusterNodeVIP= # 节点信息,跟hosts对应:rac1:rac1-vip,rac2:rac2-vip oracle.install.crs.config.clusterNodes=rac1:rac1-vip,rac2:rac2-vip # 网卡信息和网段:bond1:192.168.1.0:1,bond2:10.1.1.0:2 oracle.install.crs.config.networkInterfaceList=bond1:192.168.1.0:1,bond2:10.1.1.0:2 # 存储形式:ASM_STORAGE oracle.install.crs.config.storageOption=ASM_STORAGE # 不使用 FILE_SYSTEM_STORAGE,以下选项不用设置 oracle.install.crs.config.sharedFileSystemStorage.votingDiskLocations= oracle.install.crs.config.sharedFileSystemStorage.votingDiskRedundancy=NORMAL oracle.install.crs.config.sharedFileSystemStorage.ocrLocations= oracle.install.crs.config.sharedFileSystemStorage.ocrRedundancy=NORMAL # 不使用IPMI,以下选项不用设置 oracle.install.crs.config.useIPMI=false oracle.install.crs.config.ipmi.bmcUsername= oracle.install.crs.config.ipmi.bmcPassword= # 配置 ASM 操作密码:oracle oracle.install.asm.SYSASMPassword=oracle # 配置 ASM 表决盘名称:OCR oracle.install.asm.diskGroup.name=OCR # 配置 ASM 表决盘冗余选项:NORMAL(默认值) oracle.install.asm.diskGroup.redundancy=NORMAL # 配置 ASM AUSize:1(默认值) oracle.install.asm.diskGroup.AUSize=1 # 设置表决盘所使用的裸盘: # /dev/oracleasm/disks/OCR1,/dev/oracleasm/disks/OCR2,/dev/oracleasm/disks/OCR3 oracle.install.asm.diskGroup.disks=/dev/oracleasm/disks/OCR1,/dev/oracleasm/disks/OCR2,/dev/oracleasm/disks/OCR3 # 配置 ASM 磁盘位置:/dev/oracleasm/disks oracle.install.asm.diskGroup.diskDiscoveryString=/dev/oracleasm/disks/* # 配置 ASMSNMP 密码:oracle oracle.install.asm.monitorPassword=oracle # 设置系统自动更新选项:SKIP_UPDATES(跳过更新——不更新) oracle.installer.autoupdates.option=SKIP_UPDATES oracle.installer.autoupdates.downloadUpdatesLoc= AUTOUPDATES_MYORACLESUPPORT_USERNAME= AUTOUPDATES_MYORACLESUPPORT_PASSWORD= # 配置代理服务器选项:不使用代理服务器 PROXY_HOST= PROXY_PORT= PROXY_USER= PROXY_PWD= PROXY_REALM=二、开始安装 grid 软件 1、运行安装脚本 runInstaller
[root@rac1 ~]# su - grid 上一次登录:六 6月 11 20:08:45 CST 2022pts/0 上 [grid@rac1 ~]$ cd /home/grid/grid [grid@rac1 grid]$ ll total 52 drwxr-xr-x 4 grid oinstall 281 Aug 26 2013 install -rw-r--r-- 1 grid oinstall 30016 Aug 27 2013 readme.html drwxr-xr-x 2 grid oinstall 58 Jun 11 22:08 response drwxr-xr-x 2 grid oinstall 34 Aug 26 2013 rpm -rwxr-xr-x 1 grid oinstall 4878 Aug 26 2013 runcluvfy.sh -rwxr-xr-x 1 grid oinstall 3268 Aug 26 2013 runInstaller drwxr-xr-x 2 grid oinstall 29 Aug 26 2013 sshsetup drwxr-xr-x 14 grid oinstall 4096 Aug 26 2013 stage -rw-r--r-- 1 grid oinstall 500 Aug 27 2013 welcome.html [grid@rac1 grid]$ ./runInstaller -force -noconfig -IgnoreSysPreReqs -showProgress -ignorePrereq -silent -responseFile /home/grid/grid/response/grid_install.rsp Starting Oracle Universal Installer... Checking Temp space: must be greater than 120 MB. Actual 8806 MB Passed Checking swap space: must be greater than 150 MB. Actual 4087 MB Passed Preparing to launch Oracle Universal Installer from /tmp/OraInstall2022-06-12_01-08-02AM. Please wait ...[grid@rac1 grid]$ [WARNING] [INS-30011] The SYS password entered does not conform to the Oracle recommended standards. CAUSE: Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9]. ACTION: Provide a password that conforms to the Oracle recommended standards. [WARNING] [INS-30011] The ASMSNMP password entered does not conform to the Oracle recommended standards. CAUSE: Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9]. ACTION: Provide a password that conforms to the Oracle recommended standards. You can find the log of this install session at: /u01/app/oraInventory/logs/installActions2022-06-12_01-08-02AM.log Prepare in progress. .................................................. 9% Done. Prepare successful. Copy files in progress. .................................................. 15% Done. .................................................. 20% Done. .................................................. 25% Done. .................................................. 30% Done. .................................................. 35% Done. .................................................. 40% Done. .................................................. 45% Done. ........................................ Copy files successful. Link binaries in progress. Link binaries successful. .................................................. 62% Done. Setup files in progress. Setup files successful. .................................................. 76% Done. Perform remote operations in progress. .................................................. 89% Done. Perform remote operations successful. The installation of Oracle Grid Infrastructure 11g was successful. Please check '/u01/app/oraInventory/logs/silentInstall2022-06-12_01-08-02AM.log' for more details. .................................................. 94% Done. Execute Root Scripts in progress. As a root user, execute the following script(s): 1. /u01/app/oraInventory/orainstRoot.sh 2. /u01/app/11.2.0/grid/root.sh Execute /u01/app/oraInventory/orainstRoot.sh on the following nodes: [rac1, rac2] Execute /u01/app/11.2.0/grid/root.sh on the following nodes: [rac1, rac2] .................................................. 100% Done. Execute Root Scripts successful. As install user, execute the following script to complete the configuration. 1. /u01/app/11.2.0/grid/cfgtoollogs/configToolAllCommands RESPONSE_FILE=2、分别在节点 rac1 和 rac2 上按顺序以 root 用户身份执行以下两个脚本 (1)执行脚本:/u01/app/oraInventory/orainstRoot.shNote: 1. This script must be run on the same host from where installer was run. 2. This script needs a small password properties file for configuration assistants that require passwords (refer to install guide documen tation). Successfully Setup Software.
脚本的作用:修改目录的权限。
# 节点1 [root@rac1 disks]# /u01/app/oraInventory/orainstRoot.sh Changing permissions of /u01/app/oraInventory. Adding read,write permissions for group. Removing read,write,execute permissions for world. Changing groupname of /u01/app/oraInventory to oinstall. The execution of the script is complete. # 节点2 [root@rac2 oracle-pck]# /u01/app/oraInventory/orainstRoot.sh Changing permissions of /u01/app/oraInventory. Adding read,write permissions for group. Removing read,write,execute permissions for world. Changing groupname of /u01/app/oraInventory to oinstall. The execution of the script is complete.(2)执行脚本:/u01/app/11.2.0/grid/root.sh
脚本的作用:启动相关资源。
节点1:
[root@rac1 ~]# /u01/app/11.2.0/grid/root.sh Check /u01/app/11.2.0/grid/install/root_rac1_2022-06-12_01-19-58.log for the output of root script
查看节点1(rac1)执行 /u01/app/11.2.0/grid/root.sh 时的日志:
[root@rac1 ~]# tail -f /u01/app/11.2.0/grid/install/root_rac1_2022-06-12_01-19-58.log 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: /u01/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 inittab ohasd failed to start Failed to start the Clusterware. Last 20 lines of the alert log follow: 2022-06-12 01:21:53.036: [client(7427)]CRS-2101:The OLR was formatted using version 3. CRS-2672: Attempting to start 'ora.mdnsd' on 'rac1' CRS-2676: Start of 'ora.mdnsd' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.gpnpd' on 'rac1' CRS-2676: Start of 'ora.gpnpd' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.cssdmonitor' on 'rac1' CRS-2672: Attempting to start 'ora.gipcd' on 'rac1' CRS-2676: Start of 'ora.cssdmonitor' on 'rac1' succeeded CRS-2676: Start of 'ora.gipcd' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.cssd' on 'rac1' CRS-2672: Attempting to start 'ora.diskmon' on 'rac1' CRS-2676: Start of 'ora.diskmon' on 'rac1' succeeded CRS-2676: Start of 'ora.cssd' on 'rac1' succeeded 已成功创建并启动 ASM。 已成功创建磁盘组OCR。 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 346370b3c9784f88bf6c1cd51e8c3dd0. Successful addition of voting disk 1924a6ec08824fefbfb1cfdc7c172cb7. Successful addition of voting disk 36f4cb31efaa4f9ebf81fa478a82a48d. Successfully replaced voting disk group with +OCR. CRS-4256: Updating the profile CRS-4266: Voting file(s) successfully replaced ## STATE File Universal Id File Name Disk group -- ----- ----------------- --------- --------- 1. ONLINE 346370b3c9784f88bf6c1cd51e8c3dd0 (/dev/oracleasm/disks/OCR1) [OCR] 2. ONLINE 1924a6ec08824fefbfb1cfdc7c172cb7 (/dev/oracleasm/disks/OCR2) [OCR] 3. ONLINE 36f4cb31efaa4f9ebf81fa478a82a48d (/dev/oracleasm/disks/OCR3) [OCR] Located 3 voting disk(s). CRS-2672: Attempting to start 'ora.asm' on 'rac1' CRS-2676: Start of 'ora.asm' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.OCR.dg' on 'rac1' CRS-2676: Start of 'ora.OCR.dg' on 'rac1' succeeded Configure Oracle Grid Infrastructure for a Cluster ... succeeded
错误的排除:
# 执行过程中出现如下错误: # [client(7427)]CRS-2101:The OLR was formatted using version 3. #新开一个窗口,以 root 用户执行以下命令: [root@rac2 ~]# cd /var/tmp/.oracle/ [root@rac2 .oracle]# ll 总用量 0 prw-r--r-- 1 root root 0 6月 13 20:59 npohasd [root@rac2 .oracle]# rm npohasd -f [root@rac2 .oracle]# touch npohasd [root@rac2 .oracle]# chmod 755 npohasd [root@rac2 .oracle]# ll 总用量 4 srwxr-xr-x 1 grid oinstall 0 6月 13 21:03 mdnsd -rw-r--r-- 1 grid oinstall 5 6月 13 21:03 mdnsd.pid -rwxr-xr-x 1 root root 0 6月 13 21:03 npohasd srwxrwxrwx 1 root root 0 6月 13 21:03 sOHASD_IPC_SOCKET_11 -rw-r--r-- 1 root root 0 6月 13 21:03 sOHASD_IPC_SOCKET_11_lock srwxrwxrwx 1 root root 0 6月 13 21:03 sOHASD_UI_SOCKET srwxrwxrwx 1 root root 0 6月 13 21:03 sprocr_local_conn_0_PROL -rw-r--r-- 1 root root 0 6月 13 21:03 sprocr_local_conn_0_PROL_lock srwxrwxrwx 1 grid oinstall 0 6月 13 21:03 srac2DBG_GPNPD srwxrwxrwx 1 grid oinstall 0 6月 13 21:03 srac2DBG_MDNSD srwxrwxrwx 1 root root 0 6月 13 21:03 srac2DBG_OHASD
节点2:
[root@rac2 ~]# /u01/app/11.2.0/grid/root.sh Check /u01/app/11.2.0/grid/install/root_rac2_2022-06-12_01-29-23.log for the output of root script
查看节点2(rac2)执行 /u01/app/11.2.0/grid/root.sh 时的日志:
[root@rac2 ~]# tail -f /u01/app/11.2.0/grid/install/root_rac2_2022-06-12_01-29-23.log 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: /u01/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 inittab ohasd failed to start Failed to start the Clusterware. Last 20 lines of the alert log follow: 2022-06-12 01:31:23.811: [client(5535)]CRS-2101:The OLR was formatted using version 3. CRS-4402: The CSS daemon was started in exclusive mode but found an active CSS daemon on node rac1, number 1, and is terminating An active cluster was found during exclusive startup, restarting to join the cluster Configure Oracle Grid Infrastructure for a Cluster ... succeeded3、在节点 rac1 上执行下面的脚本
[root@rac1 ~]# su - grid 上一次登录:日 6月 12 01:33:05 CST 2022pts/1 上 [grid@rac1 ~]$ cd /u01/app/11.2.0/grid/cfgtoollogs [grid@rac1 cfgtoollogs]$ touch cfgrsp.properties [grid@rac1 cfgtoollogs]$ /u01/app/11.2.0/grid/cfgtoollogs/configToolAllCommands RESPONSE_FILE=/u01/app/11.2.0/grid/cfgtoollogs/cfgrsp.properties Setting the invPtrLoc to /u01/app/11.2.0/grid/oraInst.loc perform - mode is starting for action: configure perform - mode finished for action: configure You can see the log file: /u01/app/11.2.0/grid/cfgtoollogs/oui/configActions2022-06-12_01-42-41-AM.log三、查看 grid rac 状态
节点1:
[grid@rac1 grid]$ crs_stat -t Name Type Target State Host ------------------------------------------------------------ ora....ER.lsnr ora....er.type ONLINE ONLINE rac1 ora....N1.lsnr ora....er.type ONLINE ONLINE rac1 ora.OCR.dg ora....up.type ONLINE ONLINE rac1 ora.asm ora.asm.type ONLINE ONLINE rac1 ora.cvu ora.cvu.type ONLINE ONLINE rac1 ora.gsd ora.gsd.type OFFLINE OFFLINE ora....network ora....rk.type ONLINE ONLINE rac1 ora.oc4j ora.oc4j.type ONLINE ONLINE rac1 ora.ons ora.ons.type ONLINE ONLINE rac1 ora....SM1.asm application ONLINE ONLINE rac1 ora....C1.lsnr application ONLINE ONLINE rac1 ora.rac1.gsd application OFFLINE OFFLINE ora.rac1.ons application ONLINE ONLINE rac1 ora.rac1.vip ora....t1.type ONLINE ONLINE rac1 ora....SM2.asm application ONLINE ONLINE rac2 ora....C2.lsnr application ONLINE ONLINE rac2 ora.rac2.gsd application OFFLINE OFFLINE ora.rac2.ons application ONLINE ONLINE rac2 ora.rac2.vip ora....t1.type ONLINE ONLINE rac2 ora.scan1.vip ora....ip.type ONLINE ONLINE rac1
节点2:
[grid@rac2 ~]$ crs_stat -t Name Type Target State Host ------------------------------------------------------------ ora....ER.lsnr ora....er.type ONLINE ONLINE rac1 ora....N1.lsnr ora....er.type ONLINE ONLINE rac1 ora.OCR.dg ora....up.type ONLINE ONLINE rac1 ora.asm ora.asm.type ONLINE ONLINE rac1 ora.cvu ora.cvu.type ONLINE ONLINE rac1 ora.gsd ora.gsd.type OFFLINE OFFLINE ora....network ora....rk.type ONLINE ONLINE rac1 ora.oc4j ora.oc4j.type ONLINE ONLINE rac1 ora.ons ora.ons.type ONLINE ONLINE rac1 ora....SM1.asm application ONLINE ONLINE rac1 ora....C1.lsnr application ONLINE ONLINE rac1 ora.rac1.gsd application OFFLINE OFFLINE ora.rac1.ons application ONLINE ONLINE rac1 ora.rac1.vip ora....t1.type ONLINE ONLINE rac1 ora....SM2.asm application ONLINE ONLINE rac2 ora....C2.lsnr application ONLINE ONLINE rac2 ora.rac2.gsd application OFFLINE OFFLINE ora.rac2.ons application ONLINE ONLINE rac2 ora.rac2.vip ora....t1.type ONLINE ONLINE rac2 ora.scan1.vip ora....ip.type ONLINE ONLINE rac1四、查看 crs 状态 1、查看本地节点的 CRS 状态
[grid@rac1 grid]$ crsctl check crs CRS-4638: Oracle High Availability Services is online CRS-4537: Cluster Ready Services is online CRS-4529: Cluster Synchronization Services is online CRS-4533: Event Manager is online2、查看集群的 CRS 状态
[grid@rac1 grid]$ crsctl check cluster CRS-4537: Cluster Ready Services is online CRS-4529: Cluster Synchronization Services is online CRS-4533: Event Manager is online3、查看集群中节点的配置信息
[grid@rac1 grid]$ olsnodes -n -i -s rac1 1 rac1-vip Active rac2 2 rac2-vip Active4、查看集群件的表决磁盘信息
[grid@rac1 grid]$ crsctl query css votedisk ## STATE File Universal Id File Name Disk group -- ----- ----------------- --------- --------- 1. ONLINE 346370b3c9784f88bf6c1cd51e8c3dd0 (/dev/oracleasm/disks/OCR1) [OCR] 2. ONLINE 1924a6ec08824fefbfb1cfdc7c172cb7 (/dev/oracleasm/disks/OCR2) [OCR] 3. ONLINE 36f4cb31efaa4f9ebf81fa478a82a48d (/dev/oracleasm/disks/OCR3) [OCR] Located 3 voting disk(s).5、查看系统 DNS 配置相关信息
[grid@rac1 grid]$ crsctl query dns -servers CRS-10018: the following configuration was found on the system: CRS-10019: There are 1 domains in search order. They are: oracle.com CRS-10022: There are 1 name servers. They are: 192.168.1.101 CRS-10020: number of retry attempts for name lookup is: 2 CRS-10021: timeout for each name lookup is: 56、查看集群 SCAN VIP 信息
[grid@rac1 grid]$ srvctl config scan SCAN name: rac-scan, Network: 1/192.168.1.0/255.255.255.0/bond1 SCAN VIP name: scan1, IP: /rac-scan/192.168.1.2017、查看集群 SCAN Listener 信息
[grid@rac1 grid]$ srvctl config scan_listener SCAN Listener LISTENER_SCAN1 exists. Port: TCP:15218、查看集群件 OCR 文件信息
[grid@rac1 grid]$ ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 2592
Available space (kbytes) : 259528
ID : 2138001007
Device/File Name : +OCR
Device/File integrity check succeeded
Device/File not configured
Device/File not configured
Device/File not configured
Device/File not configured
Cluster registry integrity check succeeded
Logical corruption check bypassed due to non-privileged user
9、查看集群件 OCR 备份信息
[grid@rac1 grid]$ ocrconfig -showbackup PROT-24: Auto backups for the Oracle Cluster Registry are not available PROT-25: Manual backups for the Oracle Cluster Registry are not available



