视频1 视频21 视频41 视频61 视频文章1 视频文章21 视频文章41 视频文章61 推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37 推荐39 推荐41 推荐43 推荐45 推荐47 推荐49 关键词1 关键词101 关键词201 关键词301 关键词401 关键词501 关键词601 关键词701 关键词801 关键词901 关键词1001 关键词1101 关键词1201 关键词1301 关键词1401 关键词1501 关键词1601 关键词1701 关键词1801 关键词1901 视频扩展1 视频扩展6 视频扩展11 视频扩展16 文章1 文章201 文章401 文章601 文章801 文章1001 资讯1 资讯501 资讯1001 资讯1501 标签1 标签501 标签1001 关键词1 关键词501 关键词1001 关键词1501 专题2001
oracle10gr2环境变量配置脚本rhel5测试通过
2020-11-09 15:42:25 责编:小采
文档


#!/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

#!/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'
cp /etc/selinux/config /etc/selinux/sugon.bak.config &&
if [ $? != 0 ];then
echo "backup selinux.config failed"
exit -1
fi
echo -n "SELINUX=disabled" > /etc/selinux/config &&
if [ $? != 0 ];then
echo "modify selinux failed"
exit -1
fi

##Create the new groups and users:
echo -e '\n'
echo -en '\e[31m Create the user and group for install ! \e[0m \n'
groupadd oinstall &&
groupadd dba &&
groupadd oper &&
useradd -g oinstall -G dba oracle &&
echo 11111 | passwd oracle --stdin

##Create the directories in which the Oracle software will be installed:
echo -e '\n'
echo -en '\e[31m Create the DIR for ORACLE_BASE and chown the privilege! \e[0m \n'
mkdir -p $ORACLE_BASE/product/10.2.0/db_1 &&
chown -R oracle.oinstall /u01 &&

##Login as the oracle user and add the following lines at the end of the .bash_profile file:
echo -e '\n'
echo -en '\e[31m Modify the bash_profile of oracle ! \e[0m \n'
cat << EOF >> /home/oracle/.bash_profile
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORA_CRS_HOME=/u01/crs/oracle/10gr2/crs
export ORACLE_SID=orcl
export TNS_ADMIN=$ORACLE_HOME/network/admin
export PATH=$ORACLE_HOME/bin:$HOME/bin:$ORA_CRS_HOME/bin:/sbin:$ORA_ASM_HOME:$PATH
EOF

下载本文
显示全文
专题