Grid软件安装过程中orainstRoot.sh和root.sh脚本到底做了什么?
2013-11-25 00:00
791 查看
在Linux平台上,从Oracle 11gR2开始,不论是单实例的库,还是RAC库,如果需要用到ASM时,通常都需要单独安装Grid Infrastructure软件。而在Linux平台上以图形界面【OUI Oracle Universal Installer】安装Oracle 11gR2 Grid软件过程中,会提示以root用户执行orainstRoot.sh和root.sh脚本【如下图一:单实例安装,图二:RAC安装】。
![](http://static.oschina.net/uploads/img/201311/25182401_dEUK.png)
图一:Linux平台安装单实例时,grid软件需要执行的脚本
![](http://static.oschina.net/uploads/img/201311/25182402_2Xgr.png)
图二:Linux平台安装RAC时,grid软件需要执行的脚本
那么这两个脚本分别做了什么,有什么作用呢?本文简单记录:
![](http://static.oschina.net/uploads/img/201311/25182403_IwdK.png)
图三:Oracle Central Inventory的路径
这是Oracle Enterprise Linux 6及以上版本的操作系统上的变化,在以前版本的操作系统下,由/etc/inittab文件来控制的条目均转移到/etc/init下单个文件来控制。
![](http://static.oschina.net/uploads/img/201311/25182401_dEUK.png)
图一:Linux平台安装单实例时,grid软件需要执行的脚本
![](http://static.oschina.net/uploads/img/201311/25182402_2Xgr.png)
图二:Linux平台安装RAC时,grid软件需要执行的脚本
那么这两个脚本分别做了什么,有什么作用呢?本文简单记录:
一 /u01/app/oraInventory/orainstRoot.sh脚本的作用
1 添加grid用户及oinstall组对Oracle Central Inventory 目录的读写权限;
Oracle Central Inventory 目录默认情况下,位于$ORACLE_BASE的上一级目录下,如下图三:![](http://static.oschina.net/uploads/img/201311/25182403_IwdK.png)
图三:Oracle Central Inventory的路径
2 删除其它用户组对该目录的读、写、执行权限;
1 2 3 4 5 6 7 8 9 10 | 11gOCM->pwd /u01/app 11gOCM>ls total 20 drwxrwxr-x. 3 grid oinstall 4096 Oct 28 10:38 11.2.0 drwxr-xr-x 2 grid oinstall 4096 Oct 30 10:20 acfs drwxrwxr-x. 8 grid oinstall 4096 Oct 28 10:38 grid drwxrwxr-x. 8 oracle oinstall 4096 Nov 5 10:57 oracle drwxrwx---. 6 grid oinstall 4096 Oct 10 11:09 oraInventory 11gOCM-> |
3 创建/etc/oraInst.loc文件。
1 2 3 4 5 | 11gOCM-> cat/etc/oraInst.loc inventory_loc=/u01/app/oraInventory inst_group=oinstall 11gOCM-> |
二 /u01/app/11.2.0/grid/root.sh脚本的作用
1 cp grid用户的$ORACLE_HOME/bin下的oraenv、dbhome、coraenv可执行程序到/usr/local/bin路径下;
1 2 3 4 5 6 7 8 9 10 11 12 13 | 11gOCM->pwd /u01/app/11.2.0/grid/bin 11gOCM-> ll oraenv dbhome coraenv -rwxr-xr-x. 1 grid oinstall 5778 Jan 1 2000 coraenv -rwxr-xr-x. 1 grid oinstall 2415 Jan 1 2000 dbhome -rwxr-xr-x. 1 grid oinstall 6183 Jan 1 2000 oraenv 11gOCM-> ll/usr/local/bin/ total 232 -rwxr-xr-x. 1 grid root 5778 Oct 10 10:54 coraenv -rwxr-xr-x. 1 grid root 2415 Oct 10 10:54 dbhome -rwxr-xr-x. 1 grid root 6183 Oct 10 10:54 oraenv -rwxr-xr-x 1 root root 214001 Oct 10 16:39 rlwrap 11gOCM-> |
2 创建/etc/oratab文件;
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | 11gOCM->cat/etc/oratab #Backup file is /u01/app/11.2.0/grid/srvm/admin/oratab.bak.11gocm line added by Agent # # This file is used by ORACLE utilities. It is created by root.sh # and updated by either Database Configuration Assistant while creating # a database or ASM Configuration Assistant while creating ASM instance. # A colon, ':', is used as the field terminator. A new line terminates # the entry. Lines beginning with a pound sign, '#', are comments. # # Entries are of the form: # $ORACLE_SID:$ORACLE_HOME:<N|Y>: # # The first and second fields are the system identifier and home # directory of the database respectively. The third filed indicates # to the dbstart utility that the database should , "Y", or should not, # "N", be brought up at system boot time. # # Multiple entries with the same $ORACLE_SID are not allowed. # # +ASM:/u01/app/11.2.0/grid:N orcl:/u01/app/oracle/product/11.2.0/db_1:N # line added by Agent 11gOCM-> |
3 创建grid用户的OCR keys文件;
4 启动ohasd守护进程,并且将ohasd守护进程的启动文件写入到/etc/inittab文件中,以便于ohasd守护进程随着操作系统的启动而启动。如果是Oracle Enterprise Linux 6及以上版本的操作系统的话,则将该配置信息写入到/etc/init/oracle-ohasd.conf的独立配置文件中。
1 2 3 4 5 6 7 8 9 | 11gOCM->cat/etc/init/oracle-ohasd.conf # Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. # # Oracle OHASD startup start on runlevel [35] stop on runlevel [!35] respawn exec/etc/init.d/init.ohasd run >/dev/null2>&1 |
相关文章推荐
- Grid软件安装过程中orainstRoot.sh和root.sh脚本到底做了什么?
- Grid软件安装过程中orainstRoot.sh和root.sh脚本到底做了什么?
- Linux系统安装oracle时,orainstRoot.sh,root.sh脚本的作用。
- Linux系统安装oracle时,orainstRoot.sh,root.sh脚本的作用。
- 安装GRID时跑root.sh脚本报错(ORA-27091: unable to queue I/O)
- UNIX平台orainstRoot.sh脚本作用
- 安装12.1.0.2 集群GRID/GI, 运行root.sh 脚本失败的案例
- oracle 11g ASM单节点数据库安装grid执行root.sh脚本报错
- 安装Oracle执行orainstRoot.sh与root.sh作用
- grid软件,执行root.sh脚本失败,解决办法
- 11gr2安装Grid 时 node2 root.sh失败Start of resource “ora.asm -init” failed
- orainstRoot.sh到底执行了哪些操作
- 【脚本】UNIX平台orainstRoot.sh脚…
- linux6.5安装11.2.0.4rac,在安装GI跑脚本</u01/app/11.2.0/grid/root.sh>出现CRS-4046 CRS-4000 错误
- 【RAC】安装cluster软件 在节点2执行root.sh脚本
- orainstroot.sh 脚本
- redhat 6.9 安装oracle 11.2.0.1 grid时在最后介面,运行root.sh之前执行以下命令
- rhel7.1上安装11grac执行root.sh脚本时报错后台进程未启动
- RAC安装GI时运行root.sh脚本结果
- 执行 orainstRoot.sh 与 root.sh 作用