Oracle 11G 11.2.0.4 RAC部署参考指南

Oracle 11G 11.2.0.4 RAC部署参考指南

  • 一、Oracle 11g RAC部署
  • 二、集群规划
  • 三、主机网络规划
  • 四、操作系统配置部分
  • 五、Grid集群软件安装部分
  • 六、Oracle DataBase软件安装
  • 七、Oracle ASM磁盘划分
  • 八、dbca创建实例
  • 九、CentOS7安装过程中报错处理
  • 十、卸载Grid Cluster集群环境
  • 十一、常用命令
  • 附:rac环境预准备sh脚本

本文说明:
根据多个生产环境部署经验,梳理了部署笔记,可供自己、同行参考。

8.26新增HAIP不通导致节点2执行root.sh失败:

如果在X为云平台部署rac,需要让haip地址互通,否则在执行第2个节点root脚本会失败。
原因是云平台网卡配置有“源目的检测”,需要将其关闭
Oracle 11G 11.2.0.4 RAC部署参考指南_第1张图片

一、Oracle 11g RAC部署

操作环境:CentOS 7.4 + Oracle 11.2.0.4 + UDEV
存储:云环境4T

二、集群规划

ASM磁盘组 udev 大小 描述
OCR_VOT /dev/asm_10g_ocrvot 10g ocr、voting file文件
DATA /dev/asm_1.3t_1、 /dev/asm_1.3t_2、 /dev/asm_1.3t_3 1.3T+1.3T+1.3T 数据文件存放

三、主机网络规划

网络配置 节点1 节点2
主机名称 rac1 rac2
public ip 172.16.4.11 172.16.4.12
private ip 10.10.10.11 10.10.10.12
vip 172.16.4.13 172.16.4.14
scan ip 172.16.4.15 172.16.4.15

四、操作系统配置部分

两个节点主机名设置

hostnamectl set-hostname racnnode1
  • 1、关闭防火墙
    在两个节点关闭防火墙
[root@rac1 ~]# systemctl stop firewalld
[root@rac1 ~]# systemctl disabled firewalld
  • 2、关闭selinux
    在两个节点关闭selinux
[root@rac1 ~]# vi /etc/selinux/config
SELINUX=disabled
[root@rac1 ~]#setenforce 0
  • 3、hosts文件配置
    在两个节点修改hosts文件
[root@rac1 ~]# vi /etc/hosts
#public ip ent0
172.16.4.11  rac1
172.16.4.12  rac2
#priv ip ent1
10.10.10.11  rac1-prv
10.10.10.12  rac2-prv
#vip ip
172.16.4.13  rac1-vip
172.16.4.14  rac2-vip
#scan ip
172.16.4.15  rac-scan

  • 4、依赖包配置
    在两个节点安装rac需要的依赖包
[root@rac1 ~]# 
yum install binutils  -y
yum install compat-libcap1 -y
yum install compat-libstdc++-33 -y
yum install gcc -y
yum install gcc-c++ -y
yum install glibc -y
yum install glibc-devel -y
yum install ksh -y
yum install libaio -y
yum install libaio-devel -y
yum install libgcc -y
yum install libstdc++- -y
yum install libstdc++-devel -y
yum install libXi -y
yum install libXtst -y
yum install make -y
yum install sysstat -y
yum install zlib-devel -y
yum install elfutils-libelf-devel -y
  • 5、关闭时间同步ntpd服务
检查两节点时间,时区是否相同,并禁止ntp
[root@rac1 ~]#systemctl disable ntpd.service
[root@rac1 ~]#systemctl stop ntpd.service
[root@rac1 ~]#mv /etc/ntp.conf /etc/ntp.conf.orig
[root@rac1 ~]#systemctl status ntpd

时区设置
# timedatectl list-timezones |grep Shanghai    #查找中国时区的完整名称
Asia/Shanghai
# timedatectl set-timezone Asia/Shanghai 
  • 6、创建用户及用户组

在两个节点创建oracle,grid用户、组

[root@rac1 ~]
groupadd -g 501 oinstall
groupadd -g 502 dba
groupadd -g 503 oper
groupadd -g 504 asmadmin
groupadd -g 505 asmoper
groupadd -g 506 asmdba
useradd -g oinstall -G dba,asmdba,oper oracle
useradd -g oinstall -G asmadmin,asmdba,asmoper,oper,dba grid

设置grid、oracle密码

[root@rac1 ~]
passwd grid
passwd oracle
  • 7、创建文件目录

在两个节点创建grid、oracle文件目录

[root@rac1 ~]
mkdir -p /u01/app/grid
mkdir -p /u01/app/11.2.0/grid
chown -R grid:oinstall /u01
mkdir -p /u01/app/oraInventory
chown -R grid:oinstall /u01/app/oraInventory
mkdir -p /u01/app/oracle
chown -R oracle:oinstall /u01/app/oracle
chmod -R 775 /u01
  • 8、修改20-nproc.conf
    在两个节点修改/etc/security/limits.d/20-nproc.conf
[root@rac1 ~]vi /etc/security/limits.d/20-nproc.conf
# Change this
#注释这行*          soft    nproc    1024
# To this增加下面一行
* - nproc 16384
  • 9、修改limits.conf

在两个节点修改/etc/security/limits.conf

[root@rac1 ~]vi /etc/security/limits.conf
#ORACLE SETTING
grid                 soft    nproc   2047
grid                 hard    nproc   16384
grid                 soft    nofile  1024
grid                 hard    nofile  65536
grid                 soft    stack   10240
grid                 hard    stack   32768
oracle               soft    nproc   2047
oracle               hard    nproc   16384
oracle               soft    nofile  1024
oracle               hard    nofile  65536
oracle               soft    stack   10240
oracle               hard    stack   32768
  • 10、修改login

在两个节点修改/etc/pam.d/login文件

[root@rac1 ~]vi /etc/pam.d/login
#ORACLE SETTING
session    required     pam_limits.so
  • 11、修改/etc/systemd/logind.conf文件

