如果你执行下以下命令基本上会在Oracle软件目录下会发现两个root.sh的脚本
[oracle@rh64 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的主要作用。
[oracle@rh64 ~]$ 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 "$@"
. /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 
[oracle@rh64 ~]$ 
可以看到上面脚本里面包含了6个小的脚本,我们一一来分析下看看这个root.sh里面的脚本都是干啥的。

1.第一个脚本
[oracle@rh64 ~]$ 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 SILENT_F is 1
#
  if [ "${OUI_SILENT}" = "true" -o "$SILENT_F" ]
  then
    SILENT=1
  else
    SILENT=0
  fi

if [ $SILENT -eq 1 ]
  then
    $ECHO "Check $LOG for the output of root script"
    exec > $LOG 2>&1
  else
    mkfifo $LOG.pipe
    tee < $LOG.pipe $LOG &
    exec &> $LOG.pipe
    rm $LOG.pipe
  fi
#
# check for valid crshome
#

if [ "$CRSHOME" -a ! -d "$CRSHOME" ]; then
    $ECHO "ERROR: CRS home $CRSHOME is not a valid directory." | $TEE -a $LOG
  exit 1
  fi
----->>>检查是否设置crshome
#
# Determine how to suppress newline with $ECHO command.
#

case ${N}$C in
  "") if $ECHO "\c"| $GREP c >/dev/null 2>&1;then
        N='-n'
      else
        C='\c'
      fi;;
  esac


# check for zero UID
#

RUID=`/usr/bin/id|$AWK -F\( '{print $1}'|$AWK -F= '{print $2}'`
  if [ $RUID -ne 0 ];then
    $ECHO "You must be logged in as user with UID as zero (e.g. root user) to run root configuration script."| $TEE -a $LOG
    $ECHO "Log in as user with UID as zero (e.g. root user) and restart root configuration script execution."| $TEE -a $LOG
    exit 1
  fi
----->>>检查是否以root用户执行操作
#
# Display abort message on interrupt.
#

trap '$ECHO "Oracle root script execution aborted!"| $TEE -a $LOG;exit' 1 2 3 15

#
# Check for $LOG file existence and if it exists, change the ownership to oracle_owner:oracle_owner_group and permissions to 600
#

if [ -f $LOG ];then
          $CHOWN $ORACLE_OWNER:$OSDBA_GROUP $LOG
          $CHMOD 600 $LOG
        fi
fi
#conditional code execution ends
------>>>>修改权限,修改宿主,拥有者,日志权限为600
可以看到上述脚本主要是检查是否为root用户,修改宿主,并且需要在环境变量有相应的ORACLE_HOME,ORACLE_OWNER等
[oracle@rh64 ~]$ 
第二个脚本
[oracle@rh64 ~]$ cat /u01/app/db11g/product/11.2.0/dbhome_1/install/utl/rootinstall.sh
$ECHO "Performing root user operation for Oracle 11g "

$ECHO ""
$ECHO "The following environment variables are set as:"
$ECHO "    ORACLE_OWNER= $ORACLE_OWNER"
$ECHO "    ORACLE_HOME=  $ORACLE_HOME"

#
# Get name of local bin directory
#

saveLBIN=$LBIN
retry='r'
while [ "$retry" = "r" ]
do
  if [ $SILENT -eq 0 ]
  then
    LBIN=$saveLBIN
    $ECHO ""
    $ECHO $N "Enter the full pathname of the local bin directory: $C"
    DEFLT=${LBIN}; . $ORACLE_HOME/install/utl/read.sh; LBIN=$RDVAR
  fi

if [ ! -d $LBIN ];then
    $ECHO "Creating ${LBIN} directory..."
    $MKDIR -p ${LBIN} 2>&1
    $CHMOD 755 ${LBIN} 2>&1
  fi
  if [ ! -w $LBIN ]
  then
    if [ $SILENT -eq 0 ]
    then
      $ECHO ""
      $ECHO $N "$LBIN is read only.  Continue without copy (y/n) or retry (r)? $C"
      DEFLT='y' ; . $ORACLE_HOME/install/utl/read.sh ; retry=$RDVAR
    else
      retry='y'  # continue without copy
    fi
  else
    retry='y'
  fi
