oracle 11g RAC 安裝前準備指令碼

lee_lgw發表於2021-09-09

#!/bin/bash

#writed by sery 2012-05-16
 
#########################################
#install depending packages             #
#########################################
yum -y install binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel glibc glibc-common glibc-devel gcc gcc-c++ libaio
-devel libaio libgcc libstdc++ libstdc++-devel make sysstat unixODBC unixODBC-devel pdksh numactl-devel glibc-headers
 
########################################
#add groups,user and create dir        #
########################################
/usr/sbin/groupadd -g 501 oinstall
/usr/sbin/groupadd -g 502 dba
/usr/sbin/groupadd -g 504 asmadmin
/usr/sbin/groupadd -g 506 asmdba
/usr/sbin/groupadd -g 507 asmoper
 
useradd -u 1000 -g oinstall -G dba,asmdba oracle
useradd -u 1006 -g oinstall -G asmadmin,asmdba,asmoper grid
 
mkdir /u01/app/
chown -R grid:oinstall /u01/app/
chmod -R 775 /u01/app/
 
mkdir -p /u01/app/oraInventory
chown -R grid:oinstall /u01/app/oraInventory
chmod -R 775 /u01/app/oraInventory
 
mkdir -p /u01/app/grid
mkdir -p /u01/app/oracle
 
chown -R grid:oinstall /u01/app/grid
chown -R oracle:oinstall /u01/app/oracle
 
chmod -R 775 /u01/app/oracle
chmod -R 775 /u01/app/grid
 
##############################################
#modify  sysctl.conf                         #
##############################################
cat >> /etc/sysctl.conf <
fs.file-max = 6815744
kernel.shmall = 2097152
#kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576
done
 
sysctl -p
 
###############################################
#modify  /etc/security/limits.conf            #
###############################################
cat >> /etc/security/limits.conf << done
grid soft nproc 2047
grid hard nproc 16384
grid soft nofile 1024
grid hard nofile 65536
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
done
 
################################################
#modify /etc/pam.d/login                       #
################################################
echo "session    required     pam_limits.so">>/etc/pam.d/login
 
################################################
# setting user oracle env                      #
################################################
cat >> /home/oracle/.bash_profile <
export ORACLE_SID=db4zch_2
export ORACLE_UNQNAME=db4zch_2
export ORACLE_base=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/11.2.0
export PATH=$ORACLE_HOME/bin:$PATH
done
 
###############################################
#setting user grid env                        #
###############################################
cat >> /home/grid/.bash_profile <
export ORACLE_SID=+asm2
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/grid
export PATH=$ORACLE_HOME/bin:$PATH
done

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/23490154/viewspace-1061693/,如需轉載,請註明出處,否則將追究法律責任。

上一篇: Explain Plan
oracle 11g RAC 安裝前準備指令碼
請登入後發表評論 登入
全部評論

相關文章