使用centos 7.2 安装grid时,需要修改这个参数,不然asm组件会起不来,crs时好时不好

vim /etc/systemd/logind.conf 
RemoveIPC=no 
systemctldaemon-reload 
systemctlrestart systemcd-logind
  • 12、修改sysctl.conf

在两个节点修改/etc/sysctl.conf

[root@rac1 ~]vi /etc/sysctl.conf
#ORACLE SETTING
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmmax = 3865470566   
kernel.shmall = 943718 
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 = 1048586
备注:kernel.shmmax = 3865470566   
shmmax Linux进程可以分配的单独共享内存段的最大值 
2g物理内存,shmmax=2*1024*1024*1024*0.9 大于SGA,小于物理内存

kernel.shmall = 943718     
2g物理内存 shmall=shmmax/10244
  • 13、停止avahi-daemon服务

两个节点分别操作

[root@rac1 ~]# systemctl disable avahi-daemon.socket
[root@rac1 ~]# systemctl disable avahi-daemon.service
ps -ef|grep avahi-daemon
kill -9 pid avahi-daemon
  • 14、添加NOZEROCONF=yes参数
[root@rac1 rpm]# vi /etc/sysconfig/network
NOZEROCONF=yes
  • 15、修改grid用户环境变量

节点1 grid

[root@rac1 ~]# su - grid

[grid@rac1:/home/grid]$vi ~/.bash_profile

PS1="[`whoami`@`hostname`:"'$PWD]$'
export PS1
umask 022
alias sqlplus="rlwrap sqlplus"
export TMP=/tmp
export LANG=en_US
export TMPDIR=$TMP
export ORACLE_HOSTNAME=rac1
ORACLE_SID=+ASM1; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
ORACLE_BASE=/u01/app/grid; export ORACLE_BASE
ORACLE_HOME=/u01/app/11.2.0/grid; export ORACLE_HOME
NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"; export NLS_DATE_FORMAT
PATH=.:$PATH:$HOME/bin:$ORACLE_HOME/bin; export PATH
THREADS_FLAG=native; export THREADS_FLAG
if [ $USER = "oracle" ] || [ $USER = "grid" ]; then
        if [ $SHELL = "/bin/ksh" ]; then
            ulimit -p 16384
              ulimit -n 65536
  else
   ulimit -u 16384 -n 65536
      fi
    umask 022
fi

节点2 grid

[root@rac2 ~]# su - grid

[grid@rac2:/home/grid]$vi ~/.bash_profile

PS1="[`whoami`@`hostname`:"'$PWD]$'
export PS1
umask 022
alias sqlplus="rlwrap sqlplus"
export TMP=/tmp
export LANG=en_US
export TMPDIR=$TMP
export ORACLE_HOSTNAME=rac2
ORACLE_SID=+ASM2; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
ORACLE_BASE=/u01/app/grid; export ORACLE_BASE
ORACLE_HOME=/u01/app/11.2.0/grid; export ORACLE_HOME
NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"; export NLS_DATE_FORMAT
PATH=.:$PATH:$HOME/bin:$ORACLE_HOME/bin; export PATH
THREADS_FLAG=native; export THREADS_FLAG
if [ $USER = "oracle" ] || [ $USER = "grid" ]; then
        if [ $SHELL = "/bin/ksh" ]; then
            ulimit -p 16384
              ulimit -n 65536
  else
   ulimit -u 16384 -n 65536
      fi
    umask 022
fi
  • 16、修改oracle用户环境变量

节点1 oracle

[root@rac1 ~]# su - oracle
[oracle@rac1:/home/oracle]$vi ~/.bash_profile

PS1="[`whoami`@`hostname`:"'$PWD]$'
alias sqlplus="rlwrap sqlplus"
alias rman="rlwrap rman"
export PS1
export TMP=/tmp
export LANG=en_US
export TMPDIR=$TMP
export ORACLE_HOSTNAME=rac1
export ORACLE_UNQNAME=rac1
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1; export ORACLE_HOME
ORACLE_SID=rac1; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"; export NLS_DATE_FORMAT
NLS_LANG=AMERICAN_AMERICA.ZHS16GBK;export NLS_LANG
PATH=.:$PATH:$HOME/bin:$ORACLE_BASE/product/11.2.0/db_1/bin:$ORACLE_HOME/bin; export PATH
THREADS_FLAG=native; export THREADS_FLAG
if [ $USER = "oracle" ] || [ $USER = "grid" ]; then
        if [ $SHELL = "/bin/ksh" ]; then
            ulimit -p 16384
              ulimit -n 65536
  else
   ulimit -u 16384 -n 65536
      fi
    umask 022
fi

节点2 oracle

[root@rac2 ~]# su - oracle
[oracle@rac2:/home/oracle]$vi ~/.bash_profile

PS1="[`whoami`@`hostname`:"'$PWD]$'
alias sqlplus="rlwrap sqlplus"
alias rman="rlwrap rman"
export PS1
export TMP=/tmp
export LANG=en_US
export TMPDIR=$TMP
export ORACLE_HOSTNAME=rac2
export ORACLE_UNQNAME=rac2
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1; export ORACLE_HOME
ORACLE_SID=rac2; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"; export NLS_DATE_FORMAT
NLS_LANG=AMERICAN_AMERICA.ZHS16GBK;export NLS_LANG
PATH=.:$PATH:$HOME/bin:$ORACLE_BASE/product/11.2.0/db_1/bin:$ORACLE_HOME/bin; export PATH
THREADS_FLAG=native; export THREADS_FLAG
if [ $USER = "oracle" ] || [ $USER = "grid" ]; then
        if [ $SHELL = "/bin/ksh" ]; then
            ulimit -p 16384
              ulimit -n 65536
  else
   ulimit -u 16384 -n 65536
      fi
    umask 022
fi

  • 17、修改root环境变量

加入grid用户$ORACLE_HOME,调取rac环境命令

[root@rac1 opt]# vi ~/.bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:/u01/app/11.2.0/grid/bin:$HOME/bin

export PATH


18、修改共享存储、udev规则

