设为首页 加入收藏

TOP

重新发现Oracle太美之root.sh(六)
2015-07-24 10:35:08 来源: 作者: 【 】 浏览:7
Tags:重新 发现 Oracle root.sh
racle,有点意思
第五个脚本:
[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/ap
首页 上一页 3 4 5 6 下一页 尾页 6/6/6
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇oracle数据库开发面试题 下一篇oracle存储过程+游标处理select数..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·TCP/UDP协议_百度百科 (2025-12-26 12:20:11)
·什么是TCP和UDP协议 (2025-12-26 12:20:09)
·TCP和UDP详解 (非常 (2025-12-26 12:20:06)
·Python 教程 - W3Sch (2025-12-26 12:00:51)
·Python基础教程,Pyt (2025-12-26 12:00:48)