Oracle 12c RAC 系统安装手册

 


 

1 Oracle安装环境准备

1.    配置网络

网络环境规划

public 网络的域名:*.rac.occ

网络:192.168.10.*

DNS服务器:192.168.10.254

网关:192.168.10.2

路由器:192.168.10.2

IP地址

主机名

域名

用途

192.168.10.101255.255.255.0

oracle1

oracle1.rac.occ

oracle1 public IP

192.168.10.102255.255.255.0

oracle2

oracle2.rac.occ

oracle2 public IP

192.168.100.101  (255.255.255.0)

oracle1-private

oracle1-private.rac.occ

oracle1 private IP

192.168.100.102 (255.255.255.0)

oracle2-private

oracle2-private .rac.occ

oracle1 private IP

192.168.10.111 255.255.255.0

oracle1-vip

oracle1-vip .rac.occ

oracle1 virtual IP

192.168.10.112255.255.255.0

oracle2-vip

oracle2-vip

oracle2 virtual IP

192.168.10.6255.255.255.0

oracle-scan

oracle-scan

scan IP

 

                                                               i.      配置服务器 IP 地址:

服务器配置了 1 PCI-E 千兆网卡,提供了4个独立的IP网口,分成两组,每组2 块网卡进行绑定,承载外网和心跳通信。通过配置bond实现网络failover冗余功能。外网使用第一个网口enp0s1和第二个网口enp0s2bond0,心跳直连使用第三个网口enp0s3和第四个网口enp0s4bond1

oracle1网络IP网卡绑定配置:

nmtui 操作略

oracle2网络IP 网卡绑定配置:

nmtui 操作略

                                        ii.    修改 2 个节点的/etc/hosts 文件:

#loop

127.0.0.1 localhost

 

#SCAN

192.168.10.6 oracle-scan

 

#Oracle1

192.168.10.101 oracle1

192.168.100.101 oracle1-private

192.168.10.111 oracle1-vip

 

#Oracle2

192.168.10.102 oracle2

192.168.100.102 oracle2-private

192.168.10.112 oracle2-vip

 

# DNS

第一个网卡的设置举例:

[root@oracle1 network-scripts]# vim ifcfg-enp0s3

TYPE=Ethernet

BOOTPROTO=none

DEFROUTE=yes

IPV4_FAILURE_FATAL=no

IPV6INIT=no

IPV6_AUTOCONF=yes

IPV6_DEFROUTE=yes

IPV6_FAILURE_FATAL=no

NAME=enp0s3

UUID=212c24fd-46e2-437d-83b2-411e40b5b74c

DEVICE=enp0s3

ONBOOT=yes

IPV6_PEERDNS=yes

IPV6_PEERROUTES=yes

ZONE=home

DNS1=192.168.10.254

DOMAIN=rac.occ

IPADDR=192.168.10.101

PREFIX=24

GATEWAY=192.168.10.2

 

                                       iii.    配置 nsloopup 进行 scanip 解析

如果安装时没选择GNS,在安装前需要对nslookup进行配置,否则会有如下报错:

INS-20802

INFO: Checking name resolution setup for "rac-scanip"...

INFO: ERROR:

INFO: PRVG-1101 : SCAN name "rac-scanip" failed to resolve INFO: ERROR:

INFO: PRVF-4657 : Name resolution setup check for "rac-scanip" (IP address: 10.10.1.100) failed INFO: ERROR:

INFO: PRVF-4664 : Found inconsistent name resolution entries for SCAN name "rac-scanip"

INFO: Verification of SCAN VIP and Listener setup failed