在节点1和节点2,固定设备名称并且赋予grid属性,执行如下命令,用来生成udev规则
18.1 非多路径设备

  • CentOS6/RHEL6
[root@rac1]# 

for i in b c d  
do  
echo "KERNEL==\"sd?\",SUBSYSTEM==\"block\", PROGRAM==\"/usr/lib/udev/scsi_id--whitelisted --replace-whitespace --device=/dev/\$name\",RESULT==\"`/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/sd$i`\", SYMLINK+=\"asm-disk$i\",OWNER=\"grid\", GROUP=\"asmadmin\",MODE=\"0660\""
done
  • CentOS7/RHEL7直接编辑如下文件,修改result
vi /etc/udev/rules.d/99-oracle-asmdevices.rules

KERNEL=="sd*[!0-9]", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="36000c2916521e6dbec5e963be5ab3947", RUN+="/bin/sh -c 'mknod /dev/asm-crs b $major $minor; chown grid:asmadmin /dev/asm-crs; chmod 0660 /dev/asm-crs'"

18.2 多路径设备

  • CentOS6/RHEL6
for i in asm-crs asm-data asm-arch; do printf "%s %s\n" "$i" "$(udevadm info --query=all --name=/dev/mapper/$i | grep -i dm_uuid)"; done
vi /etc/udev/rules.d/99-oracle-asmdevices.rules

KERNEL=="dm-*",ENV{DM_UUID}=="mpath-36005076802810e549800000000000002",OWNER="grid",GROUP="asmadmin",MODE="0660",NAME="asm-crs"
KERNEL=="dm-*",ENV{DM_UUID}=="mpath-36005076802810e549800000000000003",OWNER="grid",GROUP="asmadmin",MODE="0660",NAME="asm-data"
KERNEL=="dm-*",ENV{DM_UUID}=="mpath-36005076802810e549800000000000004",OWNER="grid",GROUP="asmadmin",MODE="0660",NAME="asm-arch"
  • CentOS7/RHEL7

1 取得DM_UUID:

cd /dev/mapper
for i in `ls mpath*`; do printf "%s %s\n" "$i" "$(udevadm info --query=all --name=/dev/mapper/$i |grep -i dm_uuid)"; done

2 生成rules文件


vi /etc/udev/rules.d/99-oracle-asmdevices.rules

KERNEL=="dm-*",ENV{DM_UUID}=="mpath-xxxxxxxxxxxxxx",SYMLINK+="asm_xx",OWNER="grid",GROUP="asmadmin",MODE="0660"

3重新加载udev
本次环境udev规则示例:
cat /etc/udev/rules.d/99-oracle-asmdevices.rules

KERNEL=="sd*[!0-9]", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="0QEMU_QEMU_HARDDISK_fb370efa-6407-45d4-b", RUN+="/bin/sh -c 'mknod /dev/asm_10g_ocrvot b $major $minor; chown grid:asmadmin /dev/asm_10g_ocrvot; chmod 0660 /dev/asm_10g_ocrvot'"
KERNEL=="sd*[!0-9]", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="0QEMU_QEMU_HARDDISK_4ff4aae0-38b1-4536-b", RUN+="/bin/sh -c 'mknod /dev/asm_1.3t_1 b $major $minor; chown grid:asmadmin /dev/asm_1.3t_1; chmod 0660 /dev/asm_1.3t_1'"
KERNEL=="sd*[!0-9]", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="0QEMU_QEMU_HARDDISK_f63b238f-823c-49d1-b", RUN+="/bin/sh -c 'mknod /dev/asm_1.3t_2 b $major $minor; chown grid:asmadmin /dev/asm_1.3t_2; chmod 0660 /dev/asm_1.3t_2'"
KERNEL=="sd*[!0-9]", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="0QEMU_QEMU_HARDDISK_d80cf01b-dd92-4c84-a", RUN+="/bin/sh -c 'mknod /dev/asm_1.3t_3 b $major $minor; chown grid:asmadmin /dev/asm_1.3t_3; chmod 0660 /dev/asm_1.3t_3'"

udevadm control --reload-rules
udevadm trigger

两个节点重启udev


[root@rac1 ~]# udevadm control --reload-rules
[root@rac1 ~]# udevadm trigger

[root@rac1 ~]#systemctl restart systemd-udev-trigger.service

19、检查共享磁盘分区
在两个节点检查udev重新生效后,asm磁盘是否可以识别

[root@csrac1 ~]# ll /dev/asm*
brw-rw---- 1 grid asmadmin 8, 16 Aug 26 10:44 /dev/asm_10g_ocrvot
brw-rw---- 1 grid asmadmin 8, 32 Aug 26 10:44 /dev/asm_1.3t_1
brw-rw---- 1 grid asmadmin 8, 48 Aug 26 10:44 /dev/asm_1.3t_2
brw-rw---- 1 grid asmadmin 8, 64 Aug 26 10:44 /dev/asm_1.3t_3

五、Grid集群软件安装部分

1、上传集群软件包
在节点1上传grid以及oracle安装包

[root@rac1 orasoft]# ll
p13390677_112040_Linux-x86-64_1of7.zip
p13390677_112040_Linux-x86-64_2of7.zip
p13390677_112040_Linux-x86-64_3of7.zip

2、解压安装包
解压grid安装包到新的目录

3、安装集群CVUQDISK包

节点1

[root@rac1 grid]# cd rpm
[root@rac1 rpm]#export CVUQDISK_GRP=oinstall
[root@rac1 rpm]#rpm -ivh cvuqdisk-1.0.9-1.rpm 

节点2

[root@rac2 rpm]#export CVUQDISK_GRP=oinstall
[root@rac2 rpm]#rpm -ivh cvuqdisk-1.0.9-1.rpm 

4、进入grid集群软件目录执行安装

验证是否满足oracle集群条件
节点1和节点2 在grid软件目录里运行以下命令:
在grid用户下:

./runcluvfy.sh stage -pre crsinst -n rac1,rac2 -fixup -verbose
[grid@rac1 grid]$ ./runInstaller 

