UNIX平台orainstRoot.sh脚本作用 _VMware, Unix及操作系统讨论区_Weblogic技术|Tuxedo技术|中间件技术|Oracle论坛|JAVA论坛|Linux/Unix技术|hadoop论坛_联动北方技术论坛  
网站首页 | 关于我们 | 服务中心 | 经验交流 | 公司荣誉 | 成功案例 | 合作伙伴 | 联系我们 |
联动北方-国内领先的云技术服务提供商
»  游客             当前位置:  论坛首页 »  自由讨论区 »  VMware, Unix及操作系统讨论区 »
总帖数
1
每页帖数
101/1页1
返回列表
0
发起投票  发起投票 发新帖子
查看: 1810 | 回复: 0   主题: UNIX平台orainstRoot.sh脚本作用         下一篇 
谁是天蝎
注册用户
等级:大元帅
经验:90210
发帖:106
精华:0
注册:2011-7-21
状态:离线
发送短消息息给谁是天蝎 加好友    发送短消息息给谁是天蝎 发消息
发表于: IP:您无权察看 2015-6-25 15:06:09 | [全部帖] [楼主帖] 楼主

在使用Oracle Universal Installer(OUI)在UNIX平台上安装Oracle软件的快结束的时候会提示要执行orainstRoot.sh脚本。执行这个脚本目的是什么呢?以Linux平台的10g版本Oracle为例一起探索一下。

1.orainstRoot.sh脚本内容

[root@secdb ~]# ls -l /oracle/oraInventory/orainstRoot.sh
-rwxrwx--- 1 oracle oinstall 1614 Dec 21 2010 /oracle/oraInventory/orainstRoot.sh
[root@secdb ~]# cat /oracle/oraInventory/orainstRoot.sh
#!/bin/sh
AWK=/bin/awk
CHMOD=/bin/chmod
CHGRP=/bin/chgrp
CP=/bin/cp
ECHO=/bin/echo
MKDIR=/bin/mkdir
RUID=`/usr/bin/id $AWK -F\( '{print $2}' $AWK -F\) '{print $1}'`
if [ ${RUID} != "root" ];then
$ECHO "This script. must be executed as root"
exit 1
fi
if [ -d "/etc" ]; then
$CHMOD 755 /etc;
else
$MKDIR -p /etc;
fi
if [ -f "/oracle/oraInventory/oraInst.loc" ]; then
$CP /oracle/oraInventory/oraInst.loc /etc/oraInst.loc;
$CHMOD 644 /etc/oraInst.loc
else
INVPTR=/etc/oraInst.loc
INVLOC=/oracle/oraInventory
GRP=oinstall
PTRDIR="`dirname $INVPTR`";
# Create the software inventory location pointer file
if [ ! -d "$PTRDIR" ]; then
$MKDIR -p $PTRDIR;
fi
$ECHO "Creating the Oracle inventory pointer file ($INVPTR)";
$ECHO inventory_loc=$INVLOC > $INVPTR
$ECHO inst_group=$GRP >> $INVPTR
chmod 644 $INVPTR
# Create the inventory directory if it doesn't exist
if [ ! -d "$INVLOC" ];then
$ECHO "Creating the Oracle inventory directory ($INVLOC)";
$MKDIR -p $INVLOC;
fi
fi
$ECHO "Changing permissions of /oracle/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
";
$CHMOD -R g+rw,o-rwx /oracle/oraInventory;
if [ $? != 0 ]; then
$ECHO "OUI-35086:WARNING: chmod of /oracle/oraInventory
Adding read,write permissions for group.
,Removing read,write,execute permissions for world.
failed!";
fi
$ECHO "Changing groupname of /oracle/oraInventory to oinstall.";
$CHGRP -R oinstall /oracle/oraInventory;
if [ $? != 0 ]; then
$ECHO "OUI-10057:WARNING: chgrp of /oracle/oraInventory to oinstall failed!";
fi
$ECHO "The execution of the script. is complete."


从注释上可以得出脚本的功能描述。

# Create the software inventory location pointer file
# Create the inventory directory if it doesn't exist


因此orainstRoot.sh脚本作用就是创建Oracle软件安装清单的指向文件。

2.指向文件内容

[root@secdb ~]# cat /etc/oraInst.loc
inventory_loc=/oracle/oraInventory
inst_group=oinstall


此文件给出了Oracle软件安装清单目录和属组的名字。

--转自 北京联动北方科技有限公司




赞(0)    操作        顶端 
总帖数
1
每页帖数
101/1页1
返回列表
发新帖子
请输入验证码: 点击刷新验证码
您需要登录后才可以回帖 登录 | 注册
技术讨论