如果没有配置DNS但是为了能够安装RAC Grid,需要手工配置使能解析, Gird Infrustructure 安装软件中,为了引入了SCANSingle Client Access Name)的特性,该特性的好处在于,在数据库与客户端之间,添加了一层虚拟的服务层,就是所谓的scan ip以及scan ip listener,在客户端仅需要配置scan iptns信息,通过scan ip listener,连接后台集群数据库。这样,不论集群数据库是否有添加或者删除节点的操作,均不会对client产生影响。官方推荐scan ip解析有3个,且需要做dns做解析。但目前环境一个scan ip也能满足系统运行的需求且不需要配置专门的DNS服务器做解析,只用在/etc/hosts文件中加入相关解析条目即可。由于在Grid的安装过程中无法成功解析rac-scan的地址,所以需要手动指定解析内容。在oracle1节点上配置nslookup解析:

#mv/usr/bin/nslookup /usr/bin/nslookup.original

# vi /usr/bin/nslookup

nslookup脚本中添加一下内容:

#!/bin/bash

HOSTNAME=${1}

if [[ $HOSTNAME = "oracle-scan" ]]; then

echo "Server:         192.168.10.11"

echo "Address:        192.168.10.11 #53"

echo "Non-authoritative answer:"

echo "Name:   scanip"

echo "Address: 192.168.10.6 "

else

   /usr/bin/nslookup.original $HOSTNAME

fi

修改nslookup脚本权限

# chmod 755 /usr/bin/nslookup

# nslookup oracle-scan

oracle2节点上也需要配置nslookup解析

#mv/usr/bin/nslookup /usr/bin/nslookup.original

# vi /usr/bin/nslookup

nslookup脚本中添加一下内容

#!/bin/bash

HOSTNAME=${1}

if [[ $HOSTNAME = "oracle-scan" ]]; then

echo "Server:         192.168.10.11"

echo "Address:        192.168.10.11 #53"

echo "Non-authoritative answer:"

echo "Name:   scanip"

echo "Address: 192.168.10.6 "

else

   /usr/bin/nslookup.original $HOSTNAME

fi

修改nslookup脚本权限:

# chmod 755 /usr/bin/nslookup

# nslookup oracle-scan

2.    创建用户组和安装目录

                                          i.          创建用户

2 个节点上创建集群软件安装用户 grid 和数据库软件安装用户 oracle

        # groupadd -g 54321 oinstall

        groupadd -g 54322 dba

        groupadd -g 54323 oper

        groupadd -g 54324 backupdba

        groupadd -g 54325 asmdba

        groupadd -g 54326 dgdba

        groupadd -g 54327 kmdba

        groupadd -g 54328 asmadmin

        groupadd -g 54329 asmoper  

        useradd -u 54321 -g oinstall -G dba,oper,asmdba oracle

        usermod -u 54321 -g oinstall -G dba,oper,asmdba oracle

        useradd -u 54322 -g oinstall -G dba,asmadmin,asmdba,asmoper grid

        usermod -u 54322 -g oinstall -G dba,asmadmin,asmdba,asmoper grid

        # passwd grid

# passwd oracle

                                        ii.     创建目录

2 个节点上创建安装目录:

mkdir -p /u01/app/grid

mkdir -p /u01/app/12.1.0/grid

chown -R grid:oinstall /u01

mkdir -p /u01/app/oracle

chown oracle:oinstall /u01/app/oracle

chmod -R 775 /u01

                                       iii.     配置用户环境变量

配置 grid 用户环境变量:

登录主机 oracle1 grid 用户配置环境变量:

# su - grid

$ vi /home/grid/.bash_profile

.bash_profile 文件末尾加上以下内容:(注意,红色字体是在oracle1 oracle2 上是不一样的!!!)

ORACLE_SID=+ASM1; export ORACLE_SID

ORACLE_BASE=/u01/app/grid; export ORACLE_BASE

ORACLE_HOME=/u01/app/12.1.0/grid; export ORACLE_HOME

JAVA_HOME=$ORACLE_HOME/jdk; export JAVA_HOME

ORACLE_PATH=/u01/app/oracle/common/oracle/sql; export ORACLE_PATH

ORACLE_TERM=xterm; export ORACLE_TERM

NLS_DATE_FORMAT="DD-MON-YYYY HH24:MI:SS"; export NLS_DATE_FORMAT

TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN

ORA_NLS11=$ORACLE_HOME/nls/data; export ORA_NLS11

PATH=.:${JAVA_HOME}/bin:${PATH}:$HOME/bin:$ORACLE_HOME/bin

PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin

PATH=${PATH}:/u01/app/common/oracle/bin

export PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib

LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib

LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib

export LD_LIBRARY_PATH

CLASSPATH=$ORACLE_HOME/JRE

CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib

CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib

CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib

export CLASSPATH

THREADS_FLAG=native; export THREADS_FLAG

export TEMP=/tmp

export TMPDIR=/tmp

umask 022

ulimit -t unlimited

ulimit -f unlimited

ulimit -d unlimited

ulimit -s unlimited

ulimit -v unlimited

if [ -t 0 ]; then

stty intr ^C

fi

登录主机 oracle2 grid 用户配置环境变量:

# su - grid

$ vi /home/grid/.bash_profile

.bash_profile 文件末尾加上以下内容:(注意,红色字体是在oracle1 oracle2 上是不一样的!!!)

ORACLE_SID=+ASM2; export ORACLE_SID

ORACLE_BASE=/u01/app/grid; export ORACLE_BASE

ORACLE_HOME=/u01/app/12.1.0/grid; export ORACLE_HOME

JAVA_HOME=$ORACLE_HOME/jdk; export JAVA_HOME

ORACLE_PATH=/u01/app/oracle/common/oracle/sql; export ORACLE_PATH

ORACLE_TERM=xterm; export ORACLE_TERM

NLS_DATE_FORMAT="DD-MON-YYYY HH24:MI:SS"; export NLS_DATE_FORMAT

TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN

ORA_NLS11=$ORACLE_HOME/nls/data; export ORA_NLS11

PATH=.:${JAVA_HOME}/bin:${PATH}:$HOME/bin:$ORACLE_HOME/bin

PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin

PATH=${PATH}:/u01/app/common/oracle/bin

export PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib

LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib

LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib

export LD_LIBRARY_PATH

CLASSPATH=$ORACLE_HOME/JRE

CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib

CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib

CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib

export CLASSPATH

THREADS_FLAG=native; export THREADS_FLAG

export TEMP=/tmp

export TMPDIR=/tmp

umask 022

ulimit -t unlimited

ulimit -f unlimited

ulimit -d unlimited

ulimit -s unlimited

ulimit -v unlimited

if [ -t 0 ]; then     

stty intr ^C

fi

登录主机 oracle1 oracle 用户配置环境变量:

# su - oracle

$ $ vi /home/oracle/.bash_profile

.bash_profile 文件末尾加上以下内容:(注意,红色字体是oracle1 oracle2 不一样的)

ORACLE_SID=oracle1; export ORACLE_SID

ORACLE_UNQNAME=occoracle; export ORACLE_UNQNAME

ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE

ORACLE_HOME=$ORACLE_BASE/product/12.1.0/dbhome; export ORACLE_HOME

JAVA_HOME=$ORACLE_HOME/jdk; export JAVA_HOME

ORACLE_PATH=/u01/app/common/oracle/sql; export ORACLE_PATH

ORACLE_TERM=xterm; export ORACLE_TERM

NLS_DATE_FORMAT="DD-MON-YYYY HH24:MI:SS"; export NLS_DATE_FORMAT

TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN

ORA_NLS11=$ORACLE_HOME/nls/data; export ORA_NLS11

PATH=.:${JAVA_HOME}/bin:${PATH}:$HOME/bin:$ORACLE_HOME/bin

PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin

PATH=${PATH}:/u01/app/common/oracle/bin

export PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib

LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib

LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib

export LD_LIBRARY_PATH

CLASSPATH=$ORACLE_HOME/JRE

CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib

CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib

CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib

export CLASSPATH

THREADS_FLAG=native; export THREADS_FLAG