done
if [ "$retry" = "n" ] ; then
  $ECHO "Warning: Script terminated by user."
  exit 1
fi

#
# Move files to LBIN, and set permissions
#

DBHOME=$ORACLE_HOME/bin/dbhome
ORAENV=$ORACLE_HOME/bin/oraenv
CORAENV=$ORACLE_HOME/bin/coraenv
FILES="$DBHOME $ORAENV $CORAENV"
----->>>这里就是移动这几个文件,然后设置相应的权限。上面三个环境变量比较熟悉,我们需要升级备份的时候通常需要备份这些东西,
其实这个东西可以从$ORACLE_HOME/bin下拷贝过到/usr/local/bin,所以屌丝们以后可以不用担心了~~~
if [ -w $LBIN ]
then
  for f in $FILES ; do
    if [ -f $f ] ; then
      $CHMOD 755 $f  2>&1 2>> $LOG
      short_f=`$ECHO $f | $SED 's;.*/;;'`
      lbin_f=$LBIN/$short_f
      if [ -f $lbin_f -a $SILENT -eq 0 ] ; then
        DIFF_STATUS=`$DIFF $f $lbin_f`
        if [ $? -ne 0 ] ; then
          # The contents of $lbin_f and $f are different (User updated $lbin_f)
          # Prompt user before overwriting $lbin_f.
          $ECHO $n "The file \"$short_f\" already exists in $LBIN.  Overwrite it? (y/n) $C"
          DEFLT='n'; . $ORACLE_HOME/install/utl/read.sh; OVERWRITE=$RDVAR
        else
          # The contents of $lbin_f and $f are identical. Don't overwrite.
          $ECHO "The contents of \"$short_f\" have not changed. No need to overwrite."
          OVERWRITE='n';        
        fi
      else
        OVERWRITE='y';
      fi
      if [ "$OVERWRITE" = "y" -o "$OVERWRITE" = "Y" ] ; then
        $CP $f $LBIN  2>&1 2>>  $LOG
        $CHMOD 755 $lbin_f  2>&1 2>> $LOG
        $CHOWN $ORACLE_OWNER $LBIN/`$ECHO $f | $AWK -F/ '{print $NF}'` 2>&1 2>> $LOG
        $ECHO "   Copying $short_f to $LBIN ..."
      fi
    fi
  done
- ----->>>注意这几个权限为755,下面是对比下$ORACLE_HOME和/usr/local/bin下几个文件权限和宿主的区别
[oracle@rh64 bin]$ ls -ltr dbhome
-rwxr-xr-x 1 oracle oinstall 2415 Jan  1  2000 dbhome
[oracle@rh64 bin]$ ls -tlr coraenv
-rwxr-xr-x 1 oracle oinstall 5778 Jan  1  2000 coraenv
[oracle@rh64 bin]$ ls -ltr oraenv
-rwxr-xr-x 1 oracle oinstall 6183 Jan  1  2000 oraenv

[root@rh64 bin]# ls -ltr dbhome
-rwxr-xr-x 1 oracle root 2415 Oct 30  2013 dbhome
[root@rh64 bin]# ls -ltr oraenv
-rwxr-xr-x 1 oracle root 6183 Oct 30  2013 oraenv
[root@rh64 bin]# ls -ltr coraenv
-rwxr-xr-x 1 oracle root 5778 Oct 30  2013 coraenv

------->>>>看到了吗?权限都是755,但是/usr/local/bin的拥有者为oracle:root,如果不慎丢失需要手工拷过来的时候记得需要改成755,oracle:root

else
  $ECHO ""
  $ECHO "Warning: $LBIN is read only. No files will be copied."
