>/etc/host..."/>
您好,登錄后才能下訂單哦!
#!/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))
ora_dir=/database/
sed -i "s/SELINUX=enforcing/SELINUX=disabled/" /etc/selinux/config
setenforce 0
#install packages
yum -y install unzip binutils*x86_64* glibc*x86_64* compat-libstdc++*x86_64* elfutils-libelf*x86_64* gcc*x86_64* ksh-*x86_64* libaio*x86_64* libgcc*x86_64* libstdc++*x86_64* make*x86_64* numactl-devel*x86_64* sysstat-9*x86_64* compat-libstdc++*i686* compat-libcap* libXp* libaio*
unzip /linux.x64_11gR2_database_1of2.zip //必須先把安裝文件下載到相應(yīng)目錄,才能解壓
unzip /linux.x64_11gR2_database_2of2.zip
groupadd oinstall
groupadd dba
useradd -g oinstall -G dba oracle
echo oracle123|passwd oracle --stdin
mkdir -p /u01/app
chown -R oracle.oinstall /u01
chown -R oracle.oinstall $ora_dir
#chmod +x $ora_dir/runInstaller
#chmod 777 $ora_dir/install/.oui
#chmod 777 $ora_dir/install/unzip
#Modify the kernel parameters
sed -i -e "s/kernel.shmall.*/kernel.shmall = 2097152/" -e "s/kernel.shmmax.*/kernel.shmmax = $shmmax/" /etc/sysctl.conf
cat >>/etc/sysctl.conf<<EOF
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 6815744
net.ipv4.ip_local_port_range = 900 65000
net.core.rmem_default= 262144
net.core.rmem_max= 4194304
net.core.wmem_default= 262144
net.core.wmem_max= 1048576
EOF
sysctl -p
#Modify the configuration of system resources
cat >> /etc/security/limits.conf <<EOF
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
EOF
cat >/home/oracle/.bash_profile<<EOF
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
TMP=/tmp;export TMP
TMPDIR=\$TMP;export TMPDIR
ORACLE_BASE=/u01/app/oracle;export ORACLE_BASE
ORACLE_HOME=\$ORACLE_BASE/product/11.2.0/db_1;export ORACLE_HOME
ORACLE_SID=orcl;export ORACLE_SID
LD_LIBRARY_PATH=\$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
PATH=\$PATH:\$HOME/bin:\$ORACLE_HOME/bin;export PATH
EOF
source /home/oracle/.bash_profile
xhost +
su oracle -c "export LANG=en_US && $ora_dir/runInstaller -silent -ignorePrereq -responseFile /db.rsp" //應(yīng)答腳本db.rsp得先準備好
sleep 18m //安裝時間,這個自己把握。18分鐘后再執(zhí)行下面的腳本
/u01/app/oraInventory/orainstRoot.sh
/u01/app/oracle/product/11.2.0/db_1/root.sh
免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。