export TEMP=/tmp

export TMPDIR=/tmp

umask 022

stty erase ^H

登录主机 oracle2 oracle 用户配置环境变量:

# su - oracle

$ $ vi /home/oracle/.bash_profile

.bash_profile 文件末尾加上以下内容:(注意,红色字体是oracle1 oracle2 不一样的)

ORACLE_SID=oracle2; export ORACLE_SID

ORACLE_UNQNAME=occoracle; export ORACLE_UNQNAME

ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE

ORACLE_HOME=$ORACLE_BASE/product/12.1.0/dbhome; export ORACLE_HOME

JAVA_HOME=$ORACLE_HOME/jdk; export JAVA_HOME

ORACLE_PATH=/u01/app/common/oracle/sql; export ORACLE_PATH

ORACLE_TERM=xterm; export ORACLE_TERM

NLS_DATE_FORMAT="DD-MON-YYYY HH24:MI:SS"; export NLS_DATE_FORMAT

TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN

ORA_NLS11=$ORACLE_HOME/nls/data; export ORA_NLS11

PATH=.:${JAVA_HOME}/bin:${PATH}:$HOME/bin:$ORACLE_HOME/bin

PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin

PATH=${PATH}:/u01/app/common/oracle/bin

export PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib

LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib

LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib

export LD_LIBRARY_PATH

CLASSPATH=$ORACLE_HOME/JRE

CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib

CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib

CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib

export CLASSPATH

THREADS_FLAG=native; export THREADS_FLAG

export TEMP=/tmp

export TMPDIR=/tmp

umask 022

stty erase ^H

                                       iv.     建立节点间信任关系

grid安装包中包含sshUserSetup.sh脚本,该脚本位于/grid/sshsetup可用于配置用户信任连接,用oracle自带的ssh脚本配置互信

#/s01/grid/sshsetup/sshUserSetup.sh -user grid -hosts "oracle1 oracle2" -advanced -noPromptPassphrase

#/s01/grid/sshsetup/sshUserSetup.sh -user oracle -hosts "oracle1 oracle2" -advanced –noPromptPassphrase

 

可选:

/s01/grid/sshsetup/sshUserSetup.sh -user root -hosts "oracle1 oracle2" -advanced -noPromptPassphrase

完成后在所有节点上测试验证信任关系,用不用的用户gridoracle 登陆后分别执行:

ssh oracle1 date

ssh oracle2 date

ssh oracle1-private date

ssh oracle2-private date

3.    创建DNS

查看DNS 状态

[root@dns ~]# service named status

Redirecting to /bin/systemctl status  named.service

named.service - Berkeley Internet Name Domain (DNS)

   Loaded: loaded (/usr/lib/systemd/system/named.service; enabled; vendor preset: disabled)

   Active: active (running) since Wed 2018-07-04 22:11:50 EDT; 29min ago

  Process: 2348 ExecStop=/bin/sh -c /usr/sbin/rndc stop > /dev/null 2>&1 || /bin/kill -TERM $MAINPID (code=exited, status=0/SUCCESS)

  Process: 1149 ExecReload=/bin/sh -c /usr/sbin/rndc reload > /dev/null 2>&1 || /bin/kill -HUP $MAINPID (code=exited, status=0/SUCCESS)

  Process: 2358 ExecStart=/usr/sbin/named -u named $OPTIONS (code=exited, status=0/SUCCESS)

  Process: 2356 ExecStartPre=/bin/bash -c if [ ! "$DISABLE_ZONE_CHECKING" == "yes" ]; then /usr/sbin/named-checkconf -z /etc/named.conf; else echo "Checking of zone files is disabled"; fi (code=exited, status=0/SUCCESS)

 Main PID: 2360 (named)

   CGroup: /system.slice/named.service

           └─2360 /usr/sbin/named -u named

 

Jul 04 22:28:05 dns.rac.occ named[2360]: error (network unreachable) resolving 'LIS...53

