oracle 10g 预安装脚本

#! /bin/bash

#增加安装Oracle所需的用户和组

groupadd oinstall

groupadd dba

useradd -g oinstall -G dba -d /home/oracle -m oracle

#创建安装Oracle所需的目录

mkdir -p /u01/app/oracle/product/10.2.0/db_1

chmod -R 775 /u01

chown -R oracle:oinstall /u01

#改变Oracle参数

echo "kernel.shmall = 2097152" >> /etc/sysctl.conf

echo "kernel.shmmax = 2147483648" >> /etc/sysctl.conf

echo "kernel.shmmni = 4096" >> /etc/sysctl.conf

echo "kernel.sem = 250 32000 100 128" >> /etc/sysctl.conf

echo "fs.file-max = 65536" >> /etc/sysctl.conf

echo "net.ipv4.ip_local_port_range = 1024 65000" >> /etc/sysctl.conf

echo "net.core.rmem_default=262144" >> /etc/sysctl.conf

echo "net.core.rmem_max=262144" >> /etc/sysctl.conf

echo "net.core.wmem_default=262144" >> /etc/sysctl.conf

echo "net.core.wmem_max=262144" >> /etc/sysctl.conf

/sbin/sysctl -p

#设置Oracle环境变量

echo "ORACLE_BASE=/u01/app/oracle" >> /home/oracle/.bash_profile

echo "ORACLE_HOME=\$ORACLE_BASE/product/10.2.0/db_1" >> /home/oracle/.bash_profile

echo "ORACLE_SID=dg1" >> /home/oracle/.bash_profile

echo "PATH=\$PATH:\$HOME/bin:\$ORACLE_HOME/bin" >> /home/oracle/.bash_profile

echo "LD_LIBRARY_PATH=\$ORACLE_HOME/lib:/usr/lib" >> /home/oracle/.bash_profile

echo "export PATH ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH" >> /home/oracle/.bash_profile

source /home/oracle/.bash_profile

#设置Oracle用户shell limit

echo "oracle soft nproc 2047" >> /etc/security/limits.conf

echo "oracle hard nproc 16384" >> /etc/security/limits.conf

echo "oracle soft nofile 1024" >> /etc/security/limits.conf

echo "oracle hard nofile 65536" >> /etc/security/limits.conf

#修改Linux版本号

cp /etc/redhat-release /etc/redhat-release.`date -I`.bak

echo "redhat-4" > /etc/redhat-release

#修改/etc/hosts文件

cp /etc/hosts /etc/hosts.`date -I`.bak

echo "# Do not remove the following line, or various programs" > /etc/hosts

echo "# that require network functionality will fail." >> /etc/hosts

echo "`ifconfig eth0 |grep "inet addr" |cut -d: -f2 |cut -d" " -f1` `more /etc/sysconfig/network | grep HOSTNAME | cut -c10-` localhost" >> /etc/hosts

echo "127.0.0.1 `more /etc/sysconfig/network | grep HOSTNAME | cut -c10-`" >> /etc/hosts

#yum安装必要包

yum -y install setarch-2* make-3* glibc-2* libaio-0* compat-libstdc++-33-3* compat-gcc-34-3* compat-gcc-34-c++-3* gcc-4* libXp-1* openmotif-2* compat-db-4*
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值