#!/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

Oracle安装部署之RAC安装环境配置脚本的更多相关文章

  1. Oracle安装部署,版本升级,应用补丁快速参考

    一.Oracle安装部署 1.1 单机环境 1.2 Oracle RAC环境 1.3 Oracle DataGuard环境 1.4 主机双机 1.5 客户端部署 二.Oracle版本升级 2.1 单机 ...

  2. windows系统dokuwiki安装部署设置 xampp环境配置

    简单记录一次安装dokuwiki的过程 dokuwiki下载 dokuwiki下载地址 https://download.dokuwiki.org/ 下载前有一些可选项目,版本.语言.插件,可以按照需 ...

  3. Oracle安装部署之Win7下oracle11g数据库的安装及配置

    1.下载安装包 到oracle官网downloads下下载(第一次下载需要注册账号). Win7 64位下载64位oracle11g安装包 Win7 32位下载32位oracle11g(Oracle_ ...

  4. Oracle安装部署之一键安装oracle数据库及其脚本

    准备工作:通过ftp工具上传oracle安装软件到linux系统/mnt目录下,并通过unzip命令解压软件.--------------------------------------------- ...

  5. 1. Oracle安装部署文档

    一. 部署环境步骤 1.1 软件环境 操作系统:CentOS release 6.5oracle安装包:linux.x64_11gR2_database_1of1.zip:linux.x64_11gR ...

  6. 002.Oracle安装部署-ASM

    一 环境准备 图形界面:略 安装包: linux.x64_11gR2_database_1of2.zip linux.x64_11gR2_database_2of2.zip 二 安装ASM-Oracl ...

  7. Oracle安装部署之RedHat安装Oracle11g_R2

    硬件配置 内存 :≥1G 硬盘空间:≥10G 上传oracle11g安装包: putty上用wcw用户登录,通过ftp服务上传oracle安装文件到/home/wcw目录下解压 #unzip linu ...

  8. 001-使用idea开发环境安装部署,npm工具栏,脚本运行

    一.概述 参看官方文档:https://ant.design/docs/spec/introduce-cn 其中包含了设计价值观.设计原则.视觉.模式.可视化.动态等. 其中Ant Design 的 ...

  9. 001.Oracle安装部署-本地文件系统

    一 环境准备 安装包:linux.x64_11gR2_database_1of2.zip linux.x64_11gR2_database_2of2.zip 二 安装Oracle准备 2.1 用户名/ ...

随机推荐

  1. C++ 数据抽象

    C++ 数据抽象数据抽象是指,只向外界提供关键信息,并隐藏其后台的实现细节,即只表现必要的信息而不呈现细节. 数据抽象是一种依赖于接口和实现分离的编程(设计)技术. 让我们举一个现实生活中的真实例子, ...

  2. nodejs基础 -- 事件循环

    Node.js 事件循环 Node.js 是单进程单线程应用程序,但是通过事件和回调支持并发,所以性能非常高. Node.js 的每一个 API 都是异步的,并作为一个独立线程运行,使用异步函数调用, ...

  3. javascript -- 将数组转换为字符串:join()

    join(separator) 方法用于把数组中的所有元素放入一个字符串.元素是通过指定的分隔符进行分隔的. separator:可选,指定要使用的分隔符.如果省略该参数,则默认使用逗号作为分隔符 v ...

  4. UI标签库专题十一:JEECG智能开发平台 DictSelect (数据字典下拉选择框)

     1. DictSelect (数据字典下拉选择框) 1.1. 參数 属性名 类型 描写叙述 是否必须 默认值 typeGroupCode string 字典分组编码 是 null field s ...

  5. JMeter使用记录2 -- Web測试

    Web測试用例 新建线程组.配置起3线程,循环1次.1秒启动全部线程.进行login.循环1个主要页面的读写,并对另外一个主要页面进行读操作,最后logout并在aggregate graph/gra ...

  6. centos7命令总结

    1,查看cpu信息 lscpu 2,网络配置 ip  route   查看路由 nmcli nmcli connection show    显示所有连接 nmcli connection show ...

  7. 监听程序未启动或数据库服务未注册到该监听程序。启动该监听程序并注册数据库服务 然后重新运行 em configuration assistant。

    在WIN 7/64Bit上安装ORACLE 11gR2后,管理网页Database Control(如:https://localhost:1158/em)始终登录不进去,总是说密码错误,使用配置工具 ...

  8. mybatis传递Map和List集合示例

    1.List示例 java文件: dao: public List<ServicePort> selectByIps(List<String> ips); xml文件: < ...

  9. ubuntu下使用sublime text进行C编程开发尝鲜

    1 选择编译系统 2 编写文件,编译(Ctrl+B)运行(Shift+Ctrl+B)

  10. OpenCV学习:播放avi视频文件

    #if 0 //播放avi视频文件(IplImage) #include <opencv2/opencv.hpp> using namespace std; #pragma comment ...