orainstRoot.sh 执行成功以最后输出“The execution of the script is complete.”为准,其核心任务是创建或更新 /etc/oraInst.loc 并正确设置 /u01/app/oraInventory 的权限与属组;所谓“报错”多为正常操作日志,非真实错误。

orainstRoot.sh 报错本身不是失败信号,绝大多数情况是脚本已执行完毕但终端输出了误导性信息;真正要关注的是它是否完成了核心任务:创建或更新 /etc/oraInst.loc 和设置 /u01/app/oraInventory 权限。
为什么执行完还显示“报错”?
常见现象是终端输出类似:
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.
——这根本不是错误,而是标准日志。Oracle 脚本习惯把操作过程全当“输出”打印,不区分 info/warn/error。只要最后出现 The execution of the script is complete.,就代表成功。
唯一需要警惕的真错误是开头就退出,例如:
-
This script must be executed as root→ 没用 root 运行 -
No such file or directory(指向orainstRoot.sh本身)→ 路径不对或文件被删
执行前必须确认的三件事
orainstRoot.sh 看似简单,但依赖前置状态。漏掉任一环节都会导致后续 root.sh 失败:
- 确保
/u01/app/oraInventory目录存在且属主为oracle:oinstall(不是grid或root) - 检查
/etc/oraInst.loc是否已被其他 Oracle 安装写入过;若存在,确认其中inventory_loc指向的路径与当前一致,否则root.sh会读错 inventory - 确保
oinstall组真实存在:getent group oinstall,不存在就先groupadd oinstall
常见假报错 + 对应验证动作
遇到以下输出,别急着重装,先做这几步验证:
- 看到
Creating the Oracle inventory pointer file (/etc/oraInst.loc)→ 检查ls -l /etc/oraInst.loc,应为root:oinstall、权限644 - 看到
Creating the Oracle inventory directory→ 检查ls -ld /u01/app/oraInventory,应为oracle:oinstall、权限775(组可读写) - 执行后
root.sh报Failed to create keys in the OLR或gpnptool rc=32512→ 很可能orainstRoot.sh写入的/etc/oraInst.loc路径有空格、符号或拼写错误,手动cat /etc/oraInst.loc核对
多节点 RAC 下最容易被忽略的点
在第二个节点运行 orainstRoot.sh 时,它不会覆盖已有 /etc/oraInst.loc,而是直接跳过创建步骤。但如果第一个节点的 inventory 路径写错了(比如写成 /u01/app/oraInventory/ 带尾部斜杠),第二个节点的 root.sh 就会因路径不一致而找不到 inventory —— 这类问题不会在 orainstRoot.sh 输出里体现,只能靠人工比对两个节点的 /etc/oraInst.loc 内容是否完全一致。


