fi
$ECHO ""

#
# Make sure an oratab file exists on this system
#

# Variable to determine whether oratab is new or not; default is true
NEW="true"

if [ ! -s ${ORATAB} ];then
  $ECHO "" 
  $ECHO "Creating ${ORATAB} file..."
  if [ ! -d ${ORATABLOC} ];then
    $MKDIR -p ${ORATABLOC}
  fi

$CAT <<!>> ${ORATAB}
#

# 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.
#
#
!

else
# Oratab file exists; this is not a new installation on this system.
# We check if temporary install/oratab exists, and then check if the entry
# in temporary install/oratab has been added to the oratab file.
# In case of patchset this is usually the case, and we don't want to reappend
# the same entry to oratab again.
  if [ -f $ORACLE_HOME/install/oratab ]
  then
    TMP_ENTRY=`$GREP "${ORACLE_HOME}" $ORACLE_HOME/install/oratab`

FOUND=`$GREP "${TMP_ENTRY}" ${ORATAB}`
    if [ -n "${FOUND}" ]
    then
      NEW="false"
    fi
  fi
fi
----->>>>注意,我们所有root.sh脚本执行的日志都会在$ORACLE_HOME/install/下面有的,以便我们进行错误定位
$CHOWN $ORACLE_OWNER:$OSDBA_GROUP ${ORATAB}
$CHMOD 664 ${ORATAB}
----->>>/etc/oratab的权限为664
#
# If there is an old entry with no sid and same oracle home,
# that entry will be marked as a comment.
#

FOUND_OLD=`$GREP "^*:${ORACLE_HOME}:" ${ORATAB}`
if [ -n "${FOUND_OLD}" ];then
  $SED -e "s?^*:$ORACLE_HOME:?# *:$ORACLE_HOME:?" $ORATAB > $TMPORATB
  $CAT $TMPORATB > $ORATAB
  $RM -f $TMPORATB 2>/dev/null
fi

$ECHO "Entries will be added to the ${ORATAB} file as needed by"
$ECHO "Database Configuration Assistant when a database is created"

#
# Append the dbca temporary oratab entry to oratab
# In the case of ASM and RAC install, oratab is not yet created when root.sh
# is run, so we need to check for its existence before attempting to append it.
#
if [ -f $ORACLE_HOME/install/oratab -a $NEW = "true" ]
then
  $CAT $ORACLE_HOME/install/oratab >> $ORATAB
fi

$ECHO "Finished running generic part of root script."
$ECHO "Now product-specific root actions will be performed."

第三个脚本
[oracle@rh64 ~]$ cat /u01/app/db11g/product/11.2.0/dbhome_1/install/unix/rootadd.sh
#!/bin/sh
#!/usr/bin/sh
ORACLE_HOME=/u01/app/db11g/product/11.2.0/dbhome_1
. $ORACLE_HOME/install/utl/rootmacro.sh

# the following commands need to run as root after installing 
# the OEM Daemon

AWK=/usr/bin/awk
CAT=/usr/bin/cat
CHOWN="/usr/bin/chown"
CHMOD="/usr/bin/chmod"
CHMODR="/usr/bin/chmod -R"
CP=/usr/bin/cp
ECHO=/usr/bin/echo
MKDIR=/usr/bin/mkdir
TEE=/usr/bin/tee
RM=/bin/rm
MV=/bin/mv
GREP=/usr/bin/grep
CUT=/bin/cut
SED=/usr/bin/sed

PLATFORM=`uname`

if [ ${PLATFORM} = "Linux" ] ; then
  CAT=/bin/cat
  CHOWN=/bin/chown
  CHMOD=/bin/chmod
  CHMODR="/bin/chmod -R"
  CP=/bin/cp
  ECHO=/bin/echo
  MKDIR=/bin/mkdir
  GREP=/bin/grep
  if [ ! -f $CUT ] ; then
     CUT=/usr/bin/cut
  fi
  SED=/bin/sed