5、GUI安装步骤
Oracle 11G 11.2.0.4 RAC部署参考指南_第2张图片
Oracle 11G 11.2.0.4 RAC部署参考指南_第3张图片
Oracle 11G 11.2.0.4 RAC部署参考指南_第4张图片
Oracle 11G 11.2.0.4 RAC部署参考指南_第5张图片
Oracle 11G 11.2.0.4 RAC部署参考指南_第6张图片
scan name需要与hosts文件一致
Oracle 11G 11.2.0.4 RAC部署参考指南_第7张图片
Oracle 11G 11.2.0.4 RAC部署参考指南_第8张图片
Oracle 11G 11.2.0.4 RAC部署参考指南_第9张图片

添加asm磁盘crs,用于存放ocr、voting file集群信息
Oracle 11G 11.2.0.4 RAC部署参考指南_第10张图片
Oracle 11G 11.2.0.4 RAC部署参考指南_第11张图片
Oracle 11G 11.2.0.4 RAC部署参考指南_第12张图片
Oracle 11G 11.2.0.4 RAC部署参考指南_第13张图片
Oracle 11G 11.2.0.4 RAC部署参考指南_第14张图片
Oracle 11G 11.2.0.4 RAC部署参考指南_第15张图片

选择忽略Oracle 11G 11.2.0.4 RAC部署参考指南_第16张图片Oracle 11G 11.2.0.4 RAC部署参考指南_第17张图片

Oracle 11G 11.2.0.4 RAC部署参考指南_第18张图片

执行root.sh

六、Oracle DataBase软件安装

进入软件安装目录,执行安装

[oracle@rac1 opt]$ cd database/
[oracle@rac1 database]$ ./runInstaller 

Oracle 11G 11.2.0.4 RAC部署参考指南_第19张图片

Oracle 11G 11.2.0.4 RAC部署参考指南_第20张图片
Oracle 11G 11.2.0.4 RAC部署参考指南_第21张图片
Oracle 11G 11.2.0.4 RAC部署参考指南_第22张图片
Oracle 11G 11.2.0.4 RAC部署参考指南_第23张图片
Oracle 11G 11.2.0.4 RAC部署参考指南_第24张图片
Oracle 11G 11.2.0.4 RAC部署参考指南_第25张图片
Oracle 11G 11.2.0.4 RAC部署参考指南_第26张图片
Oracle 11G 11.2.0.4 RAC部署参考指南_第27张图片
Oracle 11G 11.2.0.4 RAC部署参考指南_第28张图片

七、Oracle ASM磁盘划分

7.1 grid用下下调用asmca图形化划分asm磁盘

[grid@rac1 opt]$ asmca

Oracle 11G 11.2.0.4 RAC部署参考指南_第29张图片
Oracle 11G 11.2.0.4 RAC部署参考指南_第30张图片

创建asm磁盘组用于存放实例的数据文件、归档日志文件
7.2 通过命令创建

SQL> create diskgroup arch external redundancy 
disk '/dev/asm-diske' size 1024m ATTRIBUTE 'compatible.rdbms'='11.1',
'compatible.asm'='11.1','au_size' = '4M';

八、dbca创建实例

Oracle 11G 11.2.0.4 RAC部署参考指南_第31张图片
Oracle 11G 11.2.0.4 RAC部署参考指南_第32张图片
Oracle 11G 11.2.0.4 RAC部署参考指南_第33张图片

Oracle 11G 11.2.0.4 RAC部署参考指南_第34张图片
Oracle 11G 11.2.0.4 RAC部署参考指南_第35张图片
生产环境可关闭EM以及Automatic Maintenance Tasks

Oracle 11G 11.2.0.4 RAC部署参考指南_第36张图片

Oracle 11G 11.2.0.4 RAC部署参考指南_第37张图片
Oracle 11G 11.2.0.4 RAC部署参考指南_第38张图片
Oracle 11G 11.2.0.4 RAC部署参考指南_第39张图片
Oracle 11G 11.2.0.4 RAC部署参考指南_第40张图片
生产环境可将分配给Oracle的内存70%以上
Oracle 11G 11.2.0.4 RAC部署参考指南_第41张图片
生产环境将process设定1000以上

Oracle 11G 11.2.0.4 RAC部署参考指南_第42张图片
选择中文编码ZHS16GBK

Oracle 11G 11.2.0.4 RAC部署参考指南_第43张图片
选择专用模式

Oracle 11G 11.2.0.4 RAC部署参考指南_第44张图片
在生产环境中联机日志组需要创建多个,每个日志组的大小需要修改

Oracle 11G 11.2.0.4 RAC部署参考指南_第45张图片
开始创建实例

九、CentOS7安装过程中报错处理

9.1 Adding Clusterware entries to inittab ohasd failed
centos7中在安装grid软件,运行root.sh报错
[root@rac1 soft]# /u01/app/11.2.0/grid/root.sh

报错信息
Adding Clusterware entries to inittab ohasd failed to start Failed to start the Clusterware. Last 20 lines of the alert log follow: 2018-01-18 17:03:15.555:

[client(18523)]CRS-2101:The OLR was formatted using version 3.

因为CentOS7/RHEL7 使用systemd而不是initd运行进程和重启进程,而root.sh通过传统的initd运行ohasd进程。

解决方法:
在RHEL 7中ohasd需要被设置为一个服务,在运行脚本root.sh之前。
步骤如下:

  1. 以root用户创建服务文件,将以下内容添加到新创建的ohas.service文件中
[root@rac1 init.d]#vi /usr/lib/systemd/system/ohas.service
[Unit]
Description=Oracle High Availability Services
After=syslog.target

[Service]
ExecStart=/etc/init.d/init.ohasd run >/dev/null 2>&1 Type=simple
Restart=always

[Install]
WantedBy=multi-user.target

chmod 777 /usr/lib/systemd/system/ohas.service
  1. 以root用户运行下面的命令
systemctl daemon-reload
systemctl enable ohas.service
systemctl start ohas.service
  1. 查看运行状态
