又一次发现Oracle太美之root.sh

假设你运行下下面命令基本上会在Oracle软件文件夹下会发现两个root.sh的脚本

[[email protected] Templates]$ find /u01/ -name root.sh |xargs ls -ltr

-rwxrwx--- 1 oracle oinstall  10 May 14 02:37 /u01/app/db11g/product/11.2.0/dbhome_1/inventory/Templates/root.sh

-rwxr-x--- 1 oracle oinstall 512 May 14 02:47 /u01/app/db11g/product/11.2.0/dbhome_1/root.sh

第一个脚本里面没啥东西。我们今天主要来研究下第二个root.sh是干啥用的。也就是我们安装软件后须要执行的这个root.sh的主要作用。

[[email protected] ~]$ cat /u01/app/db11g/product/11.2.0/dbhome_1/root.sh

#!/bin/sh

. /u01/app/db11g/product/11.2.0/dbhome_1/install/utl/rootmacro.sh "[email protected]"

. /u01/app/db11g/product/11.2.0/dbhome_1/install/utl/rootinstall.sh

/u01/app/db11g/product/11.2.0/dbhome_1/install/unix/rootadd.sh

#

# Root Actions related to network

#

/u01/app/db11g/product/11.2.0/dbhome_1/network/install/sqlnet/setowner.sh

#

# Invoke standalone rootadd_rdbms.sh

#

/u01/app/db11g/product/11.2.0/dbhome_1/rdbms/install/rootadd_rdbms.sh

/u01/app/db11g/product/11.2.0/dbhome_1/rdbms/install/rootadd_filemap.sh

[[email protected] ~]$

能够看到上面脚本里面包括了6个小的脚本,我们一一来分析下看看这个root.sh里面的脚本都是干啥的。

1.第一个脚本

[[email protected] ~]$ cat /u01/app/db11g/product/11.2.0/dbhome_1/install/utl/rootmacro.sh

#!/bin/sh

#

# $Id: rootmacro.sbs /st_buildtools_11.2.0/2 2012/11/06 02:43:45 rmallego Exp $

# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.

#

# root.sh

#

# This script is intended to be run by root.  The script contains

# all the product installation actions that require root privileges.

#

# IMPORTANT NOTES - READ BEFORE RUNNING SCRIPT

#

# (1) ORACLE_HOME and ORACLE_OWNER can be defined in user‘s

#     environment to override default values defined in this script.

#

# (2) The environment variable LBIN (defined within the script) points to

#     the default local bin area.  Three executables will be moved there as

#     part of this script execution.

#

# (3) Define (if desired) LOG variable to name of log file.

#

-------->>>上面明白说明执行脚本之前ORACLE_HOME,ORACLE_OWNER一定要设置

AWK=/bin/awk

CAT=/bin/cat

CHGRP=/bin/chgrp

CHOWN=/bin/chown

CHMOD=/bin/chmod

CP=/bin/cp

DIFF=/usr/bin/diff

ECHO=echo

GREP=/bin/grep

LBIN=/usr/local/bin

MKDIR=/bin/mkdir

ORATABLOC=/etc

ORATAB=${ORATABLOC}/oratab

RM=/bin/rm

SED=/bin/sed

UNAME=/bin/uname

DATE=/bin/date

TEE=/usr/bin/tee

TMPORATB=/var/tmp/oratab$$

if [ `$UNAME` = "SunOS" ]

then

GREP=/usr/xpg4/bin/grep

fi

# Variable based on installation

OUI_SILENT=false

#

# Default values set by Installer

#

ORACLE_HOME=/u01/app/db11g/product/11.2.0/dbhome_1

ORACLE_OWNER=oracle

OSDBA_GROUP=oinstall

MAKE=/usr/bin/make

#

# conditional code execution starts. This set of code is invoked exactly once

# regardless of number of scripts that source rootmacro.sh

if [ "x$WAS_ROOTMACRO_CALL_MADE" = "x" ]; then

WAS_ROOTMACRO_CALL_MADE=YES ; export WAS_ROOTMACRO_CALL_MADE

LOG=${ORACLE_HOME}/install/root_`$UNAME -n`_`$DATE +%F_%H-%M-%S`.log ; export LOG

#

# Parse argument

#

while [ $# -gt 0 ]

do

case $1 in

-silent)  SILENT_F=1;;         # silent is set to true

-crshome) shift; CRSHOME=$1; export CRSHOME;;  # CRSHOME is set

-bindir) shift; LBIN=$1; export LBIN;;

esac;

shift

done

#