fi

if [ ${PLATFORM} = "SunOS" ] ; then
   GREP=/usr/xpg4/bin/grep
fi

if [ ${PLATFORM} = "Darwin" ] ; then 
  CAT=/bin/cat 
  CHOWN="/usr/sbin/chown" 
  CHMOD="/bin/chmod" 
  CHMODR="/bin/chmod -R" 
  CP=/bin/cp 
  ECHO=/bin/echo 
  MKDIR=/bin/mkdir 
  CUT=/usr/bin/cut 
fi

# change owner and permissions of the remote operations executible
if [ -f  ${ORACLE_HOME}/bin/nmo.0 ];
then
  $RM -f ${ORACLE_HOME}/bin/nmo
  $CP -p ${ORACLE_HOME}/bin/nmo.0 ${ORACLE_HOME}/bin/nmo
fi
$CHOWN root $ORACLE_HOME/bin/nmo
$CHMOD 4710 $ORACLE_HOME/bin/nmo

# change owner and permissions of the program that does memory computations
if [ -f  ${ORACLE_HOME}/bin/nmb.0 ];
then
  $RM -f ${ORACLE_HOME}/bin/nmb
  $CP -p ${ORACLE_HOME}/bin/nmb.0 ${ORACLE_HOME}/bin/nmb
fi
$CHOWN root $ORACLE_HOME/bin/nmb
$CHMOD 4710 $ORACLE_HOME/bin/nmb

# change owner and permissions of the storage metrics executible
if [ -f  ${ORACLE_HOME}/bin/nmhs.0 ];
then
  $RM -f ${ORACLE_HOME}/bin/nmhs
  $CP -p ${ORACLE_HOME}/bin/nmhs.0 ${ORACLE_HOME}/bin/nmhs
fi
$CHOWN root $ORACLE_HOME/bin/nmhs
$CHMOD 4710 $ORACLE_HOME/bin/nmhs

#change permissions on emdctl and emagent
$CHMOD 700 $ORACLE_HOME/bin/emagent
$CHMOD 700 $ORACLE_HOME/bin/emdctl

# change permissions so they are accessible by users from groups
# other than the agent user group.
$CHMOD 755 $ORACLE_HOME/bin
$CHMODR a+rX $ORACLE_HOME/lib
$CHMODR a+rX $ORACLE_HOME/perl
#$CHMODR a+rX $ORACLE_HOME/sysman/admin/scripts
$CHMODR a+rX $ORACLE_HOME/jdk
$CHMOD 755 $ORACLE_HOME/bin/nmocat

#
# Following changes to system executables are needed for getting
# host inventory metrics on HP-UX
#
if [ ${PLATFORM} = "HP-UX" ] ; then
  $CHMOD 555 /usr/sbin/swapinfo
  #$CHMOD +r /dev/rdsk/*
fi

$ECHO "Finished product-specific root actions."| $TEE -a $LOG

[oracle@rh64 ~]$

第四个脚本:
[oracle@rh64 ~]$ cat /u01/app/db11g/product/11.2.0/dbhome_1/network/install/sqlnet/setowner.sh 
#!/bin/sh
ORACLE_HOME=/u01/app/db11g/product/11.2.0/dbhome_1
. $ORACLE_HOME/install/utl/rootmacro.sh
:
if [ ! -d /var/tmp/.oracle ]
then
  $MKDIR -p /var/tmp/.oracle;
fi

$CHMOD 01777 /var/tmp/.oracle
$CHOWN root  /var/tmp/.oracle

if [ ! -d /tmp/.oracle ]
then
  $MKDIR -p /tmp/.oracle;
fi

$CHMOD 01777 /tmp/.oracle
$CHOWN root  /tmp/.oracle
------->>>这个地方要注意了,这个临时文件的.oracle,有点意思
第五个脚本:
[oracle@rh64 ~]$ cat /u01/app/db11g/product/11.2.0/dbhome_1/rdbms/install/rootadd_rdbms.sh
#!/bin/sh