[root@rac1 init.d]# systemctl status ohas.service

ohas.service - Oracle High Availability Services
   Loaded: loaded (/usr/lib/systemd/system/ohas.service; enabled)
   Active: failed (Result: start-limit) since------此时状态为失败,原因是现在还没有/etc/init.d/init.ohasd文件。
下面可以运行脚本root.sh 不会再报ohasd failed to start错误了。

4.如果还是报ohasd failed to start错误,可能是root.sh脚本创建了init.ohasd之后,ohas.service没有马上启动,解决方法:

当运行root.sh时,一直刷新/etc/init.d ,直到出现 init.ohasd 文件,马上手动启动ohas.service服务 命令:systemctl start ohas.service 
[root@rac1 init.d]# systemctl status ohas.service
ohas.service - Oracle High Availability Services
   Loaded: loaded (/usr/lib/systemd/system/ohas.service; enabled)
   Active: active (running) since ; 3s ago  ---状态为active即可

9.2 Oracle software安装过程中报错 ins_emagent.mk Error in invoking target 'agent nmhs' of makefile '/u01/app/oracle/product/11.2.0/db_1/sysman/lib/ins_emagent.mk'.
Oracle 11G 11.2.0.4 RAC部署参考指南_第46张图片

解决方法:

Edit $ORACLE_HOME/sysman/lib/ins_emagent.mk, search for the line

$(MK_EMAGENT_NMECTL)

Then replace the line with

$(MK_EMAGENT_NMECTL) -lnnz11

Then click “Retry” button to continue.

十、卸载Grid Cluster集群环境

1、卸载oracle数据库软件

su - oracle
cd $ORACLE_HOME/deinstall
[oracle@rac1 deinstall]$ ./deinstall
The details of database(s) orcl have been discovered automatically. Do you still want to modify the details of orcl database(s)? [n]: y

2、卸载grid集群软件

su - grid
cd $ORACLE_HOME/deinstall
[grid@rac1 deinstall]$ ./deinstall

如果不需要保留asm磁盘组,输入N

 If you want to retain the existing diskgroups or if any of the information detected is incorrect, you can modify by entering 'y'. Do you  want to modify above information (y|n) [n]: n
Database Check Configuration START

3、重新配置集群、清除grid安装配置,清空OCR配置和Voting disk
如果由于一些原因导致需要重新配置集群,那么需要先deconfig,再reconfig:
第一个节点

ORACLE_HOME/crs/install/rootcrs.sh -verbose -deconfig –force

第二个节点

ORACLE_HOME/crs/install/rootcrs.sh -verbose -deconfig –force -lastnode
rm -rf /etc/oraInst.loc 

4、asm磁盘格式化

dd if=/dev/zero of=/dev/asm-crs bs=10240M count=1
dd if=/dev/zero of=/dev/sdb1 bs=1024 count=100

十一、常用命令

10.1 检查所有节点的时间在集群中是否一致
cluvfy comp clocksync -n all -verbose

10.2 命令查看所有节点的状态
crsctl check cluster -all

10.3 查看ocr盘的状况
ocrcheck

10.4 查看votedisk盘的状况
crsctl query css votedisk

10.5 节点应用程序配置信息(VIP、GSD、ONS、监听器)
srvctl config nodeapps -a -g -s –l

10.6 查看所有Oracle实例(数据库状态)
srvctl status database -d db_name

10.7 检查单个实例状态
srvctl status instance -orcl -i orcl1

10.8 节点应用程序状态
srvctl status nodeapps

10.9 列出所有的配置数据库
srvctl config database

10.10 数据库配置
srvctl config database -d orcl -a

10.11 ASM状态以及ASM配置

srvctl status asm
srvctl status asm -a

10.12 TNS监听器状态以及配置
srvctl status listener
srvctl config listener -a

10.13 SCAN状态以及配置

srvctl status scan
srvctl config scan

10.14 节点应用程序配置信息(VIP、GSD、ONS、监听器)
$ srvctl config nodeapps -a -g -s -l

10.15 数据库与实例启动
srvctl start database -d orcl# 启动数据库
srvctl stop database -d orcl# 关闭数据库
srvctl start instance -d orcl -i orcl1 # 启动指定的实例
srvctl stop instance -d orcl -i orcl2 # 关闭指定实例

10.16 网络相关状态
srvctl status listener # 检查TNS listener的状态
srvctl config scan # SCAN的配置
srvctl status scan # SCAN listener状态, 包含当前运行节点的信息

10.17 检查VIP的配置及状态
srvctl status vip -n rac1
srvctl config vip -n rac1

查看各资源状态(nodeapps节点应用程序,ASM实例,数据库等)

附:rac环境预准备sh脚本

此脚本适用CentOS7环境,可将centos iso镜像放在/opt目录下,两个节点保存为sh文件,并将环境变量的sid改为生产环境实例,oracle预处理环境自动完成。

节点1

#!/bin/bash
#Purpose:Modify the NTPD YUM。
#Usage:Log on as the superuser('root'),and then execute the command





mkdir /mnt/iso
mkdir /mnt/cdrom

mv /opt/CentOS*.iso /mnt/iso




