Linux一键部署oracle安装环境脚本(推荐)
发表于:2026-11-02 作者:千家信息网编辑
千家信息网最后更新 2026年11月02日,具体代码如下所示:#!/bin/bash###############################################功能:Preparation for Oracle Install
千家信息网最后更新 2026年11月02日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" exitfiSID="$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 Usersgroupadd -g 800 oinstallgroupadd -g 801 dbagroupadd -g 802 operuseradd -g oinstall -G dba,oper oracleecho oracle | passwd --stdin oracle >> output.log 2>&1#Configure Kernal Parameterssed -i '$a\fs.aio-max-nr = 1048576' /etc/sysctl.confsed -i '$a\fs.file-max = 6815744' /etc/sysctl.confsed -i '$a\kernel.shmall = 2097152' /etc/sysctl.confsed -i '$a\kernel.shmmax = 536870912' /etc/sysctl.confsed -i '$a\kernel.shmmni = 4096' /etc/sysctl.confsed -i '$a\kernel.sem = 250 32000 100 128' /etc/sysctl.confsed -i '$a\net.ipv4.ip_local_port_range = 9000 65500' /etc/sysctl.confsed -i '$a\net.core.rmem_default = 262144' /etc/sysctl.confsed -i '$a\net.core.rmem_max = 4194304' /etc/sysctl.confsed -i '$a\net.core.wmem_default = 262144' /etc/sysctl.confsed -i '$a\net.core.wmem_max = 1048586' /etc/sysctl.confsysctl -p >> output.log 2>&1#Configure Resource Limitssed -i '$a\oracle soft nproc 2047' /etc/security/limits.confsed -i '$a\oracle hard nproc 16384' /etc/security/limits.confsed -i '$a\oracle soft nofile 1024' /etc/security/limits.confsed -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/profilesed -i '$a\if [[ $USER = "oracle" ]]; then' /etc/profilesed -i '$a\ if [[ $SHELL = "/bin/ksh" ]]; then' /etc/profilesed -i '$a\ ulimit -p 16384' /etc/profilesed -i '$a\ ulimit -n 65536' /etc/profilesed -i '$a\ else' /etc/profilesed -i '$a\ ulimit -u 16384 -n 65536' /etc/profilesed -i '$a\ fi' /etc/profilesed -i '$a\fi' /etc/profilesource /etc/profile#Configuring the oracle User's Environmentsed -i '$a\export ORACLE_SID='$SID'' /home/oracle/.bash_profilesed -i '$a\export ORACLE_BASE='$BASE'/app/oracle' /home/oracle/.bash_profilesed -i '$a\export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1' /home/oracle/.bash_profilesed -i '$a\export PATH=$ORACLE_HOME/bin:$PATH' /home/oracle/.bash_profilesource /home/oracle/.bash_profile#Creating Required Directoriesmkdir -p $ORACLE_HOMEchown -R oracle.oinstall $BASE/appchmod -R 775 $BASE/appecho "Preparation For Oracle Installation Is Over!"总结
以上所述是小编给大家介绍的Linux一键部署oracle安装环境脚本,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对网站的支持!
如果你觉得本文对你有帮助,欢迎转载,烦请注明出处,谢谢!
参数
帮助
环境
脚本
一键
个数
主机
代码
出处
功能
文件
疑问
目录
网站
支持
检查
推荐
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
上海挚品互联网科技有限公司
为想互联网科技怎么样
今日互联网科技
紫鲸互联网科技
美国互联网前沿科技
互联网科技生活的内容
互联网 科技馆
济南和联互联网科技有限公司
北京大学互联网科技怎么样
广州慧亚互联网科技怎么样
华夏互联网科技业
恒生互联网科技指数跳水
青海科技产业互联网发展
银川新华互联网科技学校联系电话
允成互联网科技有限公司融资
华夏恒生互联网科技013171
四川慕妮娅互联网科技有限公司
有人说阿里系是互联网科技企业
广东鹅鹅鹅互联网科技有限公司
上海互联网科技园景观
互联网的科技创新
青岛互联网科技公司
互联网科技集团
紫鲸互联网科技
壹账通互联网科技
翼展科技 首家互联网医院
广州富喜互联网络科技
上海同邻互联网科技有限公司规模
青岛互联网科技园
科技互联网企业在行动