ORACLE_HOME=/u01/app/db11g/product/11.2.0/dbhome_1
CHOWN=/bin/chown
CHMOD=/bin/chmod
RM=/bin/rm
AWK=/bin/awk
ECHO=/bin/echo
CP=/bin/cp

#
# check for zero UID
#
RUID=`/usr/bin/id|$AWK -F\( '{print $1}'|$AWK -F= '{print $2}'`
if [ $RUID -ne 0 ];then
  $ECHO "You must be logged in as user with UID as zero (e.g. root user) to run root.sh."
  $ECHO "Log in as user with UID as zero (e.g. root user) and restart root.sh execution."
  exit 1
fi

if [ -f $ORACLE_HOME/bin/oradism ]; then
        $CHOWN root $ORACLE_HOME/bin/oradism
        $CHMOD 4750 $ORACLE_HOME/bin/oradism
fi
# remove backup copy
if [ -f $ORACLE_HOME/bin/oradism.old ]; then
        $RM -f $ORACLE_HOME/bin/oradism.old
fi
# copy extjobo to extjob if it doesn't exist
if [ ! -f $ORACLE_HOME/bin/extjob -a -f $ORACLE_HOME/bin/extjobo ]; then
        $CP -p $ORACLE_HOME/bin/extjobo $ORACLE_HOME/bin/extjob
fi
if [ -f $ORACLE_HOME/bin/extjob ]; then
        $CHOWN root $ORACLE_HOME/bin/extjob
        $CHMOD 4750 $ORACLE_HOME/bin/extjob
fi
if [ -f $ORACLE_HOME/rdbms/admin/externaljob.ora ]; then
        $CHOWN root $ORACLE_HOME/rdbms/admin/externaljob.ora
        $CHMOD 640 $ORACLE_HOME/rdbms/admin/externaljob.ora
fi
# properly setup job scheduler switch user executable
if [ -f $ORACLE_HOME/bin/jssu ]; then
        $CHOWN root $ORACLE_HOME/bin/jssu
        $CHMOD 4750 $ORACLE_HOME/bin/jssu
fi
# remove backup copy
if [ -f $ORACLE_HOME/rdbms/admin/externaljob.ora.orig ]; then
        $RM -f $ORACLE_HOME/rdbms/admin/externaljob.ora.orig
fi

# tighten permissions on $ORACLE_HOME/scheduler/wallet
$CHMOD 0700 $ORACLE_HOME/scheduler/wallet

# Add a large number to file-max kernel param for memory_target on Linux
OSINFO=`/bin/uname -a`
SYSCTL=/sbin/sysctl
FSMAXFILE=/proc/sys/fs/file-max
FSMVAL=""
SYSCTLCONF=/etc/sysctl.conf
AWK=/bin/awk
SED=/bin/sed
case $OSINFO in
Linux*)
 # Read value from /etc/sysctl.conf
 if [ -w $SYSCTLCONF ]; then
  while read line
  do
  case ${line} in
    fs.file-max*)
      # Value exists in /etc/sysctl.conf. Strip space/tabs and store its value.
      FSMVAL=`$ECHO ${line} | $SED 's/fs.file-max\s*=\s*//g'`
    ;;
   esac
  done < $SYSCTLCONF
 fi
 
 # Update the filemax for current usage
 # bug 9797468: change value from 6.4M to 6815744 (due to validated configs)
 if [ -z $FSMVAL ] || [ $FSMVAL -lt 6815744 ]; then
   # Value is less than our 6815744, update it
   $SYSCTL -q -w fs.file-max=6815744
   if [ -f $FSMAXFILE ]; then
    $ECHO 6815744 > $FSMAXFILE
   fi
 fi
