打杂
全部博文(524)
分类: Oracle
2014-12-03 14:15:59
#执行本脚本前请确认已为Linux设固定IP
test -f /bin/zcs.sh && exit
echo '安装oracle依赖的软件'
sleep 3
umount /dev/cdrom
mount /dev/cdrom /mnt
cat << zcs > /etc/yum.repos.d/ora.repo
[aaaaa]
name=ok yum
baseurl=file:///mnt/Server
enabled=1
gpgcheck=0
zcs
sleep
yum -y install make* gcc* glibc* compat-db* compat-gcc* compat-gcc* compat-libstdc++* compat-libstdc* openmotif* setarch*
sleep
IPIP=`ifconfig eth0|grep "inet addr"|cut -d: -f2 |cut -d" " -f1`
sed '/HOSTNAME/ s/^/#/' /etc/sysconfig/network >> /etc/sysconfig/network
echo 'HOSTNAME=$HOSTNAME' >> /etc/sysconfig/network
echo "$IPIP $HOSTNAME oracle" >> /etc/hosts
echo 'LANG="en_US.UTF-8"' > /etc/sysconfig/i18n
sleep 2
echo 'config oracle安装用户'
cat << zcsshok > /bin/zcs.sh
#!/bin/bash
groupadd oinstall
groupadd dba
useradd -g oinstall -G dba oracle
echo oracle|passwd --stdin oracle
cat << bashprook >> /home/oracle/.bash_profile
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
export ORACLE_SID=orcl
export PATH=$ORACLE_HOME/bin:$PATH
bashprook
source /home/oracle/.bash_profile
echo 'config 内核参数'
cat << sysctlok >> /etc/sysctl.conf
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 262144
sysctlok
sysctl -p
echo 'config shell参数#'
cat << limitsok >> /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
limitsok
echo 'config PAM参数#'
cat << loginok >> /etc/pam.d/login
# for oracle powered by zcs
session required /lib/security/pam_limits.so
session required pam_limits.so
loginok
echo '#config shell环境#'
cat << profileok >> /etc/profile
# for oracle powered by zcs
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
profileok
source /etc/profile
echo 'config 安装目录,复制安装文件'
mkdir -p /u01/app/oracle
chown -R oracle:oinstall /u01
chmod -R 775 /u01
cd /u01
wget
rm -rf /u01/database
unzip 10201_database_linux32.zip
wget
wget
zcsshok
chmod +x /bin/zcs.sh
/bin/zcs.sh
cd /u01