Linux一键部署oracle安装环境脚本(推荐)
网络编程 2021-07-05 16:09www.168986.cn编程入门
这篇文章主要介绍了Linux一键部署oracle安装环境脚本,本文给大家介绍的非常详细,具有一定的参考借鉴价值,需要的朋友可以参考下
具体代码如下所示
#!/bin/bash ############################################ ###功能Preparation for Oracle Installation ###参数SID BASE ###其中,sid指的是ORACLE_SID ###BASE指的是ORACLE_BASE的一级目录,如ORACLE_BASE=/u01/app/oracle,则BASE为/u01 ############################################ #检查参数个数是否正确 if [ $# -ne 2 ];then echo "$0 SID BASE" exit fi SID="$1" BASE="$2" #主机名绑定 IP=`ifconfig |awk -F'[: ]+' 'NR==2{print $4'}` HOST=`hostname` sed -i '$a'$IP' '$HOST'' /etc/hosts #Checking the Package Requirements #将需要安装的表的列表贴在Package_list文件中 awk -F'-[0-9]' '{print $1}' Package_list |awk '{print $1}' |uniq |xargs yum install -y > output.log 2>&1 #Creating Required Operating System Groups and Users groupadd -g 800 oinstall groupadd -g 801 dba groupadd -g 802 oper useradd -g oinstall -G dba,oper oracle echo oracle | passwd --stdin oracle >> output.log 2>&1 #Configure Kernal Parameters sed -i '$a\fs.aio-max-nr = 1048576' /etc/sysctl.conf sed -i '$a\fs.file-max = 6815744' /etc/sysctl.conf sed -i '$a\kernel.shmall = 2097152' /etc/sysctl.conf sed -i '$a\kernel.shmmax = 536870912' /etc/sysctl.conf sed -i '$a\kernel.shmmni = 4096' /etc/sysctl.conf sed -i '$a\kernel.sem = 250 32000 100 128' /etc/sysctl.conf sed -i '$a\.ipv4.ip_local_port_range = 9000 65500' /etc/sysctl.conf sed -i '$a\.core.rmem_default = 262144' /etc/sysctl.conf sed -i '$a\.core.rmem_max = 4194304' /etc/sysctl.conf sed -i '$a\.core.wmem_default = 262144' /etc/sysctl.conf sed -i '$a\.core.wmem_max = 1048586' /etc/sysctl.conf sysctl -p >> output.log 2>&1 #Configure Resource Limits sed -i '$a\oracle soft nproc 2047' /etc/security/limits.conf sed -i '$a\oracle hard nproc 16384' /etc/security/limits.conf sed -i '$a\oracle soft nofile 1024' /etc/security/limits.conf sed -i '$a\oracle hard nofile 65536' /etc/security/limits.conf #Add the following line to the /etc/pam.d/login file, if it does not already exist: sed -i '$a\session required pam_limits.so' /etc/pam.d/login #Add the following line to the /etc/profile sed -i '$a\if [[ $USER = "oracle" ]]; then' /etc/profile sed -i '$a\ if [[ $SHELL = "/bin/ksh" ]]; then' /etc/profile sed -i '$a\ ulimit -p 16384' /etc/profile sed -i '$a\ ulimit -n 65536' /etc/profile sed -i '$a\ else' /etc/profile sed -i '$a\ ulimit -u 16384 -n 65536' /etc/profile sed -i '$a\ fi' /etc/profile sed -i '$a\fi' /etc/profile source /etc/profile #Configuring the oracle User's Environment sed -i '$a\export ORACLE_SID='$SID'' /home/oracle/.bash_profile sed -i '$a\export ORACLE_BASE='$BASE'/app/oracle' /home/oracle/.bash_profile sed -i '$a\export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1' /home/oracle/.bash_profile sed -i '$a\export PATH=$ORACLE_HOME/bin:$PATH' /home/oracle/.bash_profile source /home/oracle/.bash_profile #Creating Required Directories mkdir -p $ORACLE_HOME chown -R oracle.oinstall $BASE/app chmod -R 775 $BASE/app echo "Preparation For Oracle Installation Is Over!"
以上所述是长沙网络推广给大家介绍的Linux一键部署oracle安装环境脚本,希望对大家有所帮助,如果大家有任何疑问请给我留言,长沙网络推广会及时回复大家的。在此也非常感谢大家对狼蚁SEO网站的支持!
如果你觉得本文对你有帮助,欢迎网络推广网站推广转载,烦请注明出处,谢谢!
编程语言
- 甘肃哪有关键词排名优化购买方式有哪些
- 甘肃SEO如何做网站优化
- 河南seo关键词优化怎么做电话营销
- 北京SEO优化如何做QQ群营销
- 来宾百度关键词排名:提升您网站曝光率的关键
- 卢龙关键词优化:提升您网站排名的策略与技巧
- 山东网站优化的注意事项有哪些
- 四川整站优化怎样提升在搜索引擎中的排名
- 疏附整站优化:提升网站性能与用户体验的全新
- 海南seo主要做什么工作售后服务要做到哪些
- 荣昌百度网站优化:提升您网站的搜索引擎排名
- 河北seo网站排名关键词优化如何做SEO
- 江西优化关键词排名推广售后保障一般有哪些
- 古浪SEO优化:提升你的网站可见性
- 西藏网站排名优化怎么把网站排名在百度首页
- 如何提升阳东百度快照排名:详尽指南