Fast Setup for Oracle Install on HP-UX

 快速设置环境、内核、网络参数for Oracle11gR2在HP-UX 11.31上得安装;

使用方法,和上两篇一样,您懂的;

 祝你成功:)

#!/usr/bin/ksh
# Copyright (C) 2004-2011 Alexatrebooting
# All Rights Reserved.
# Create by:alexatrebooting
# Email: alexatrebooting
# Update: 2011-12-1
# Usage:revise to direct execute
# description: Oracle 11g HP-UX Server install prepare script.

echo "create user and group"
mkdir -p /home/oracle
mkdir -p /home/grid
mkdir -p /u01/app/crs_base
mkdir -p /u01/app/crs_home
mkdir -p /u01/app/oracle/product/11.2.0/db_1
/usr/sbin/groupadd -g 501 oinstall
/usr/sbin/groupadd -g 502 dba
/usr/sbin/groupadd -g 503 oper
/usr/sbin/groupadd -g 504 asmadmin
/usr/sbin/groupadd -g 505 asmoper
/usr/sbin/groupadd -g 506 asmdba
/usr/sbin/useradd -g oinstall -G dba,asmdba,oper oracle
/usr/sbin/useradd -g oinstall -G asmadmin,asmdba,asmoper,oper,dba grid
chown -R  oracle:oinstall /home/oracle
chown -R grid:oinstall /home/grid
chown -R grid:oinstall /u01/app/crs*
chown -R oracle:oinstall /u01/app/oracle

echo "tune kernel parameter"
#kctune -h nproc=4096
#kctune -h ksi_alloc_max=32768
#kctune -h executable_stack=0
#kctune -h max_thread_proc=1024
#kctune -h maxdsiz=1073741824
#kctune -h maxdsiz_64bit=2147483648
#kctune -h maxfiles=1024
#kctune -h maxfiles_lim=63488
#kctune -h maxssiz=134217728
#kctune -h maxssiz_64bit=1073741824
kctune -h maxuprc=3686
kctune -h msgmni=4096
kctune -h msgtql=4096
kctune -h ncsize=35840
kctune -h nflocks=4096
kctune -h ninode=34816
kctune -h nkthread=7184
kctune -h semmni=8192 #?
kctune -h semmns=16384 #?
kctune -h semmnu=4092
kctune -h semvmx=32767
kctune -h shmmax=82463372083
kctune -h shmmni=4096
kctune -h shmseg=512
kctune -h swchunk=65536 #?
kctune -h vps_ceiling=16384 #?

echo "revise nddconf file"
cp /etc/rc.config.d/nddconf /etc/rc.config.d/nddconf.org.`date +%s`
cat >>/etc/rc.config.d/nddconf<<EOF
TRANSPORT_NAME[0]=tcp
NDD_NAME[0]=tcp_largest_anon_port
NDD_VALUE[0]=65500
 
TRANSPORT_NAME[1]=tcp
NDD_NAME[1]=tcp_smallest_anon_port
NDD_VALUE[1]=9000
 
TRANSPORT_NAME[0]=udp
NDD_NAME[0]=udp_largest_anon_port
NDD_VALUE[0]=65500
 
TRANSPORT_NAME[1]=udp
NDD_NAME[1]=udp_smallest_anon_port
NDD_VALUE[1]=9000
EOF

echo "Create Grid SetEnv Script"
ENVFILE1=/home/grid/setenv
cat > $ENVFILE1 <<EOF
export ORACLE_HOSTNAME=`hostname`
export JAVA_HOME=/usr/local/java
export ORACLE_SID=+ASM     #revise to your SID
export ORACLE_BASE=/u01/app/crs_base
export ORACLE_HOME=/u01/app/crs_home
export PATH=\$ORACLE_HOME/bin:\$JAVA_HOME/bin:\$PATH:/usr/local/bin/
#/usr/local/bin/bash
if [ -t 0 ]; then
   stty intr ^C
fi
if [ $USER = "oracle" ] || [ $USER = "grid" ]; then
        if [ $SHELL = "/bin/ksh" ]; then
              ulimit -p 16384
              ulimit -n 65536
        else
              ulimit -u 16384 -n 65536
        fi
                umask 022
fi

EOF

cat >> /home/grid/.profile <<EOF
# Load Grid 11g Env
. $ENVFILE1
EOF

echo "Create Oracle SetEnv Script"
ENVFILE2=/home/oracle/setenv
cat > $ENVFILE2 <<EOF
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=\$ORACLE_BASE/product/11.2.0/db_1
export GRID_HOME=/u01/app/crs_home
export ORACLE_OWNER=oracle
export ORACLE_SID=tdr1     #revise to your SID
export PATH=\$PATH:\$ORACLE_HOME/bin:\$GRID_HOME/bin:/sbin:/usr/sbin:/bin:/usr/local/bin
export LD_LIBRARY_PATH=\$ORACLE_HOME/lib:\$ORACLE_HOME/rdbms/lib:/lib:/usr/lib
export CLASSPATH=\$ORACLE_HOME/JRE:\$ORACLE_HOME/jlib:\$ORACLE_HOME/rdbms/jlib:\$ORACLE_HOME/network/jlib
export NLS_LANG=american_america.ZHS16GBK
export ORACLE_PATH=/home/oracle
#/usr/local/bin/bash
if [ -t 0 ]; then
stty intr ^C
fi
if [ $USER = "oracle" ] || [ $USER = "grid" ]; then
        if [ $SHELL = "/bin/ksh" ]; then
              ulimit -p 16384
              ulimit -n 65536
        else
              ulimit -u 16384 -n 65536
        fi
        umask 022
fi
EOF

cat >> /home/oracle/.profile <<EOF
# Load Oracle 11g Env
. $ENVFILE2
EOF


echo "Create root SetEnv Script"
ENVFILE3=/setenv
cat > $ENVFILE3 <<EOF
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=\$ORACLE_BASE/product/11.2.0/db_1
export GRID_HOME=/u01/app/crs_home
export ORACLE_OWNER=oracle
export ORACLE_SID=tdr1     #revise to your SID
export PATH=\$PATH:\$ORACLE_HOME/bin:\$GRID_HOME/bin:/u01/app/crs_home/bin:/sbin:/usr/sbin:/bin:/usr/local/bin:.
EOF

cat >> /.profile <<EOF
# Load Oracle 11g Env
. $ENVFILE3
EOF

 

你可能感兴趣的:(oracle,Install,RAC,setup,Fast,HP-UX11.31)