#!/bin/bash
成都创新互联公司是专业的和平网站建设公司,和平接单;提供成都网站建设、成都网站设计,网页设计,网站设计,建网站,PHP网站建设等专业做网站服务;采用PHP框架,可快速的进行和平网站开发网页制作和功能扩展;专业做搜索引擎喜爱的网站,专业的做网站团队,希望更多企业前来合作!
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 //必须先把安装文件下载到相应目录,才能解压
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" //应答脚本db.rsp得先准备好 sleep 18m //安装时间,这个自己把握。18分钟后再执行下面的脚本 /u01/app/oraInventory/orainstRoot.sh /u01/app/oracle/product/11.2.0/db_1/root.sh
标题名称:oracl安装脚本
本文网址:http://cdxtjz.cn/article/pciseh.html