# If LOG is not set, then send output to /dev/null

#

if [ "x${LOG}" = "x" -o "${LOG}" = "" ];then

LOG=/dev/null

else

$CP $LOG ${LOG}0 2>/dev/null

$ECHO "" > $LOG

fi

#

# Silent variable is set based on :

# if OUI_SILENT is true or if SILEN

时间: 2024-12-15 14:21:51

又一次发现Oracle太美之root.sh的相关文章

重新发现Oracle太美之root.sh

如果你执行下以下命令基本上会在Oracle软件目录下会发现两个root.sh的脚本 [[email protected] Templates]$ find /u01/ -name root.sh |xargs ls -ltr -rwxrwx--- 1 oracle oinstall  10 May 14 02:37 /u01/app/db11g/product/11.2.0/dbhome_1/inventory/Templates/root.sh -rwxr-x--- 1 oracle oins

重新发现Oracle太美之orainstRoot.sh

我们安装数据库软件的时候,都要会执行orainstRoot.sh,今天就来仔细看看这个脚本是来干嘛的. 平台为RedHat 6.4 x64位的,数据库版本为11.2.0.4.2 下面是脚本的内容 [[email protected] ~]$ cd /u01/app/oraInventory/ [[email protected] oraInventory]$ ls -ltr total 24 drwxrwx--- 2 oracle oinstall 4096 Oct 30  2013 Conte

又一次发现Oracle太美之orainstRoot.sh

又一次发现Oracle太美之orainstRoot.sh 我们安装数据库软件的时候,都要会运行orainstRoot.sh,今天就来细致看看这个脚本是来干嘛的. 平台为RedHat 6.4 x64位的,数据库版本号为11.2.0.4.2 以下是脚本的内容 [[email protected] ~]$ cd /u01/app/oraInventory/ [[email protected] oraInventory]$ ls -ltr total 24 drwxrwx--- 2 oracle oi

重新发现Oracle太美之awr相关脚本简单介绍

大家知道在$ORACLE_HOME/rdbms/admin下,有如下的相关脚本(我的环境为11.2.0.4.2): [[email protected] ~]$ cd $ORACLE_HOME/rdbms/admin [[email protected] admin]$ ls -ltr awr* -rw-r--r-- 1 oracle oinstall  1999 Oct 24  2003 awrrpt.sql -rw-r--r-- 1 oracle oinstall 49166 Sep  1

重新发现Oracle太美之glogin.sql

刚开始接触Oracle的时候,有时候一登陆一个生产环境,经常会出现下面的情况: [[email protected] app]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.4.0 Production on Thu May 15 03:17:34 2014 Copyright (c) 1982, 2013, Oracle.  All rights reserved. Connected to: Oracle Database 11g Enterpr

重新发现Oracle太美之如何重新安装sqlplus help?

在Oracle数据库中安装sqlplus中帮助命令行的脚本在$ORACLE_HOME/sqlplus/admin/help下面. 如下所示: [[email protected] admin]$ cd $ORACLE_HOME/sqlplus/admin [[email protected] admin]$ ls -ltr total 20 -rw-r--r-- 1 oracle oinstall 2118 Feb 16  2003 pupbld.sql -rw-r--r-- 1 oracle

又一次发现Oracle太美之awr相关脚本简介

大家知道在$ORACLE_HOME/rdbms/admin下,有例如以下的相关脚本(我的环境为11.2.0.4.2): [[email protected] ~]$ cd $ORACLE_HOME/rdbms/admin [[email protected] admin]$ ls -ltr awr* -rw-r--r-- 1 oracle oinstall ?1999 Oct 24 ?2003 awrrpt.sql -rw-r--r-- 1 oracle oinstall 49166 Sep ?

又一次发现Oracle太美之glogin.sql

刚開始接触Oracle的时候,有时候一登陆一个生产环境.常常会出现以下的情况: [[email protected] app]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.4.0 Production on Thu May 15 03:17:34 2014 Copyright (c) 1982, 2013, Oracle.  All rights reserved. Connected to: Oracle Database 11g Enterpr

Failed to upgrade Oracle Cluster Registry configuration(root.sh)

近期在给客户基于Suse 11 sp3安装Oracle 10g RAC,在安装完clusterware运行/u01/app/crs/root.sh时收到错误提示.Failed to upgrade Oracle Cluster Registry configuration因为当前的环境使用了多路径,从Oracle的描写叙述来看.这是一个Oracle Bug(4679769),假设你有同样的问题,请接着往下看. 一.故障现象suse11a:/u01/app/crs # /u01/app/crs/r