本文將演示如何使用腳本一鍵安裝 Oracle 19C RAC 3 節(jié)點數(shù)據(jù)庫的全過程。
在生產(chǎn)環(huán)境中,Linux 操作系統(tǒng)和網(wǎng)絡(luò)一般不是由 DBA 來配置,為了更貼合生產(chǎn)使用,本腳本僅用于安裝 Oracle 數(shù)據(jù)庫,請?zhí)崆鞍惭b好 Linux 操作系統(tǒng)。
主機版本 | 主機內(nèi)存 | 磁盤空間 | 數(shù)據(jù)庫版本 | PSU補丁版本 | OJVM補丁版本 | OPatch補丁版本 |
---|---|---|---|---|---|---|
Centos7.6 | 32G | 115G | 19C | 33509923 | 33808367 | 11.2.0.3.34 |
節(jié)點 | 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 |
## 節(jié)點一
[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
## 節(jié)點二
[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
## 節(jié)點三
[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
在執(zhí)行腳本之前,必須提前配置好 Public
和 Private
地址。
磁盤組 | 設(shè)備名稱 | 數(shù)量 | 大小 | 冗余度 | 配置方式 |
---|---|---|---|---|---|
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 |
## 節(jié)點一
[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
## 節(jié)點二
[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]
## 節(jié)點三
[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]
在執(zhí)行腳本之前,必須提前掛載好共享存儲,腳本會自動配置多路徑和udev。
首先,使用 ssh
工具連接到節(jié)點一 Linux 主機,創(chuàng)建一個存放安裝介質(zhì)的目錄,比如:mkdir /soft
,然后上傳安裝所需的介質(zhì)!
📢 注意:
[root@luciferdb03:/soft]# du -sh *
11G CentOS-7-x86_64-Athena-1904.iso ## 操作系統(tǒng)鏡像
2.9G LINUX.X64_193000_db_home.zip ## 19C Grid 安裝包
2.7G LINUX.X64_193000_grid_home.zip ## 19C Database 安裝包
160K OracleShellInstall ## 一鍵安裝腳本
2.5G p33509923_190000_Linux-x86-64.zip ## 19C Grid PSU 補丁
120M p33808367_190000_Linux-x86-64.zip ## 19C DB OJVM 補丁
119M p6880880_190000_Linux-x86-64.zip ## 19C OPatch 補丁
276K rlwrap-0.42.tar.gz ## 優(yōu)化 sqlplus、rman 的翻頁小插件
上傳好以上安裝介質(zhì)就完成了第一步?。
安裝 Oracle 數(shù)據(jù)庫需要安裝一些 rpm 的依賴包,需要使用 yum
命令來安裝,這就需要掛載 ISO 鏡像來配置本地 YUM 源:
mount -o loop /soft/CentOS-7-x86_64-Athena-1904.iso /mnt
這里只需要執(zhí)行 mount 命令掛載到 /mnt
目錄下即可,配置好本地 YUM 源后,腳本里會自動配置 repo,執(zhí)行 df -h | grep mnt
看到如下輸出即代表成功掛載:
[root@orcl soft]# df -h | grep mnt
/dev/loop0 11G 11G 0 100% /mnt
📢 注意:如果不掛載 ISO 執(zhí)行腳本,會提示:The iso file is not mounted on system
!
./OracleShellInstall -n luciferdb `# hostname prefix`\
-hn luciferdb03,luciferdb04,luciferdb05 `# rac node hostname`\
-cn luciferdb-cls `# cluster_name`\
-rp password `# root password`\
-gp oracle `# grid password`\
-op oracle `# oracle password`\
-lf eth0 `# local ip ifname`\
-pf eth1 `# rac private ip ifname`\
-ri 193.1.3.1,193.1.3.2,193.1.3.3 `# rac node public ip`\
-vi 193.1.3.4,193.1.3.5,193.1.3.6 `# rac virtual ip`\
-si 193.1.3.10 `# rac scan ip`\
-od /dev/sdd,/dev/sde,/dev/sdf `# rac ocr asm disk`\
-or NORMAL \
-dd /dev/sdb,/dev/sdc `# rac data asm disk`\
-ad /dev/sda `# rac arch asm disk`\
-o oradb `# dbname`\
-ds AL32UTF8 `# database character`\
-ns AL16UTF16 `# national character`\
-dp Oracle123Pwd `# sys/system password`\
-gpa 33509923 `# grid PSU/RU`\
-jpa 33808367 `# OJVM PSU/RU`\
-opd Y `# optimize db`
本文演示 3 節(jié)點安裝,整個安裝過程大概需要 90
分鐘左右,全程自動安裝建庫,不需要人工干預(yù),下面我們直接看視頻演示:
RAC:Oracle 19C 3 節(jié)點 數(shù)據(jù)庫一鍵安裝
RAC:Oracle 19C 3 節(jié)點 數(shù)據(jù)庫一鍵安裝
聯(lián)系客服