#!/bin/bash
成都創(chuàng)新互聯(lián)公司是專業(yè)的和平網(wǎng)站建設(shè)公司,和平接單;提供成都網(wǎng)站建設(shè)、成都網(wǎng)站設(shè)計(jì),網(wǎng)頁設(shè)計(jì),網(wǎng)站設(shè)計(jì),建網(wǎng)站,PHP網(wǎng)站建設(shè)等專業(yè)做網(wǎng)站服務(wù);采用PHP框架,可快速的進(jìn)行和平網(wǎng)站開發(fā)網(wǎng)頁制作和功能擴(kuò)展;專業(yè)做搜索引擎喜愛的網(wǎng)站,專業(yè)的做網(wǎng)站團(tuán)隊(duì),希望更多企業(yè)前來合作!
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< 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 < oracle soft nproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536 EOF cat >/home/oracle/.bash_profile< # .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得先準(zhǔn)備好 sleep 18m //安裝時(shí)間,這個(gè)自己把握。18分鐘后再執(zhí)行下面的腳本 /u01/app/oraInventory/orainstRoot.sh /u01/app/oracle/product/11.2.0/db_1/root.sh
網(wǎng)站標(biāo)題:oracl安裝腳本
本文鏈接:http://weahome.cn/article/pciseh.html