------->>>>这里是修改filemax的,需要注意  
 # Update the filemax across machine reboots by persisting to /etc/sysctl.conf
 if [ $FSMVAL ]; then
    # Value exists, but less than our requirement. So overwrite it.
    if [ $FSMVAL -lt 6815744 ]; then
     # Persist it to /etc/sysctl.conf using sed
     # Take into account tabs/spaces - bug 9462640
     if [ -f $SED ]; then
        $SED -i.bak -e "s/^fs.file-max\s*=.*/fs.file-max = 6815744/" $SYSCTLCONF 
     fi
    fi
 else
    # Value does not exist, so append our required value.
    FSMVAL="fs.file-max = 6815744"
    $ECHO $FSMVAL >> $SYSCTLCONF
 fi

;;
esac

第六个脚本:
[oracle@rh64 tmp]$ cat /u01/app/db11g/product/11.2.0/dbhome_1/rdbms/install/rootadd_filemap.sh 
#!/bin/sh
# The filemap binaries need to exist under /opt/ORCLfmap/prot1_X where
# X is either 32 for 32-bit Solaris machines and 64 for 64-bit Solaris
# machines.
#
# Other UNIX platforms will have to do something similar  
ORACLE_HOME=/u01/app/db11g/product/11.2.0/dbhome_1
. $ORACLE_HOME/install/utl/rootmacro.sh

ORCLFMAPLOC=/opt/ORCLfmap
FILEMAPLOC=$ORCLFMAPLOC/prot1_64 # needs to be prot1_32 for 32 bit platforms

if [ ! -d $ORCLFMAPLOC ];then
$MKDIR $ORCLFMAPLOC
fi
if [ ! -d $FILEMAPLOC ];then
$MKDIR $FILEMAPLOC
fi
if [ ! -d $FILEMAPLOC/bin ];then
$MKDIR $FILEMAPLOC/bin
fi
if [ ! -d $FILEMAPLOC/etc ];then
$MKDIR $FILEMAPLOC/etc
fi
if [ ! -d $FILEMAPLOC/log ];then
$MKDIR $FILEMAPLOC/log
fi

if [ ! -z "$OSDBA_GROUP" ];then
  FMPUTL_GROUP=$OSDBA_GROUP
else
  FMPUTL_GROUP=root
fi

$CP $ORACLE_HOME/bin/fmputl $FILEMAPLOC/bin
$CP $ORACLE_HOME/bin/fmputlhp $FILEMAPLOC/bin
$CHMOD 550 $FILEMAPLOC/bin/fmputl
$CHGRP $FMPUTL_GROUP $FILEMAPLOC/bin/fmputlhp 
$CHMOD 4550 $FILEMAPLOC/bin/fmputlhp
if [ ! -f $FILEMAPLOC/etc/filemap.ora ];then
$CP $ORACLE_HOME/rdbms/install/filemap.ora $FILEMAPLOC/etc
fi

我把/usr/local/bin/下的东西删除后,对数据库启动关闭没啥影响,

看过一遍脚本后,就明白了root.sh是用来干嘛的,希望大家有时间多看看oracle自带的东西,一定会有所收获了。
oracle是高度模块化的东西,什么几乎都可以重建。就算是备份恢复,当你明白了原理,在面对意外恢复时,你也会想出metalink
想不到的好方法,一切在自己的思维了,跳出了固定模式的思维,你才会进步。

