>/etc/hostsmem..."/>
您好,登錄后才能下訂單哦!
#!/bin/bash
ip=ifconfig|grep 'inet addr:'|grep -v '127.0.0.1'|cut -d: -f2 |awk '{ print $1}'
hostname=echo $HOSTNAME
echo "$ip $hostname ">>/etc/hosts
mem=grep MemTotal /proc/meminfo|awk '{print $2}'
shmmax=$(($mem/2*1024))
service iptables stop
sed -i "s/SELINUX=enforcing/SELINUX=disabled/" /etc/selinux/config
setenforce 0
#install packages
yum -y install readline unzip binutilsx86_64 glibcx86_64 compat-libstdc++x86_64 elfutils-libelfx86_64 gccx86_64 ksh-x86_64 libaiox86_64 libgccx86_64 libstdc++x86_64 makex86_64 numactl-develx86_64 sysstat-9x86_64 compat-libstdc++i686 compat-libcap libXp libaio
groupadd oinstall
groupadd dba
useradd -g oinstall -G dba oracle
echo oracle123|passwd oracle --stdin
mkdir -p /data/oracle //$ORACLE_BASE
mkdir -p /data/oracle/product/112010/db_1 //$ORACLE_HOME
mkdir /data/oracle/inventory
mkdir /data/oracle/oradata //存放數(shù)據(jù)庫(kù)目錄
mkdir /data/oracle/flash_recovery_area
chown -R oracle.oinstall /data/oracle
chmod -R 775 /data/oracle
mkdir /data/packages
ora_dir=/data/packages
mv /tmp/oraclepackages.zip $ora_dir
chown -R oracle.oinstall $ora_dir
##############################################
#modify sysctl.conf #
##############################################
sed -i -e "s/kernel.shmall./kernel.shmall = 2097152/" -e "s/kernel.shmmax./kernel.shmmax = $shmmax/" /etc/sysctl.conf
cat >> /etc/sysctl.conf <<done
fs.file-max = 6815744
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
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
done
sysctl -p
###############################################
#modify /etc/security/limits.conf #
###############################################
cat >> /etc/security/limits.conf << done
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
done
################################################
#modify /etc/pam.d/login #
################################################
echo "session required pam_limits.so">>/etc/pam.d/login
################################################
################################################
cat >> /etc/profile <<done
if [ \$USER = "oracle" ]; then
if [ \$SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
done
source /etc/profile
################################################
################################################
cat >> /home/oracle/.bash_profile <<done
export ORACLE_BASE=/data/oracle;
export ORACLE_HOME=/data/oracle/product/112010/db_1
export ORACLE_SID=orcl;
export PATH=\$PATH:\$HOME/bin:\$ORACLE_HOME/bin
export LD_LIBRARY_PATH=\$ORACLE_HOME/lib:/usr/lib
if [ \$USER = "oracle" ]; then
if [ \$SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
umask 022
fi
alias sqlplus='rlwrap sqlplus'
alias rman='rlwrap rman'
done
source /home/oracle/.bash_profile
################################################
################################################
su - oracle -c "cd $ora_dir&&unzip $ora_dir/oraclepackages.zip&&unzip -q $ora_dir/linux.x64_11gR2_database_2of1.zip -d /data/oracle&&unzip -q $ora_dir/linux.x64_11gR2_database_2of2.zip -d /data/oracle"
cd $ora_dir&&tar -zxvf rlwrap-0.43.tar.gz&&cd rlwrap-0.43&&./configure&&make&&make install
su - oracle -c "mv $ora_dir/.rsp /data/oracle/database/response/"
su - oracle -c "sed -i 's/ORACLE_HOSTNAME./ORACLE_HOSTNAME=echo $RANDOM
' /data/oracle/database/response/db_install.rsp"
su - oracle -c "cd /data/oracle/database/&&./runInstaller -silent -responseFile /data/oracle/database/response/db_install.rsp -ignorePrereq"
cat << EOF
###########################################################################
安裝完oracle,在root用戶執(zhí)行下面2條命令.
/data/oracle/inventory/orainstRoot.sh
/data/oracle/product/112010/db_1/root.sh
su - oracle
netca /silent /responseFile /data/oracle/database/response/netca.rsp
dbca -silent -responseFile /data/oracle/database/response/dbca.rsp
############################################################################
EOF
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。