oracle11gR2在RedHat5上前期安裝配置指令碼

rainbowbridg發表於2012-03-14

cat oracle11g_pre.sh

注意還需要注意shm

在 /etc/fstab 裡修改一下:

tmpfs /dev/shm tmpfs defaults,size=4096M 0 0

加上這個size,可以設為實體記憶體的1.5倍

[@more@]rpm -Uvh setarch-2*
rpm -Uvh make-3*
rpm -Uvh glibc-2*
rpm -Uvh libaio-0*
rpm -Uvh compat-libstdc++-33-3*
rpm -Uvh compat-gcc-34-3*
rpm -Uvh compat-gcc-34-c++-3*
rpm -Uvh gcc-4*
rpm -Uvh libXp-1*
rpm -Uvh openmotif-2*
rpm -Uvh compat-db-4*
rpm -Uvh unixODBC*
rpm -Uvh libaio-*

echo "
#kernel.shmall=2097152
kernel.shmmax=1073741824
kernel.shmmni=4096
kernel.sem=250 32000 100 128
fs.file-max=65536
net.ipv4.ip_local_port_range=1024 65000

fs.file-max = 6815744
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576
" >> /etc/sysctl.ctl

echo "
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
" >> /etc/security/limits.conf

sysctl -p

groupadd oinstall
groupadd dba
useradd oracle -g oinstall -G dba

mkdir /opt/oracle
chown oracle:dba /opt/oracle

mkdir /opt/oraInventory
chown oracle:dba /opt/oraInventory

echo "
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
" >> /etc/profile

echo "
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export PATH=$PATH:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export ORACLE_SID=sing
#export LD_ASSUME_KERNEL=2.4.8
export THREADS_FLAG=native
export NLS_DATE_FORMAT="Mon DD YYYY HH24:MI:SS"
export PATH=$PATH:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch
export NLS_LANG=.UTF8
#export LANG=en_US.UTF-8
export LANG=AMERICAN_AMERICA.UTF8
export CLASSPATH=$CLASSPATH:$ORACLE_HOME/jdk:$ORACLE_HOME/jre:$ORACLE_HOME/jlib
unset USERNAME
" >> /home/oracle/.bash_profile

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7916042/viewspace-1057588/,如需轉載,請註明出處,否則將追究法律責任。

相關文章