重新发现Oracle太美之root.sh相关推荐

  1. oracle修改c root,从新发现Oracle太美之root.sh

    重新发现Oracle太美之root.sh 如果你执行下以下命令基本上会在Oracle软件目录下会发现两个root.sh的脚本 [oracle@rh64 Templates]$ find /u01/ - ...

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

    又一次发现Oracle太美之awr相关脚本简介 大家知道在$ORACLE_HOME/rdbms/admin下,有例如以下的相关脚本(我的环境为11.2.0.4.2): [oracle@rh64 ~]$ ...

  3. Oracle RAC 第二节点 root.sh 报错 Timed out waiting for the CRS stack to start

    在VBox 上安装11.2.0.1的RAC. 这里打算安装11.2.0.1是因为从11.2.0.2以后的版本对public 和private 网卡网段区分很严格,这个网卡必须配置在不同的网段. 而在1 ...

  4. oracle 10g rac 包root.sh报错,案例:Oracle Rac root.sh报错 Failed to create keys in the OLR

    天萃荷净 [root@web1 grid]# /u01/app/11.2.0/grid/root.sh Performing root user operation for Oracle 11g Th ...

  5. 如何诊断crs 安装时 root.sh 脚本执行错误

    troubleshooting root.sh problem ------*for 10g and 11.1 1.查证公网,私网的节点名是可以互相ping通的 2.---查证OCR/Voting 文 ...

  6. oracle9i rac for aix,oracle 11gR2 rac for aix 第二个节点运行root.sh不成功问题处理

    今天帮客户规划安装一套11gR2 rac for aix 数据库,在安装grid集群软件时,第一个节点运行 root.sh成功,运行第二个节点root.sh不成功,主要原因是忘记更改两个节点磁盘的 r ...

  7. 安装oracle 19c rac报错:2节点执行root.sh asm实例启动失败

    安装oracle 19c rac报错:2节点执行root.sh asm实例启动失败 背景 解决过程 查看lmon trc 查看mos 真的是网络的问题 haip 禁用haip 安装好的环境禁用haip ...

  8. oracle 11gR2 RAC root.sh 错误 ORA-15072 ORA-15018

    Oracle  11gR2 RAC 安装Clusterware 结束, 在第二个节点执行root.sh脚本的是报如下错误: DiskGroup DATA1 creation failed with t ...

  9. 12 c for. oracle rac,【案例】Oracle RAC FOR AIX搭建执行root.sh时两次报错的解决办法

    天萃荷净 运维DBA反映在aix 5.3 ml6安装10.2.0.1 rac报错0509-036 Cannot load program crsctl.bin because of the follo ...

  10. Oracle 11g RAC 第二节点root.sh执行失败后再次执行root.sh

    Oracle 11g RAC 第二节点root.sh执行失败后再次执行root.sh前,要先清除之前的crs配置信息 # /u01/app/11.2.0/grid/crs/install/rootcr ...

最新文章

  1. 2018年全球自动驾驶法律政策研究 | 附报告下载
  2. C#程序 权限不够的解决方案
  3. JavaWeb学习总结(六)—HttpServletResponse
  4. 推荐一款基于web的Unix系统管理工具webmin
  5. Java程序员该如何学习才能成长为一名优秀的架构师
  6. java控制进程_⑨进程控制
  7. mybatis 多表查询-多对多
  8. 面向对象——私有成员
  9. ASP.NET 2.0 Web Part编程之定制Web Part
  10. 用html5制作机柜,基于HTML5 Canvas 点击添加 2D 3D 机柜模型
  11. 视频播放器+控制器--封装
  12. ES6 json转map map转json
  13. android之textview属性介绍
  14. linux 命令 tar 打包压缩命令 date时间 命令实践
  15. 使用echarts制作拓扑图
  16. 10大热门的物联网初创公司
  17. 10g ASM下加控制文件 .
  18. 什么是web前端开发工程师?主要做什么的?
  19. 解决桌面图标无法拖动的方法
  20. 记录 免费高清视频下载网站

热门文章

  1. Rect 和 Bounds
  2. TextRank算法原理简析、代码实现
  3. python爬取简历模板_python爬取简历模板
  4. java 运行器_[原创]我也来做一个最简单的Java2EXE的运行器
  5. android自动调节屏幕亮度自动调节流程解析
  6. apicloud 获取手机虚拟键盘高度
  7. 手动安装hadoop集群
  8. kali linux国内源
  9. 中规院交通院《上海全球城市综合交通体系承载能力与开发研究》
  10. U盘被写保护?我来教你高级格式化