mount -o loop /mnt/iso/*.iso /mnt/cdrom

echo "Now rename /etc/yum.repos.d/public-yum-ol6.repo123"
mv /etc/yum.repos.d/CentOS-Base.repo  /etc/yum.repos.d/CentOS-Base.repo123

echo "make local YUM succeed"




touch /etc/yum.repos.d/local.repo
echo "[local]" >> /etc/yum.repos.d/local.repo
echo "name =Linux7 yum" >> /etc/yum.repos.d/local.repo
echo "baseurl=file:///mnt/cdrom" >> /etc/yum.repos.d/local.repo
echo "gpgcheck=0" >> /etc/yum.repos.d/local.repo
echo "enabled=1" >> /etc/yum.repos.d/local.repo

yum clean all






systemctl disable ntpd.service
systemctl stop ntpd.service
mv /etc/ntp.conf /etc/ntp.conf.orig




echo "Now create 6 groups named 'oinstall','dba','asmadmin','asmdba','asmoper','oper'"
echo "Plus 2 users named 'oracle','grid' "
 
 
groupadd -g 501 oinstall
groupadd -g 502 dba
groupadd -g 503 oper
groupadd -g 504 asmadmin
groupadd -g 505 asmoper
groupadd -g 506 asmdba
useradd -u 1101 -g oinstall -G dba,asmdba,oper -d /home/oracle -s /bin/bash -c "oracle" oracle
echo "oracle" | passwd --stdin oracle
useradd -u 1102 -g oinstall -G asmadmin,asmdba,asmoper,oper,dba -d /home/grid -s /bin/bash -c "grid" grid
echo "oracle" | passwd --stdin grid
 
echo "The Groups and users has been created"




echo "Now create the necessary directory for oracle,grid users and change the authention to oracle,grid users..."


mkdir -p /u01/app/grid
mkdir -p /u01/app/11.2.0/grid
chown -R grid:oinstall /u01
mkdir -p /u01/app/oraInventory
chown -R grid:oinstall /u01/app/oraInventory
mkdir -p /u01/app/oracle
chown -R oracle:oinstall /u01/app/oracle
chmod -R 775 /u01
echo "The necessary directory for oracle,grid users and change the authention to oracle,grid users has been finished"






echo "Now modify the /etc/security/limits.conf,but backup it named /etc/security/limits.conf.bak before"
cp /etc/security/limits.conf /etc/security/limits.conf.bak
echo "grid  soft  nproc 16384" >>/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
echo "grid  soft  stack 10240" >>/etc/security/limits.conf
echo "grid  hard  stack 32768" >>/etc/security/limits.conf
echo "oracle soft nproc 16384" >>/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 "oracle soft stack  10240" >>/etc/security/limits.conf
echo "oracle hard stack  32768" >>/etc/security/limits.conf

echo "Modifing the /etc/security/limits.conf has been succeed."

 





echo "Now modify the /etc/security/limits.d/90-nproc.conf,but with a backup named /etc/security/limits.d/90-nproc.conf.bak"
cp /etc/security/limits.d/20-nproc.conf /etc/security/limits.d/20-nproc.conf.bak
echo "# Default limit for number of user's processes to prevent" > /etc/security/limits.d/20-nproc.conf
echo "# accidental fork bombs." >> /etc/security/limits.d/20-nproc.conf
echo "# See rhbz #432903 for reasoning." >> /etc/security/limits.d/20-nproc.conf
echo "root soft nproc unlimited" >> /etc/security/limits.d/20-nproc.conf
echo "* - nproc 16384" >> /etc/security/limits.d/20-nproc.conf
echo "Modifing the /etc/security/limits.d/90-nproc.conf has been succeed."






echo "Now modify the /etc/pam.d/login,but with a backup named /etc/pam.d/login.bak"
cp /etc/pam.d/login /etc/pam.d/login.bak
 
echo "session required pam_limits.so" >>/etc/pam.d/login
 
echo "Modifing the /etc/pam.d/login has been succeed."







echo "Now modify the /etc/sysctl.conf,but with a backup named /etc/sysctl.bak"
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.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 "kernel.shmmax = 247390116249" >> /etc/sysctl.conf
echo "kernel.shmall = 60397977" >> /etc/sysctl.conf
 
echo "Modifing the /etc/sysctl.conf has been succeed."
echo "Now make the changes take effect....."
sysctl -p

#如下两个参数根据实际环境修改
#kernel.shmmax = 3865470566   Linux进程可以分配的单独共享内存段的最大值 (2g物理内存,shmmax=2*1024*1024*1024*0.9 )
#kernel.shmall = 943718         2g内存shmall==shmmax/1024/4



echo "Now modify the  /home/grid/.bash_profile,but with a backup named  /home/grid/.bash_profile.bak"
cp /home/grid/.bash_profile /home/grid/.bash_profile.bak

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_HOSTNAME=jsrac1">> /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 PATH=.:$PATH:$HOME/bin:$ORACLE_HOME/bin'>> /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 THREADS_FLAG=native" >> /home/grid/.bash_profile
echo "export NLS_LANG=american_america.AL32UTF8" >> /home/grid/.bash_profile
echo 'if [ $USER = "oracle" ]||[ $USER = "grid" ]; then' >>  /home/grid/.bash_profile
echo 'if [ $SHELL = "/bin/ksh" ]; then' >> /home/grid/.bash_profile
echo 'ulimit -p 16384' >> /home/grid/.bash_profile
echo 'ulimit -n 65536' >> /home/grid/.bash_profile
echo 'else' >> /home/grid/.bash_profile
echo 'ulimit -u 16384 -n 65536' >> /home/grid/.bash_profile
echo 'fi' >> /home/grid/.bash_profile
echo 'umask 022' >> /home/grid/.bash_profile
echo 'fi' >> /home/grid/.bash_profile
echo "Modifing the /home/grid/.bash_profile has been succeed."




echo "Now modify the  /home/oracle/.bash_profile,but with a backup named  /home/oracle/.bash_profile.bak"
cp /home/oracle/.bash_profile /home/oracle/.bash_profile.bak


echo "export TMP=/tmp">> /home/oracle/.bash_profile
echo 'export TMPDIR=$TMP'>>/home/oracle/.bash_profile
echo "export ORACLE_HOSTNAME=jsrac1">> /home/oracle/.bash_profile
echo "export ORACLE_SID=js123451">> /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/db_1'>> /home/oracle/.bash_profile
echo "export ORACLE_UNQNAME=js12345">> /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=.:$PATH:$HOME/bin:$ORACLE_BASE/product/11.2.0/db_1/bin:$ORACLE_HOME/bin'>> /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 THREADS_FLAG=native" >> /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 'if [ $USER = "oracle" ]||[ $USER = "grid" ]; then' >>  /home/oracle/.bash_profile
echo 'if [ $SHELL = "/bin/ksh" ]; then' >> /home/oracle/.bash_profile
echo 'ulimit -p 16384' >> /home/oracle/.bash_profile
echo 'ulimit -n 65536' >> /home/oracle/.bash_profile
echo 'else' >> /home/oracle/.bash_profile
echo 'ulimit -u 16384 -n 65536' >> /home/oracle/.bash_profile
echo 'fi' >> /home/oracle/.bash_profile
echo 'umask 022' >> /home/oracle/.bash_profile
echo 'fi' >> /home/oracle/.bash_profile
echo "Modifing the /home/oracle/.bash_profile has been succeed."






yum install -y binutils
yum install -y compat-libcap1
yum install -y compat-libstdc++-33
yum install -y compat-libstdc++-33.i686
yum install -y gcc
yum install -y gcc-c++
yum install -y glibc
yum install -y glibc.i686
yum install -y glibc-devel
yum install -y glibc-devel.i686
yum install -y ksh
yum install -y libgcc
yum install -y libgcc.i686
yum install -y libstdc++
yum install -y libstdc++.i686
yum install -y libstdc++-devel
yum install -y libstdc++-devel.i686
yum install -y libaio
yum install -y libaio.i686
yum install -y libaio-devel
yum install -y libaio-devel.i686
yum install -y libXext
yum install -y libXext.i686
yum install -y libXtst
yum install -y libXtst.i686
yum install -y libX11
yum install -y libX11.i686
yum install -y libXau
yum install -y libXau.i686
yum install -y libxcb
yum install -y libxcb.i686
yum install -y libXi
yum install -y libXi.i686
yum install -y make
yum install -y sysstat
yum install -y unixODBC
yum install -y unixODBC-devel
yum install -y readline
yum install -y libtermcap-devel
yum install -y pdksh
yum install -y elfutils-libelf-devel



systemctl disable avahi-daemon.socket
systemctl disable avahi-daemon.service


systemctl stop firewalld
systemctl disable firewalld

echo "NOZEROCONF=yes" >> /etc/sysconfig/network


cp /etc/selinux/config /etc/selinux/config.bak
echo "SELINUX=disabled" > /etc/selinux/config
echo "SELINUXTYPE=targeted" >> /etc/selinux/config


节点2

#!/bin/bash
#Purpose:Modify the NTPD YUM
#Usage:Log on as the superuser('root'),and then execute the command


mkdir /mnt/iso
mkdir /mnt/cdrom

mv /opt/CentOS*.iso /mnt/iso




mount -o loop /mnt/iso/*.iso /mnt/cdrom

echo "Now rename /etc/yum.repos.d/public-yum-ol6.repo123"
mv /etc/yum.repos.d/CentOS-Base.repo  /etc/yum.repos.d/CentOS-Base.repo123

echo "make local YUM succeed"




touch /etc/yum.repos.d/local.repo
echo "[local]" >> /etc/yum.repos.d/local.repo
echo "name =Linux7 yum" >> /etc/yum.repos.d/local.repo
echo "baseurl=file:///mnt/cdrom" >> /etc/yum.repos.d/local.repo
echo "gpgcheck=0" >> /etc/yum.repos.d/local.repo
echo "enabled=1" >> /etc/yum.repos.d/local.repo

yum clean all


systemctl disable ntpd.service
systemctl stop ntpd.service
mv /etc/ntp.conf /etc/ntp.conf.orig





echo "Now create 6 groups named 'oinstall','dba','asmadmin','asmdba','asmoper','oper'"
echo "Plus 2 users named 'oracle','grid' "
 
 
groupadd -g 501 oinstall
groupadd -g 502 dba
groupadd -g 503 oper
groupadd -g 504 asmadmin
groupadd -g 505 asmoper
groupadd -g 506 asmdba
useradd -u 1101 -g oinstall -G dba,asmdba,oper -d /home/oracle -s /bin/bash -c "oracle" oracle
echo "oracle" | passwd --stdin oracle
useradd -u 1102 -g oinstall -G asmadmin,asmdba,asmoper,oper,dba -d /home/grid -s /bin/bash -c "grid" grid
echo "oracle" | passwd --stdin grid
 
echo "The Groups and users has been created"




echo "Now create the necessary directory for oracle,grid users and change the authention to oracle,grid users..."


mkdir -p /u01/app/grid
mkdir -p /u01/app/11.2.0/grid
chown -R grid:oinstall /u01
mkdir -p /u01/app/oraInventory
chown -R grid:oinstall /u01/app/oraInventory
mkdir -p /u01/app/oracle
chown -R oracle:oinstall /u01/app/oracle
chmod -R 775 /u01
echo "The necessary directory for oracle,grid users and change the authention to oracle,grid users has been finished"






echo "Now modify the /etc/security/limits.conf,but backup it named /etc/security/limits.conf.bak before"
cp /etc/security/limits.conf /etc/security/limits.conf.bak
echo "grid  soft  nproc 16384" >>/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
echo "grid  soft  stack 10240" >>/etc/security/limits.conf
echo "grid  hard  stack 32768" >>/etc/security/limits.conf
echo "oracle soft nproc 16384" >>/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 "oracle soft stack  10240" >>/etc/security/limits.conf
echo "oracle hard stack  32768" >>/etc/security/limits.conf

echo "Modifing the /etc/security/limits.conf has been succeed."

 





echo "Now modify the /etc/security/limits.d/90-nproc.conf,but with a backup named /etc/security/limits.d/90-nproc.conf.bak"
cp /etc/security/limits.d/20-nproc.conf /etc/security/limits.d/20-nproc.conf.bak
echo "# Default limit for number of user's processes to prevent" > /etc/security/limits.d/20-nproc.conf
echo "# accidental fork bombs." >> /etc/security/limits.d/20-nproc.conf
echo "# See rhbz #432903 for reasoning." >> /etc/security/limits.d/20-nproc.conf
echo "root soft nproc unlimited" >> /etc/security/limits.d/20-nproc.conf
echo "* - nproc 16384" >> /etc/security/limits.d/20-nproc.conf
echo "Modifing the /etc/security/limits.d/90-nproc.conf has been succeed."






echo "Now modify the /etc/pam.d/login,but with a backup named /etc/pam.d/login.bak"
cp /etc/pam.d/login /etc/pam.d/login.bak
 
echo "session required pam_limits.so" >>/etc/pam.d/login
 
echo "Modifing the /etc/pam.d/login has been succeed."







echo "Now modify the /etc/sysctl.conf,but with a backup named /etc/sysctl.bak"
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.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 "kernel.shmmax = 247390116249" >> /etc/sysctl.conf
echo "kernel.shmall = 60397977" >> /etc/sysctl.conf
 
echo "Modifing the /etc/sysctl.conf has been succeed."
echo "Now make the changes take effect....."
sysctl -p

#如下两个参数根据实际环境修改
#kernel.shmmax = 3865470566   Linux进程可以分配的单独共享内存段的最大值 (2g物理内存,shmmax=2*1024*1024*1024*0.9 )
#kernel.shmall = 943718         2g内存shmall==shmmax/1024/4




echo "Now modify the  /home/grid/.bash_profile,but with a backup named  /home/grid/.bash_profile.bak"
cp /home/grid/.bash_profile /home/grid/.bash_profile.bak

echo "export TMP=/tmp">> /home/grid/.bash_profile
echo 'export TMPDIR=$TMP'>>/home/grid/.bash_profile
echo "export ORACLE_SID=+ASM2">> /home/grid/.bash_profile
echo "export ORACLE_HOSTNAME=jsrac2">> /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 PATH=.:$PATH:$HOME/bin:$ORACLE_HOME/bin'>> /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 THREADS_FLAG=native" >> /home/grid/.bash_profile
echo "export NLS_LANG=american_america.AL32UTF8" >> /home/grid/.bash_profile



echo 'if [ $USER = "oracle" ]||[ $USER = "grid" ]; then' >>  /home/grid/.bash_profile
echo 'if [ $SHELL = "/bin/ksh" ]; then' >> /home/grid/.bash_profile
echo 'ulimit -p 16384' >> /home/grid/.bash_profile
echo 'ulimit -n 65536' >> /home/grid/.bash_profile
echo 'else' >> /home/grid/.bash_profile
echo 'ulimit -u 16384 -n 65536' >> /home/grid/.bash_profile
echo 'fi' >> /home/grid/.bash_profile
echo 'umask 022' >> /home/grid/.bash_profile
echo 'fi' >> /home/grid/.bash_profile
echo "Modifing the /home/grid/.bash_profile has been succeed."




echo "Now modify the  /home/oracle/.bash_profile,but with a backup named  /home/oracle/.bash_profile.bak"
cp /home/oracle/.bash_profile /home/oracle/.bash_profile.bak


echo "export TMP=/tmp">> /home/oracle/.bash_profile
echo 'export TMPDIR=$TMP'>>/home/oracle/.bash_profile
echo "export ORACLE_HOSTNAME=jsrac2">> /home/oracle/.bash_profile
echo "export ORACLE_SID=js123452">> /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/db_1'>> /home/oracle/.bash_profile
echo "export ORACLE_UNQNAME=js12345">> /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=.:$PATH:$HOME/bin:$ORACLE_BASE/product/11.2.0/db_1/bin:$ORACLE_HOME/bin'>> /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 THREADS_FLAG=native" >> /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 'if [ $USER = "oracle" ]||[ $USER = "grid" ]; then' >>  /home/oracle/.bash_profile
echo 'if [ $SHELL = "/bin/ksh" ]; then' >> /home/oracle/.bash_profile
echo 'ulimit -p 16384' >> /home/oracle/.bash_profile
echo 'ulimit -n 65536' >> /home/oracle/.bash_profile
echo 'else' >> /home/oracle/.bash_profile
echo 'ulimit -u 16384 -n 65536' >> /home/oracle/.bash_profile
echo 'fi' >> /home/oracle/.bash_profile
echo 'umask 022' >> /home/oracle/.bash_profile
echo 'fi' >> /home/oracle/.bash_profile
echo "Modifing the /home/oracle/.bash_profile has been succeed."






yum install -y binutils
yum install -y compat-libcap1
yum install -y compat-libstdc++-33
yum install -y compat-libstdc++-33.i686
yum install -y gcc
yum install -y gcc-c++
yum install -y glibc
yum install -y glibc.i686
yum install -y glibc-devel
yum install -y glibc-devel.i686
yum install -y ksh
yum install -y libgcc
yum install -y libgcc.i686
yum install -y libstdc++
yum install -y libstdc++.i686
yum install -y libstdc++-devel
yum install -y libstdc++-devel.i686
yum install -y libaio
yum install -y libaio.i686
yum install -y libaio-devel
yum install -y libaio-devel.i686
yum install -y libXext
yum install -y libXext.i686
yum install -y libXtst
yum install -y libXtst.i686
yum install -y libX11
yum install -y libX11.i686
yum install -y libXau
yum install -y libXau.i686
yum install -y libxcb
yum install -y libxcb.i686
yum install -y libXi
yum install -y libXi.i686
yum install -y make
yum install -y sysstat
yum install -y unixODBC
yum install -y unixODBC-devel
yum install -y readline
yum install -y libtermcap-devel
yum install -y pdksh
yum install -y elfutils-libelf-devel



systemctl disable avahi-daemon.socket
systemctl disable avahi-daemon.service


systemctl stop firewalld
systemctl disable firewalld

echo "NOZEROCONF=yes" >> /etc/sysconfig/network


cp /etc/selinux/config /etc/selinux/config.bak
echo "SELINUX=disabled" > /etc/selinux/config
echo "SELINUXTYPE=targeted" >> /etc/selinux/config

compat-libstdc+±33-3.2.3-72.el7.x86_64.rpm
elfutils-libelf-devel-0.168-8.el7.x86_64.rpm
在百度网盘
https://pan.baidu.com/s/1uyZXK3-KytN6OflHgHBb6A

你可能感兴趣的:(11g)