RAC安装环境配置脚本

#!/bin/bash
#Usage:Log on as the superuser(‘root‘),and then execute the command:#./1preusers.sh

groupadd -g 1000 oinstall                                 --grid  oracle
groupadd -g 1200 asmadmin                                 --grid
groupadd -g 1201 asmdba                                   --grid  oracle
groupadd -g 1202 asmoper                                  --grid(可选)
groupadd -g 1300 dba                                      --oracle
groupadd -g 1301 oper                                     --oracle(可选)

useradd -u 1100 -g oinstall -G asmadmin,asmdba,asmoper -d /home/grid -s /bin/bash -c "grid Infrastructure Owner" grid
echo "grid" | passwd --stdin grid

echo "export TMP=/tmp">> /home/grid/.bash_profile 
echo ‘export TMPDIR=$TMP‘>>/home/grid/.bash_profile
echo "export ORACLE_SID=+ASM1">> /home/grid/.bash_profile
echo "export ORACLE_BASE=/u01/app/grid">> /home/grid/.bash_profile
echo "export ORACLE_HOME=/u01/app/11.2.0/grid">> /home/grid/.bash_profile
echo "export ORACLE_TERM=xterm">> /home/grid/.bash_profile
echo "export NLS_DATE_FORMAT=‘yyyy/mm/dd hh24:mi:ss‘">> /home/grid/.bash_profile
echo ‘export TNS_ADMIN=$ORACLE_HOME/network/admin‘  >> /home/grid/.bash_profile
echo ‘export PATH=/usr/sbin:$PATH‘>> /home/grid/.bash_profile
echo ‘export PATH=$ORACLE_HOME/bin:$PATH‘>> /home/grid/.bash_profile
echo ‘export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib‘>> /home/grid/.bash_profile
echo ‘export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib‘>> /home/grid/.bash_profile
echo "export LANG=en_US">> /home/grid/.bash_profile
echo "export NLS_LANG=american_america.AL32UTF8">> /home/grid/.bash_profile

useradd -u 1101 -g oinstall -G dba,oper,asmdba -d /home/oracle -s /bin/bash -c "Oracle Software Owner" oracle
echo "oracle" | passwd --stdin oracle

echo "export TMP=/tmp">> /home/oracle/.bash_profile 
echo ‘export TMPDIR=$TMP‘>>/home/oracle/.bash_profile
echo "export ORACLE_HOSTNAME=node1">> /home/oracle/.bash_profile
echo "export ORACLE_SID=dbking1">> /home/oracle/.bash_profile
echo "export ORACLE_BASE=/u01/app/oracle">> /home/oracle/.bash_profile
echo ‘export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1‘>> /home/oracle/.bash_profile
echo "export ORACLE_UNQNAME=dbking">> /home/oracle/.bash_profile
echo ‘export TNS_ADMIN=$ORACLE_HOME/network/admin‘  >> /home/oracle/.bash_profile
echo "export ORACLE_TERM=xterm">> /home/oracle/.bash_profile
echo ‘export PATH=/usr/sbin:$PATH‘>> /home/oracle/.bash_profile
echo ‘export PATH=$ORACLE_HOME/bin:$PATH‘>> /home/oracle/.bash_profile
echo ‘export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib‘>> /home/oracle/.bash_profile
echo ‘export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib‘>> /home/oracle/.bash_profile
echo "export LANG=en_US">> /home/oracle/.bash_profile
echo "export NLS_LANG=american_america.AL32UTF8">> /home/oracle/.bash_profile
echo "export NLS_DATE_FORMAT=‘yyyy/mm/dd hh24:mi:ss‘">> /home/oracle/.bash_profile

echo "The Groups and users has been created"
echo "The Environment for grid,oracle also has been set successfully"

mkdir -p /u01/app/grid
mkdir -p /u01/app/11.2.0/grid
mkdir -p /u01/app/oracle
chown -R oracle:oinstall /u01
chown -R grid:oinstall /u01/app/grid
chown -R grid:oinstall /u01/app/11.2.0
chmod -R 775 /u01

cp /etc/security/limits.conf /etc/security/limits.conf.bak
echo "oracle soft nproc 2047">>/etc/security/limits.conf
echo "oracle hard nproc 16384">>/etc/security/limits.conf
echo "oracle soft nofile 1024">>/etc/security/limits.conf
echo "oracle hard nofile 65536">>/etc/security/limits.conf
echo "grid soft nproc 2047">>/etc/security/limits.conf
echo "grid hard nproc 16384">>/etc/security/limits.conf
echo "grid soft nofile 1024">>/etc/security/limits.conf
echo "grid hard nofile 65536">>/etc/security/limits.conf

cp /etc/pam.d/login /etc/pam.d/login.bak

echo "session required /lib/security/pam_limits.so">>/etc/pam.d/login
echo "session required pam_limits.so">>/etc/pam.d/login

cp /etc/profile /etc/profile.bak
echo ‘if [ $USER = "oracle" ]||[ $USER = "grid" ]; then‘ >>  /etc/profile
echo ‘if [ $SHELL = "/bin/ksh" ]; then‘ >> /etc/profile
echo ‘ulimit -p 16384‘ >> /etc/profile
echo ‘ulimit -n 65536‘ >> /etc/profile
echo ‘else‘ >> /etc/profile
echo ‘ulimit -u 16384 -n 65536‘ >> /etc/profile
echo ‘fi‘ >> /etc/profile
echo ‘fi‘ >> /etc/profile

cp /etc/sysctl.conf /etc/sysctl.conf.bak

