oracle 10gr2 环境变量配置脚本
2012-11-01 20:48:50 来源:WEB开发网 #!/bin/bash
###the script to install oracle10g on rhel5!!
##show notes!
echo -ne "The script is writed by xtao@sinoinfo!\n"
SPATH=/public/sourcecode
ORACLE_BASE=/u01/app/oracle
ORACLE_SID=orcl
##edit the /etc/sysctl.conf !
echo -e '\n'
echo -en '\e[31m Modify the /etc/sysctl.conf ! \e[0m \n'
cp /etc/sysctl.conf /etc/sugon.bak.sysctl.conf
if [ $? != 0 ];then
echo "backup sysctl.conf failed"
exit -1
fi
cat << EOF >> /etc/sysctl.conf
kernel.shmall = 4194304
kernel.shmmax = 17179869184
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
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
if [ $? != 0 ];then
echo "modify sysctl.conf failed"
exit -1
fi
##Login as root and issue the following command:
echo -e '\n'
echo -en '\e[31m Add the xhost ! \e[0m \n'
xhost +$HOSTNAME
##Edit the /etc/redhat-release file replacing the current release information (Red Hat Enterprise Linux Server release 5 (Tikanga)) with the following:
echo -e '\n'
echo -en '\e[31m Change the releas to rhel4 ! \e[0m \n'
cp /etc/redhat-release /etc/sugon.bak.redhat-release
echo -n "redhat-4" > /etc/redhat-release
##Run the following command to change the current kernel parameters:
echo -e '\n'
echo -en '\e[31m Display the sysctl information ! \e[0m \n'
/sbin/sysctl -p
if [ $? != 0 ];then
echo "update sysctl failed"
exit -1
fi
##Add the following lines to the /etc/security/limits.conf file:
echo -e '\n'
echo -en '\e[31m Modify the /etc/security/limits.conf ! \e[0m \n'
cp /etc/security/limits.conf /etc/security/sugon.bak.limits.conf
if [ $? != 0 ];then
echo "backup limits.conf failed"
exit -1
fi
cat << EOF >> /etc/security/limits.conf
* soft nproc 2047
* hard nproc 16384
* soft nofile 1024
* hard nofile 65536
EOF
if [ $? != 0 ];then
echo "modify limits.conf failed"
exit -1
fi
##Add the following line to the /etc/pam.d/login file, if it does not already exist:
echo -e '\n'
echo -en '\e[31m Modify the /etc/pam.d/login ! \e[0m \n'
cp /etc/pam.d/login /etc/pam.d/sugon.bak.login &&
if [ $? != 0 ];then
echo "backup pam.d-login failed"
exit -1
fi
echo -n "session required pam_limits.so" >> /etc/pam.d/login &&
if [ $? != 0 ];then
echo "modify pam.d-login failed"
exit -1
fi
##Disable secure linux by editing the /etc/selinux/config file, making sure the SELINUX flag is set as follows:
echo -e '\n'
echo -en '\e[31m Disable the SELINUX ! \e[0m \n'
- ››oracle 恢复误删除的表和误更新的表
- ››Oracle分页查询排序数据重复问题
- ››Oracle创建dblink报错:ORA-01017、ORA-02063解决
- ››Oracle 提高SQL执行效率的方法
- ››Oracle 动态查询,EXECUTE IMMEDIATE select into...
- ››Oracle 11g必须开启的服务及服务详细介绍
- ››oracle性能34条优化技巧
- ››oracle数据库生成随机数的函数
- ››Oracle 数据库表空间容量调整脚本
- ››oracle单库彻底删除干净的方法
- ››Oracle创建表空间、创建用户以及授权、查看权限
- ››oracle 中 UPDATE nowait 的使用方法
更多精彩
赞助商链接