前言
本文将演示如何使用脚本一键安装 Oracle 19C RAC 3 节点数据库的全过程。
安装前准备
在生产环境中,Linux 操作系统和网络一般不是由 DBA 来配置,为了更贴合生产使用,本脚本仅用于安装 Oracle 数据库,请提前安装好 Linux 操作系统。
环境信息
主机版本 | 主机内存 | 磁盘空间 | 数据库版本 | PSU补丁版本 | OJVM补丁版本 | OPatch补丁版本 |
---|---|---|---|---|---|---|
Centos7.6 | 32G | 115G | 19C | 33509923 | 33808367 | 11.2.0.3.34 |
IP 规划(所有节点)
节点 | PubIP | PrivIP | VirIPI | SCANIP |
---|---|---|---|---|
1 | 193.1.3.1 | 1.1.1.1 | 193.1.3.4 | 193.1.3.10 |
2 | 193.1.3.2 | 1.1.1.2 | 193.1.3.5 | 193.1.3.10 |
3 | 193.1.3.3 | 1.1.1.3 | 193.1.3.6 | 193.1.3.10 |
## 节点一
[root@luciferdb03:/soft]# nmcli connection show
NAME UUID TYPE DEVICE
eth0 5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03 ethernet eth0
eth1 658ca23d-769c-4a6f-a541-c236a412224d ethernet eth1
[root@luciferdb03:/soft]# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 193.1.3.1 netmask 255.255.255.0 broadcast 193.1.3.255
inet6 fe80::eda:41ff:fe1d:ed3f prefixlen 64 scopeid 0x20<link>
ether 0c:da:41:1d:ed:3f txqueuelen 1000 (Ethernet)
RX packets 48758 bytes 9657994 (9.2 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 43755 bytes 9826085 (9.3 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 1.1.1.1 netmask 255.255.255.0 broadcast 1.1.1.255
inet6 fe80::eda:41ff:fe1d:f204 prefixlen 64 scopeid 0x20<link>
ether 0c:da:41:1d:f2:04 txqueuelen 1000 (Ethernet)
RX packets 10229514 bytes 15316863202 (14.2 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 4215800 bytes 7159447755 (6.6 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
## 节点二
[root@luciferdb04:~]# nmcli connection show
NAME UUID TYPE DEVICE
eth0 5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03 ethernet eth0
eth1 a8df8168-4427-4d8f-a472-da212e2d5a09 ethernet eth1
[root@luciferdb04:~]# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 193.1.3.2 netmask 255.255.255.0 broadcast 193.1.3.255
inet6 fe80::eda:41ff:fe1d:ae3c prefixlen 64 scopeid 0x20<link>
ether 0c:da:41:1d:ae:3c txqueuelen 1000 (Ethernet)
RX packets 43103 bytes 8675612 (8.2 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 38950 bytes 8375054 (7.9 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 1.1.1.2 netmask 255.255.255.0 broadcast 1.1.1.255
inet6 fe80::eda:41ff:fe1d:9aed prefixlen 64 scopeid 0x20<link>
ether 0c:da:41:1d:9a:ed txqueuelen 1000 (Ethernet)
RX packets 10615410 bytes 11308390297 (10.5 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 4025025 bytes 16239792705 (15.1 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
## 节点三
[root@luciferdb05:~]# nmcli connection show
NAME UUID TYPE DEVICE
eth0 5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03 ethernet eth0
eth1 d6366244-2ef8-4e15-883e-4b12637f0dd2 ethernet eth1
[root@luciferdb05:~]# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 193.1.3.3 netmask 255.255.255.0 broadcast 193.1.3.255
inet6 fe80::eda:41ff:fe1d:f8b3 prefixlen 64 scopeid 0x20<link>
ether 0c:da:41:1d:f8:b3 txqueuelen 1000 (Ethernet)
RX packets 68256 bytes 16712778 (15.9 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 71805 bytes 16199787 (15.4 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 1.1.1.3 netmask 255.255.255.0 broadcast 1.1.1.255
inet6 fe80::eda:41ff:fe1d:765e prefixlen 64 scopeid 0x20<link>
ether 0c:da:41:1d:76:5e txqueuelen 1000 (Ethernet)
RX packets 9480723 bytes 10379158024 (9.6 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 3423761 bytes 12959390768 (12.0 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
在执行脚本之前,必须提前配置好 Public
和 Private
地址。
ASM 磁盘规划(所有节点)
磁盘组 | 设备名称 | 数量 | 大小 | 冗余度 | 配置方式 |
---|---|---|---|---|---|
OCR | /dev/sdd,/dev/sde,/dev/sdf | 3 | 10G | NORMAL | multipath udev |
DATA | /dev/sdb,/dev/sdc | 2 | 60G | EXTERNAL | multipath udev |
ARCH | /dev/sda | 1 | 50G | EXTERNAL | multipath udev |
## 节点一
[root@luciferdb03:/soft]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
fd0 2:0 1 4K 0 disk
sda 8:0 0 50G 0 disk
sdb 8:16 0 60G 0 disk
sdc 8:32 0 70G 0 disk
sdd 8:48 0 10G 0 disk
sde 8:64 0 10G 0 disk
sdf 8:80 0 10G 0 disk
sr0 11:0 1 10G 0 rom
vda 252:0 0 128G 0 disk
├─vda1 252:1 0 1G 0 part /boot
└─vda2 252:2 0 127G 0 part
├─centos-root 253:0 0 114.1G 0 lvm /
└─centos-swap 253:1 0 7.9G 0 lvm [SWAP]
loop0 7:0 0 10G 0 loop /mnt
## 节点二
[root@luciferdb04:~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
fd0 2:0 1 4K 0 disk
sda 8:0 0 50G 0 disk
sdb 8:16 0 60G 0 disk
sdc 8:32 0 70G 0 disk
sdd 8:48 0 10G 0 disk
sde 8:64 0 10G 0 disk
sdf 8:80 0 10G 0 disk
sr0 11:0 1 10G 0 rom
vda 252:0 0 128G 0 disk
├─vda1 252:1 0 1G 0 part /boot
└─vda2 252:2 0 127G 0 part
├─centos-root 253:0 0 114.1G 0 lvm /
└─centos-swap 253:1 0 7.9G 0 lvm [SWAP]
## 节点三
[root@luciferdb05:~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
fd0 2:0 1 4K 0 disk
sda 8:0 0 50G 0 disk
sdb 8:16 0 60G 0 disk
sdc 8:32 0 70G 0 disk
sdd 8:48 0 10G 0 disk
sde 8:64 0 10G 0 disk
sdf 8:80 0 10G 0 disk
sr0 11:0 1 10G 0 rom
vda 252:0 0 128G 0 disk
├─vda1 252:1 0 1G 0 part /boot
└─vda2 252:2 0 127G 0 part
├─centos-root 253:0 0 114.1G 0 lvm /
└─centos-swap 253:1 0 7.9G 0 lvm [SWAP]
在执行脚本之前,必须提前挂载好共享存储,脚本会自动配置多路径和udev。
上传介质(节点一)
首先,使用 ssh
工具连接到节点一 Linux 主机,创建一个存放安装介质的目录,比如:mkdir /soft
,然后上传安装所需的介质!