echo "fs.aio-max-nr = 1048576">> /etc/sysctl.conf
echo "fs.file-max = 6815744">> /etc/sysctl.conf
echo "kernel.shmall = 2097152">> /etc/sysctl.conf
echo "kernel.shmmax = 4294967295">> /etc/sysctl.conf
echo "kernel.shmmni = 4096">> /etc/sysctl.conf
echo "kernel.sem = 250 32000 100 128">> /etc/sysctl.conf
echo "net.ipv4.ip_local_port_range = 9000 65500">> /etc/sysctl.conf
echo "net.core.rmem_default = 262144">> /etc/sysctl.conf
echo "net.core.rmem_max = 4194304">> /etc/sysctl.conf
echo "net.core.wmem_default = 262144">> /etc/sysctl.conf
echo "net.core.wmem_max = 1048586">> /etc/sysctl.conf
echo "net.ipv4.tcp_wmem = 262144 262144 262144">> /etc/sysctl.conf
echo "net.ipv4.tcp_rmem = 4194304 4194304 4194304">> /etc/sysctl.conf
sysctl -p

时间: 2024-11-05 12:16:29

RAC安装环境配置脚本的相关文章

Oracle 10g 安装环境配置脚本

#!/bin/bash #Test in RHEL 5.5 for 10g c=`cat /etc/shadow | grep oracle | wc -l`if [ $c != 0 ]then  w=0  while [ $w -eq 0 ]  do    echo "--Find user oracle has been existed!--"    echo "--Do you want to delete user oracle?[yes/no]:"   

【Oracle RAC】Linux系统Oracle11gR2 RAC安装配置详细过程V3.1(图文并茂)

2 Oracle11gR2 RAC数据库安装准备工作2.1 安装环境介绍2.2 数据库安装软件下载3 Oracle11gR2 RAC数据库安装环境配置3.1 安装主机或虚拟机3.2 安装操作系统3.3 hosts文件配置3.4 添加组与用户3.5 添加文件系统3.6 修改操作系统参数3.7 禁止NTP3.8 配置grid和oracle用户的环境变量3.9 配置SSH信任关系3.10 调整页面交换空间3.11 配置磁盘4 安装11gR2 Grid Infrastructure组件4.1 解压安装文

【Oracle RAC】Linux系统Oracle12c RAC安装配置详细记录过程V2.0(图文并茂)

[Oracle RAC]Linux系统Oracle12c RAC安装配置详细过程V2.0(图文并茂) 2 Oracle12c RAC数据库安装准备工作2.1 安装环境介绍2.2 数据库安装软件下载3 Oracle12c RAC数据库安装环境配置3.1 安装主机或虚拟机3.2 安装操作系统3.3 hosts文件配置3.4 添加组与用户3.5 添加文件系统3.6 修改操作系统参数3.7 禁止NTP3.8 配置grid和oracle用户的环境变量3.9 配置SSH信任关系3.10 调整页面交换空间3.

阿里云上Oracle 11g RAC安装配置手册

有印象的用户可能发现,阿里云早在2016年深圳云栖大会就官方发布了对Oracle RAC的支持,但是相关产品却一直没能同步推出,相信大家都翘首以盼了许久许久.一个好消息是,近期阿里云将紧密推出两款新产品:共享块存储和ECS多网卡.这两款产品将打通众多关键云下应用上云的最后一公里,为用户提供更多的便利.在我们能正式体验到新产品之前,阿里云技术服务团队也将云上的Oracle RAC安装配置手册放出,希望能给大家提供更多不同的体验和选择. 一.安装说明 阿里云上Oracle RAC的安装部署,重点需要

Linux中tomcat开机启动配置脚本【参考其他文章的总结备忘录】

参考文章http://blog.sina.com.cn/s/blog_a57562c80101ic47.html http://blog.csdn.net/cheng168520/article/details/4312828 http://blog.sina.com.cn/s/blog_7f395ece0100ti5y.html 以前在自己本机上安装过一个Linux,后台应为系统崩溃,以前配置的开机启动脚本.数据库主从双备份.负载均衡等都没了,所以现在在重新配置一次,赶紧做个笔记防止自己以后又

iOS framework配置脚本

# Sets the target folders and the final framework product. FMK_NAME=HovnVoipEngine FMK_VERSION=1.0 # Install dir will be the final output to the framework. # The following line create it in the root folder of the current project. INSTALL_DIR=${SRCROO

NGINX----源码阅读---have配置脚本

/auto/have have配置脚本负责在$NGX_OBJS/ngx_auto_config.h定义宏 1 # Copyright (C) Igor Sysoev 2 # Copyright (C) Nginx, Inc. 3 4 5 cat << END >> $NGX_AUTO_CONFIG_H 6 7 #ifndef $have 8 #define $have 1 9 #endif 10 11 END

代理自动配置脚本

iefile://d:/PersonalSet/agent.pac火狐file:///d:/PersonalSet/agent.pac function FindProxyForURL(url, host){ if (isPlainHostName(host)) {     return "DIRECT"; } if (isInNet(host, "10.0.0.0", "255.0.0.0")) {     return "DIREC

Oracle 之 安装配置脚本

#!/bin/bash #安装oracle所需的软件包 yum -y install binutils compat-libcap1 compat-libstdc++ gcc gcc-c++ glibc glibc-devel ksh libgcc libstdc++ libstdc++-devel libaio libaio-devel make sysstat unixODBC unixODBC-devel >/dev/null 2>&1 #若没安装图形界面,则用下面指令安装 rp