Oracle Enterprise Linux 6.4安装Oracle Database 12C RAC图文详

Oracle Database 12c发布也有一周了,这几天尝试了下单机、RESTART和RAC的安装,其中发生了不少趣事。比如安装Oracle 12c Restart花费了4小时多最终笔记本死机、RAC安装过程中采用HAIP特性却失败等等。

Oracle 12c RAC引入了Flex Cluster的概念,但我尚未研究成功。

下面是传统方式安装Oracle 12c RAC的教程。

环境介绍

OS: Oracle Enterprise Linux 6.4 (For RAC Nodes),Oracle Enterprise Linux 5.8(For DNS Server),Openfiler 2.3(For SAN Storage)

DB: GI and Database 12.1.0.1

所需介质

linuxamd64_12c_database_1of2.zip

linuxamd64_12c_database_2of2.zip

linuxamd64_12c_grid_1of2.zip

linuxamd64_12c_grid_2of2.zip

– 这里只给出Oracle相关的,操作系统以及其他软件请自身准备。

操作系统信息

RAC节点服务器:

(以node1节点为例)
[root@12crac1 ~]# cat /etc/RedHat-release
Red Hat Enterprise Linux Server release 6.4 (Santiago)

[root@12crac1 ~]# grep MemTotal /proc/meminfo
MemTotal:        2051748 kB

[root@12crac1 ~]# grep SwapTotal /proc/meminfo
SwapTotal:      5119996 kB

