Linux一鍵部署oracle安裝環(huán)境腳本(推薦)-創(chuàng)新互聯(lián)

具體代碼如下所示:

我們提供的服務有:成都網(wǎng)站建設、成都做網(wǎng)站、微信公眾號開發(fā)、網(wǎng)站優(yōu)化、網(wǎng)站認證、臨澧ssl等。為上千企事業(yè)單位解決了網(wǎng)站和推廣的問題。提供周到的售前咨詢和貼心的售后服務,是有科學管理、有技術的臨澧網(wǎng)站制作公司
#!/bin/bash
############################################
###功能:Preparation for Oracle Installation
###參數(shù):SID BASE
###其中,sid指的是ORACLE_SID
###BASE指的是ORACLE_BASE的一級目錄,如ORACLE_BASE=/u01/app/oracle,則BASE為/u01
############################################
#檢查參數(shù)個數(shù)是否正確
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\net.ipv4.ip_local_port_range = 9000 65500' /etc/sysctl.conf
sed -i '$a\net.core.rmem_default = 262144' /etc/sysctl.conf
sed -i '$a\net.core.rmem_max = 4194304' /etc/sysctl.conf
sed -i '$a\net.core.wmem_default = 262144' /etc/sysctl.conf
sed -i '$a\net.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!"

網(wǎng)頁標題:Linux一鍵部署oracle安裝環(huán)境腳本(推薦)-創(chuàng)新互聯(lián)
網(wǎng)頁網(wǎng)址:http://bm7419.com/article2/dicsoc.html

成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供微信公眾號、手機網(wǎng)站建設、App開發(fā)、網(wǎng)站收錄、App設計搜索引擎優(yōu)化

廣告

聲明:本網(wǎng)站發(fā)布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經(jīng)允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯(lián)

成都做網(wǎng)站