白天和黑夜只交替没交换无法想像对方的世界
分类: oracle
2011-06-23 23:32:02
oracle database 10g release 2(10.2.0.1)脚本自动化安装
#!/bin/sh
#the scripts is for rhel5u1
#author is kevin
#date 2011-06-06
for i in libxp-1.0.0-8 openmotif-2.3.0-0.3.el5 compat-db-4.2.52-5.1 compat-gcc-34-3.4.6-4 compat-libf2c-34-3.4.6-4 compat-gcc-34-g77-3.4.6-4 compat-gcc-34-c -3.4.6-4 compat-libstdc -296-2.96-138 compat-libstdc -33-3.2.3-61
do
yum install -y $i
done
oracle_passwd=oracle
# oracle用户密码
setup_file_path=/u01/oracle
# 10g安装程序目录
install_to_path=/u01
# 安装路径
#----------------------------------------
grep oracle /etc/passwd &> /dev/null
# 检查是否已经安装
if [ $? -eq 0 ]
then
clear
echo "oracle user is already existeof"
exit 1
fi
###################调整内核参数#############################
cat >> /etc/sysctl.conf << eof
kernel.sem = 250 32000 100 128
fs.file-max = 65546
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 1048576
net.core.wmem_max = 1048576
eof
sysctl -p
# 提交配置参数
###################创建安装用户及组#########################
#off selinux
groupadd dba && groupadd oinstall
useradd -g oinstall -g dba -m oracle
echo $oracle_passwd | passwd oracle --stdin
mkdir -p $install_to_path
chown -r oracle.oinstall $install_to_path
##=============================================
cat >> /etc/pam.d/login << eof
# add content for oracle install
session required pam_limits.so
eof
# turn on limits for oracle 10g
cat >> /etc/security/limits.conf << eof
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 4096
oracle hard nofile 65535
eof
##=============================================
echo 'red hat enterprise linux server release 4 (tikanga)' > /etc/redhat-release
echo '
#--------------------------------------
# set for oracle10g install ;
#--------------------------------------
trap " " 0 1 2 3 5 9 15
trap clear 0
export tmp=/tmp
export tmpdir=$tmp
' >> /home/oracle/.bash_profile
#============
echo "export oracle_base=$install_to_path" >> /home/oracle/.bash_profile
#============
echo '
export oracle_home=$oracle_base/product/10.2.0/db_1
export oracle_sid=orcl
export oracle_term=oinstall
export path=$oracle_home/bin:$path
export lang=en_us
' >> /home/oracle/.bash_profile
# 用户root登录在字符界面下
clear
echo "you can su - oracle in x and run runinstaller to install oracle now"
#su - oracle
#startx -- :1
#./runinstaller
# 开始安装oracle