[root@12crac1 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda3              45G  16G  27G  38% /
tmpfs                2.0G  652M  1.4G  32% /dev/shm
/dev/sda1            194M  50M  135M  27% /boot

 

网络配置信息:

备注:从下面信息中可以发现,每个节点服务器我都添加了五个网卡,eth0用于PUBLIC,而eth1~eth4用于Private,本想采用HAIP特性。

但我在安装实验过程中HAIP特性上发生了节点2无法启动ASM实例的问题,因此最后只用了其中eth1接口。

至于HAIP导致的问题,可能是出于BUG,这个问题还有待仔细troubleshooting。

(节点1)
[root@12crac1 ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0C:29:75:36:ED 
          inet addr:192.168.1.150  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe75:36ed/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:64 errors:0 dropped:0 overruns:0 frame:0
          TX packets:56 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:7014 (6.8 KiB)  TX bytes:6193 (6.0 KiB)

eth1      Link encap:Ethernet  HWaddr 00:0C:29:75:36:F7 
          inet addr:192.168.80.150  Bcast:192.168.80.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe75:36f7/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:12 errors:0 dropped:0 overruns:0 frame:0
          TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:720 (720.0 b)  TX bytes:720 (720.0 b)

eth2      Link encap:Ethernet  HWaddr 00:0C:29:75:36:01 
          inet addr:192.168.80.151  Bcast:192.168.80.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe75:3601/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:9 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:540 (540.0 b)  TX bytes:636 (636.0 b)

eth3      Link encap:Ethernet  HWaddr 00:0C:29:75:36:0B 
          inet addr:192.168.80.152  Bcast:192.168.80.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe75:360b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:300 (300.0 b)  TX bytes:636 (636.0 b)

eth4      Link encap:Ethernet  HWaddr 00:0C:29:75:36:15 
          inet addr:192.168.80.153  Bcast:192.168.80.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe75:3615/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:60 (60.0 b)  TX bytes:566 (566.0 b)

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

(节点2)
[root@12crac2 ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0C:29:A1:81:7C 
          inet addr:192.168.1.151  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fea1:817c/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:126 errors:0 dropped:0 overruns:0 frame:0
          TX packets:62 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:10466 (10.2 KiB)  TX bytes:6193 (6.0 KiB)

eth1      Link encap:Ethernet  HWaddr 00:0C:29:A1:81:86 
          inet addr:192.168.80.154  Bcast:192.168.80.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fea1:8186/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:23 errors:0 dropped:0 overruns:0 frame:0
          TX packets:27 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2081 (2.0 KiB)  TX bytes:1622 (1.5 KiB)

eth2      Link encap:Ethernet  HWaddr 00:0C:29:A1:81:90 
          inet addr:192.168.80.155  Bcast:192.168.80.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fea1:8190/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:60 (60.0 b)  TX bytes:636 (636.0 b)

eth3      Link encap:Ethernet  HWaddr 00:0C:29:A1:81:9A 
          inet addr:192.168.80.156  Bcast:192.168.80.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

eth4      Link encap:Ethernet  HWaddr 00:0C:29:A1:81:A4 
          inet addr:192.168.80.157  Bcast:192.168.80.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

 

 

确认防火墙和SELinux是禁用的

(以Node1为例,两个节点相同)
[root@12crac1 ~]# iptables -L
Chain INPUT (policy ACCEPT)
target    prot opt source              destination       

Chain FORWARD (policy ACCEPT)
target    prot opt source              destination       

Chain OUTPUT (policy ACCEPT)
target    prot opt source              destination 

如果防火墙没禁用,那么通过如下方式修改:
[root@12crac1 ~]# service iptables stop
[root@12crac1 ~]# chkconfig iptables off

[root@12crac1 ~]# getenforce
Disabled

如果SELinux没有被禁止,那就通过如下方式修改:
[root@12crac1 ~]# cat /etc/selinux/config
-- 改成SELINUX=disabled
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#    enforcing - SELinux security policy is enforced.
#    permissive - SELinux prints warnings instead of enforcing.
#    disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
#    targeted - Targeted processes are protected,
#    mls - Multi Level Security protection.
SELINUXTYPE=targeted

 

DNS服务器:

[root@dns12c ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.8 (Tikanga)

[root@dns12c ~]# grep MemTotal /proc/meminfo
MemTotal:        494596 kB

[root@dns12c ~]# grep SwapTotal /proc/meminfo
SwapTotal:      3277252 kB

[root@dns12c ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0C:29:7A:FD:82 
          inet addr:192.168.1.158  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:114941 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6985 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:11015974 (10.5 MiB)  TX bytes:1151788 (1.0 MiB)

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:104 errors:0 dropped:0 overruns:0 frame:0
          TX packets:104 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:9531 (9.3 KiB)  TX bytes:9531 (9.3 KiB)

Iptables和SELinux也禁止。

 

SAN服务器:

Openfiler 2.3来部署的,在这里分配3个LUN,大小分别为5G和两个8G。

 

 

正式部署安装

1、配置DNS服务

以下操作在DNS服务器上进行:

安装bind三个包
[root@dns12c ~]# rpm -ivh /mnt/Server/bind-9.3.6-20.P1.el5.x86_64.rpm
[root@dns12c ~]# rpm -ivh /mnt/Server/bind-chroot-9.3.6-20.P1.el5.x86_64.rpm
[root@dns12c ~]# rpm -ivh /mnt/Server/caching-nameserver-9.3.6-20.P1.el5.x86_64.rpm

配置主区域
[root@dns12c ~]# cd /var/named/chroot/etc
[root@dns12c etc]# cp -p named.caching-nameserver.conf named.conf
[root@dns12c etc]# cat named.conf
options {
        listen-on port 53 { any; };
        listen-on-v6 port 53 { ::1; };
        directory      "/var/named";
        dump-file      "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        memstatistics-file "/var/named/data/named_mem_stats.txt";

        // Those options should be used carefully because they disable port
        // randomization
        // query-source    port 53;
        // query-source-v6 port 53;

 

nslookup或 dig检查

 

给两个节点配置DNS

(以Node1为例,两个节点相同)
[root@12crac1 ~]# cat /etc/resolv.conf
#domain localdomain
search localdomain
nameserver 192.168.1.158

 

测试:

[root@12crac1 ~]# nslookup 192.168.1.154
Server:        192.168.1.158
Address:        192.168.1.158#53

[root@12crac1 ~]# nslookup 192.168.1.155
Server:        192.168.1.158
Address:        192.168.1.158#53

[root@12crac1 ~]# nslookup 192.168.1.156
Server:        192.168.1.158
Address:        192.168.1.158#53

 

2、配置/etc/hosts

修改/etc/hosts文件,前两行不懂,添加hostname对应信息。

(以Node1为例,两个节点相同)
[root@12crac1 ~]# cat /etc/hosts
127.0.0.1  localhost localhost.localdomain localhost4 localhost4.localdomain4
::1        localhost localhost.localdomain localhost6 localhost6.localdomain6