Jul 04 22:28:09 dns.rac.occ named[2360]: error (network unreachable) resolving './N...53

Jul 04 22:28:09 dns.rac.occ named[2360]: error (network unreachable) resolving './N...53

Jul 04 22:28:09 dns.rac.occ named[2360]: error (network unreachable) resolving 'LIS...53

Jul 04 22:28:09 dns.rac.occ named[2360]: error (network unreachable) resolving 'LIS...53

Jul 04 22:28:09 dns.rac.occ named[2360]: error (network unreachable) resolving './N...53

Jul 04 22:28:09 dns.rac.occ named[2360]: error (network unreachable) resolving 'LIS...53

Jul 04 22:28:09 dns.rac.occ named[2360]: error (network unreachable) resolving 'LIS...53

Jul 04 22:28:09 dns.rac.occ named[2360]: error (network unreachable) resolving 'LIS...53

Jul 04 22:28:09 dns.rac.occ named[2360]: error (network unreachable) resolving 'LIS...53

Hint: Some lines were ellipsized, use -l to show in full.

[root@dns ~]#

 

将网络域名设置为

hostnamectl set-hostname dns.rac.occ

修改DNS服务器配置

vim /etc/named.conf

options {

        listen-on port 53 {127.0.0.1;127.0.0.1;127.0.0.1;127.0.0.1;127.0.0.1;127.0.0.1;127.0.0.1;127.0.0.1;127.0.0.1;127.0.0.1;127.0.0.1;127.0.0.1; 192.168.10.254; };

allow-query     { any; };

注意到最下边:

include "/etc/named.rfc1912.zones";

因此,打开,增加如下:

vim /etc/named.rfc1912.zones

zone "rac.occ" IN {

        type master;

        file "rac.occ.zone";

        allow-update { none; };

};

 

zone "10.168.192.in-addr.arpa." IN {

        type master;

        file "10.168.192.in-addr.arpa";

        allow-update { none; };

};

再次编辑正向解析(rac.occ.zone)和逆向解析(10.168.192.in-addr.arpa

[root@dns /]# vim /var/named/rac.occ.zone

$TTL 86400

@ IN SOA  dns.rac.occ. admin.rac.occ (

                                        42

                                        3H

                                        15M

                                        1W

                                        1D )

                IN NS           dns.rac.occ.

localhost       IN A            127.0.0.1

dns             IN A       192.168.10.254

oracle1            IN A    192.168.10.101

oracle2            IN A    192.168.10.102

oracle1-private    IN A    192.168.100.101

oracle2-private    IN A    192.168.100.102

oracle1-vip        IN A    192.168.10.111

oracle2-vip        IN A    192.168.10.112

oracle-scan        IN A    192.168.10.6

oracle-scan        IN A    192.168.10.7

oracle-scan        IN A    192.168.10.8

 

 

[root@dns /]# vim /var/named/10.168.192.in-addr.arpa

$ORIGIN 10.168.192.in-addr.arpa.

$TTL 1H

@       IN      SOA     dns.rac.occ.    admin.rac.occ (      2

                                                3H

                                                1H

                                                1W

                                                1H )

10.168.192.in-addr.arpa.         IN NS      dns.rac.occ.

254     IN PTR  dns.

101     IN PTR  oracle1.

102     IN PTR  oracle2.

111     IN PTR  oracle1-vip.

112     IN PTR  oracle2-vip.

6     IN PTR  oracle-scan.

7     IN PTR  oracle-scan.

8     IN PTR  oracle-scan.

重启DNS

service named restart

DNS设置为开机启动

systemctl enable named

将所有nodepublic 网卡的DNS都指向这个DNS服务器。配置搜索域为:rac.occ.网卡自动创建/etc/resolv.conf

本机用nmtui配置网卡程序自动创建的为:

[root@oracle1 network-scripts]# vim /etc/resolv.conf

# Generated by NetworkManager

search rac.occ

nameserver 192.168.10.254

也有网友说应该是下面这个:

在所有节点的/etc/resolv.conf 文件中添加如下内容:

[root@rac2 /]# cat /etc/resolv.conf

domain cndba.cn

nameserver 192.168.56.200

options rotate 

options timeout:2 

options attempts:5 

 domainsearch不可以同时使用。详见网上的说明。

节点oracle1域名验证

[root@oracle1 network-scripts]# nslookup oracle1

Server:         192.168.10.254

Address:        192.168.10.254#53

 

Name:   oracle1.rac.occ

Address: 192.168.10.101

 

[root@oracle1 network-scripts]# nslookup oracle1.rac.occ

Server:         192.168.10.254

Address:        192.168.10.254#53

 

Name:   oracle1.rac.occ

Address: 192.168.10.101

 

[root@oracle1 network-scripts]# nslookup oracle-scan.rac.occ

Server:         192.168.10.254

Address:        192.168.10.254#53

 

Name:   oracle-scan.rac.occ

Address: 192.168.10.6

Name:   oracle-scan.rac.occ

Address: 192.168.10.7

Name:   oracle-scan.rac.occ

Address: 192.168.10.8

RAC需要的3SCAN IP地址192.168.10.6~8均得到了有效的解析

 

名词解释:

完整主机名(FQDN)Fully Qualified Domain Name

正解:从主机名查询到IP的流程

反解:从IP反解析到主机名的流程

区域:每个领域的记录

SOAStart of Authority):,开始验证

NSNameServer:名称服务器

A(Address): 地址

 

 

 

4.    安装

用于Oracle Linux发行版和Oracle RDBMS发行版的Oracle RPM会自动安装Oracle Grid InfrastructureOracle Database所需的任何其他软件包, 并自动配置您的服务器操作系统, 包括设置内核参数和安装的其他基本操作系统要求.

yum install oracle-rdbms-server-12cR1-preinstall

oracle1 oracle2 重复上述过程。

5.    安装前检查

从下述网址下载Cluster Verification Utility (CVU) 工具

http://www.oracle.com/technetwork/database/options/clustering/downloads/index.html

解压到/tmp/cv路径

查看、临时、永久 关闭Redhat 7 的防火墙

setenforce 0

systemctl status firewalld

systemctl stop firewalld

systemctl disable firewalld

systemctl status firewalld

 

vim /etc/selinux/config

 

检查网络环境

su – grid

/tmp/cv/bin/cluvfy stage -post hwos -n oracle1,oracle2 -verbose

 

添加静态路由

#route –n

#

route add -net 224.0.0.0 gw 192.168.10.2 netmask 240.0.0.0 dev enp0s3

 

route add -net 224.0.0.0 gw 192.168.100.2 netmask 240.0.0.0 dev enp0s8

 

route add -net 224.0.0.0 gw 192.168.56.1 netmask 240.0.0.0 dev enp0s9

 

route add -net 224.0.0.0 gw 10.0.5.2 netmask 240.0.0.0 dev enp0s10

 

结果:

[grid@oracle1 ~]$ route -n

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

0.0.0.0         10.0.5.2        0.0.0.0         UG    100    0        0 enp0s10

0.0.0.0         192.168.10.2    0.0.0.0         UG    101    0        0 enp0s3

0.0.0.0         192.168.100.2   0.0.0.0         UG    102    0        0 enp0s8

0.0.0.0         192.168.56.1    0.0.0.0         UG    103    0        0 enp0s9

10.0.5.0        0.0.0.0         255.255.255.0   U     100    0        0 enp0s10

192.168.10.0    0.0.0.0         255.255.255.0   U     100    0        0 enp0s3

192.168.56.0    0.0.0.0         255.255.255.0   U     100    0        0 enp0s9

192.168.100.0   0.0.0.0         255.255.255.0   U     100    0        0 enp0s8

224.0.0.0       10.0.5.2        240.0.0.0       UG    0      0        0 enp0s10

224.0.0.0       192.168.56.1    240.0.0.0       UG    0      0        0 enp0s9

224.0.0.0       192.168.100.2   240.0.0.0       UG    0      0        0 enp0s8

224.0.0.0       192.168.10.2    240.0.0.0       UG    0      0        0 enp0s3

执行

/tmp/cv/bin/cluvfy stage -pre crsinst -n "oracle1,oracle2" -r 12.1 -fixup –verbose

6.    安装集群GRID

 

 

 

其他设置

7.    RAC 没有配置remote_listener导致无法通过scan-ip登录数据库

SQL> show parameter remote_listener

查看scan iplistener,发现没有提供服务。(注意RAC dblistener配置文件在grid用户下

lsnrctl status LISTENER_SCAN1

SQL> alter system set remote_listener='trade34-scan:1521' scope=both sid='*';

SQL> alter system register;

SQL> show parameter remote_listener

NAME TYPE VALUE

----------------------------------

 lsnrctl status LISTENER_SCAN1

8.    防止密码过期,

应更改默认配置文件。 更改密码生存期如下:

[oracle@dns ~]$ sqlplus SYSTEM/password@occorcl

SQL*Plus: Release 12.1.0.2.0 Production on Fri Jul 6 22:49:03 2018

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

Last Successful login time: Fri Jul 06 2018 07:17:30 -04:00

Connected to:

Oracle Database 12c Standard Edition Release 12.1.0.2.0 - 64bit Production

With the Real Application Clusters and Automatic Storage Management options

SQL> alter profile default limit password_life_time unlimited;

Profile altered.

SQL>

9.    提高RAC切换响应速度

使用Linux时,两个Oracle数据库之间的切换可能需要相对较长的时间。 要提高性能,必须更改两个RAC节点服务器的/etc/sysctl.conf配置文件。 必须root用户将条目net.ipv4.tcp_retries2=15的默认值15更改为值2

net.ipv4.tcp_retries2 = 15

在丢弃激活(已建立通讯状况)TCP连接之前﹐需要进行多少次重试。默认值为15,根据RTO的值来决定,相当于13-30分钟。RFC1122规定,必须大于100秒。这个值根据目前的网络设置,可以适当地改小,我的网络内修改为了2

之后,必须调用命令“sysctl -p”以应用更改。

[root@oracle1 ~]# vim /etc/sysctl.conf

net.ipv4.tcp_retries2 = 2

10. 配置客户端tnsnames.ora

以下适用于无DNS , /etc/hosts解析,SCAN IP1个的情形。

oracleroot用户进入目录/u01/app/oracle/product/12.1.0/db/network/admin/

建立一个或多个TNS的连接名。本例建立了两个连接名称oracle-scanoccorcl均指向同一个服务器。每个TNS名称可以有不同的配置的连接属性。

[root@dns admin]# vim tnsnames.ora

oracle-scan =

  (DESCRIPTION =

    (ENABLE=BROKEN) #防止断线中断

    (ADDRESS_LIST =

      (ADDRESS = (PROTOCOL = TCP)(HOST = oracle-scan)(PORT = 1521)) #服务器地址信息

    )

    (CONNECT_DATA =

      (SERVER = DEDICATED) #一般情况,服务器设置为专用服务器的模式。

        (SERVICE_NAME=occorcl) #Service Name,服务名称

     # (SID = occorcl) # 弃用SID连接

    )

  )

occorcl=

  (DESCRIPTION =

    (ENABLE=BROKEN)

    (ADDRESS_LIST =

      (ADDRESS = (PROTOCOL = TCP)(HOST = oracle-scan)(PORT = 1521))

    )

    (CONNECT_DATA =

      (SERVER = DEDICATED)

        (SERVICE_NAME=occorcl)

    #  (SID = occorcl)

    )

  )

此目录下新建一个sqlnet.ora文件,不写任何内容,或仅写一个“#”保存。

[root@dns admin]# vim sqlnet.ora

#