前言
Oracle 一鍵安裝腳本,演示 openEuler 22.03 LTS SP3 一鍵安裝 Oracle 21C 單機(jī) ASM(21.14)過(guò)程(全程無(wú)需人工干預(yù))。
?? 腳本下載地址:Shell腳本安裝Oracle數(shù)據(jù)庫(kù)
安裝準(zhǔn)備
- 1、安裝好操作系統(tǒng),建議安裝圖形化
- 2、配置好網(wǎng)絡(luò)
- 3、掛載本地 ISO 鏡像源
- 4、上傳軟件安裝包(安裝基礎(chǔ)包,補(bǔ)丁包)
- 5、上傳一鍵安裝腳本:OracleShellInstall
環(huán)境信息
# 主機(jī)版本
[root@openeuler:/root]$ cat /etc/os-release
NAME="openEuler"
VERSION="22.03 (LTS-SP3)"
ID="openEuler"
VERSION_ID="22.03"
PRETTY_NAME="openEuler 22.03 (LTS-SP3)"
ANSI_COLOR="0;31"
# 網(wǎng)絡(luò)信息
[root@openeuler:/root]$ ip a
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 00:0c:29:51:f8:ca brd ff:ff:ff:ff:ff:ff
inet 192.168.6.130/24 brd 192.168.6.255 scope global noprefixroute ens33
valid_lft forever preferred_lft forever
inet6 fe80::6bae:9840:87e5:b777/64 scope link noprefixroute
valid_lft forever preferred_lft forever
# 掛載本地 ISO 鏡像
[root@openeuler:/root]$ mount | grep iso9660 | grep -v "/run/media"
/dev/sr0 on /mnt type iso9660 (ro,relatime,nojoliet,check=s,map=n,blocksize=2048,iocharset=utf8)
[root@openeuler:/root]$ df -h|grep /mnt
/dev/sr0 18G 18G 0 100% /mnt
# starwind 共享磁盤(pán)掛載(有存儲(chǔ)就不需要使用 starwind,直接存儲(chǔ)上劃盤(pán)掛載就可)
yum install -y iscsi-initiator-utils*
systemctl start iscsid.service
systemctl enable iscsid.service
iscsiadm -m discovery -t st -p 192.168.6.188
## 掛載 ASM 磁盤(pán)
iscsiadm -m node -T iqn.2008-08.com.starwindsoftware:192.168.6.188-lucifer -p 192.168.6.188 -l
## 配置開(kāi)機(jī)自動(dòng)掛載
iscsiadm -m node -T iqn.2008-08.com.starwindsoftware:192.168.6.188-lucifer -p 192.168.6.188 --op update -n node.startup -v automatic
[root@openeuler ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 100G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 99G 0 part
├─openeuler-root 253:0 0 91G 0 lvm /
└─openeuler-swap 253:1 0 8G 0 lvm [SWAP]
sdb 8:16 0 10G 0 disk
sdc 8:32 0 50G 0 disk
sr0 11:0 1 17.1G 0 rom /mnt
# 安裝包存放在 /soft 目錄下
[root@openeuler soft]# ll
-rwx------. 1 root root 3109225519 Mar 29 15:43 LINUX.X64_213000_db_home.zip
-rwx------. 1 root root 2422217613 Mar 29 15:42 LINUX.X64_213000_grid_home.zip
-rwxr-xr-x. 1 root root 201856 Mar 29 15:41 OracleShellInstall
-rwx------. 1 root root 2044000163 Mar 29 15:42 p36352207_210000_Linux-x86-64.zip
-rwx------. 1 root root 127629034 Mar 29 15:41 p6880880_210000_Linux-x86-64.zip
-rwx------. 1 root root 321590 Mar 20 13:58 rlwrap-0.44.tar.gz
確保安裝環(huán)境準(zhǔn)備完成后,即可執(zhí)行一鍵安裝。
安裝命令
使用標(biāo)準(zhǔn)生產(chǎn)環(huán)境安裝參數(shù)(安裝過(guò)程若失敗,腳本支持重復(fù)執(zhí)行安裝):
# 根據(jù)腳本 README 或者 -h 命令提示,編輯好一鍵安裝命令,進(jìn)入 /soft 目錄執(zhí)行安裝:
./OracleShellInstall -n openeuler `# hostname prefix`\
-gp oracle `# grid password`\
-op oracle `# oracle password`\
-lf ens33 `# local ip ifname`\
-dd /dev/sdc `# rac data asm disk`\
-o lucifer `# dbname`\
-ds AL32UTF8 `# database character`\
-ns AL16UTF16 `# national character`\
-redo 100 `# redo size`\
-dp oracle `# sys/system password`\
-gpa 36352207 `# grid PSU/RU`\
-opd Y `# optimize db`
安裝過(guò)程
███████ ██ ████████ ██ ██ ██ ██ ██ ██ ██
██?????██ ?██ ██?????? ?██ ?██ ?██?██ ?██ ?██ ?██
██ ??██ ██████ ██████ █████ ?██ █████ ?██ ?██ █████ ?██ ?██?██ ███████ ██████ ██████ ██████ ?██ ?██
?██ ?██??██??█ ??????██ ██???██ ?██ ██???██?█████████?██████ ██???██ ?██ ?██?██??██???██ ██???? ???██? ??????██ ?██ ?██
?██ ?██ ?██ ? ███████ ?██ ?? ?██?███████????????██?██???██?███████ ?██ ?██?██ ?██ ?██??█████ ?██ ███████ ?██ ?██
??██ ██ ?██ ██????██ ?██ ██ ?██?██???? ?██?██ ?██?██???? ?██ ?██?██ ?██ ?██ ?????██ ?██ ██????██ ?██ ?██
??███████ ?███ ??████████??█████ ███??██████ ████████ ?██ ?██??██████ ███ ███?██ ███ ?██ ██████ ??██ ??████████ ███ ███
??????? ??? ???????? ????? ??? ?????? ???????? ?? ?? ?????? ??? ??? ?? ??? ?? ?????? ?? ???????? ??? ???
注意:本腳本僅用于新服務(wù)器上實(shí)施部署數(shù)據(jù)庫(kù)使用,嚴(yán)禁在已運(yùn)行數(shù)據(jù)庫(kù)的主機(jī)上執(zhí)行,以免發(fā)生數(shù)據(jù)丟失或者損壞,造成不可挽回的損失!!!
請(qǐng)選擇安裝模式 [單機(jī)(si)/單機(jī)ASM(sa)/集群(rac)] : sa
數(shù)據(jù)庫(kù)安裝模式: standalone
請(qǐng)選擇數(shù)據(jù)庫(kù)版本 [11/12/19/21] : 21
數(shù)據(jù)庫(kù)版本: 21
OracleShellInstall 開(kāi)始安裝,詳細(xì)安裝過(guò)程可查看日志: tail -2000f /soft/print_ora_install_20240329154356.log
正在檢查操作系統(tǒng)是否符合安裝條件......已完成 (耗時(shí): 0 秒)
正在去除密碼復(fù)雜度配置......已完成 (耗時(shí): 2 秒)
正在配置 YUM 源......已完成 (耗時(shí): 1 秒)
正在獲取操作系統(tǒng)信息......已完成 (耗時(shí): 1 秒)
正在配置 Swap......已完成 (耗時(shí): 0 秒)
正在配置防火墻......已完成 (耗時(shí): 2 秒)
正在配置 selinux......已完成 (耗時(shí): 2 秒)
正在配置 nsyctl......已完成 (耗時(shí): 1 秒)
正在安裝依賴包......已完成 (耗時(shí): 221 秒)
正在配置主機(jī)名和 /etc/hosts......已完成 (耗時(shí): 1 秒)
正在創(chuàng)建用戶和組......已完成 (耗時(shí): 2 秒)
正在創(chuàng)建安裝目錄......已完成 (耗時(shí): 1 秒)
正在配置 Avahi-daemon 服務(wù)......已完成 (耗時(shí): 3 秒)
正在配置透明大頁(yè) && NUMA && 磁盤(pán) IO 調(diào)度器......已完成 (耗時(shí): 1 秒)
正在配置操作系統(tǒng)參數(shù) sysctl......已完成 (耗時(shí): 2 秒)
正在配置 RemoveIPC......已完成 (耗時(shí): 1 秒)
正在配置用戶限制 limit......已完成 (耗時(shí): 1 秒)
正在配置 shm 目錄......已完成 (耗時(shí): 1 秒)
正在安裝 rlwrap 插件......已完成 (耗時(shí): 21 秒)
正在配置用戶環(huán)境變量......已完成 (耗時(shí): 1 秒)
正在解壓 Grid 安裝包以及補(bǔ)丁......已完成 (耗時(shí): 203 秒)
正在解壓 Oracle 安裝包以及補(bǔ)丁......已完成 (耗時(shí): 182 秒)
正在安裝 Grid 軟件以及補(bǔ)丁......已完成 (耗時(shí): 2064 秒)
正在安裝 Oracle 軟件以及補(bǔ)丁......已完成 (耗時(shí): 1413 秒)
正在創(chuàng)建數(shù)據(jù)庫(kù)......已完成 (耗時(shí): 1538 秒)
正在優(yōu)化數(shù)據(jù)庫(kù)......已完成 (耗時(shí): 91 秒)
恭喜!Oracle 單機(jī) ASM 安裝成功 (耗時(shí): 5762 秒),現(xiàn)在是否重啟主機(jī):[Y/N] Y
正在重啟主機(jī)......
連接測(cè)試
查看系統(tǒng)版本:
[root@openeuler:/root]$ cat /etc/os-release
NAME="openEuler"
VERSION="22.03 (LTS-SP3)"
ID="openEuler"
VERSION_ID="22.03"
PRETTY_NAME="openEuler 22.03 (LTS-SP3)"
ANSI_COLOR="0;31"
查看 Grid 版本以及補(bǔ)丁:
[grid@openeuler:/home/grid]$ sqlplus -v SQL*Plus: Release 21.0.0.0.0 - Production Version 21.14.0.0.0 [grid@openeuler:/home/grid]$ opatch lspatches 36460255;TOMCAT RELEASE UPDATE 21.0.0.0.0 (36460255) 36360767;RHP RELEASE UPDATE 21.14.0.0.0 (36360767) 36360764;ACFS RELEASE UPDATE 21.14.0.0.0 (36360764) 36360754;OCW RELEASE UPDATE 21.14.0.0.0 (36360754) 36352352;Database Release Update : 21.14.0.0.240416 (36352352) 36115667;DBWLM RELEASE UPDATE 21.0.0.0.0 (36115667) OPatch succeeded.
查看集群:
[grid@openeuler:/home/grid]$ crsctl stat res -t
--------------------------------------------------------------------------------
Name Target State Server State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
ONLINE ONLINE openeuler STABLE
ora.LISTENER.lsnr
ONLINE ONLINE openeuler STABLE
ora.asm
ONLINE ONLINE openeuler Started,STABLE
ora.ons
OFFLINE OFFLINE openeuler STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
1 ONLINE ONLINE openeuler STABLE
ora.diskmon
1 OFFLINE OFFLINE STABLE
ora.evmd
1 ONLINE ONLINE openeuler STABLE
ora.lucifer.db
1 ONLINE ONLINE openeuler Open,HOME=/u01/app/o
racle/product/21.3.0
/db,STABLE
ora.lucifer.pdb01.pdb
1 ONLINE ONLINE openeuler STABLE
--------------------------------------------------------------------------------
查看 Oracle 版本以及補(bǔ)丁:
[oracle@openeuler:/home/oracle]$ sqlplus -v SQL*Plus: Release 21.0.0.0.0 - Production Version 21.14.0.0.0 [oracle@openeuler:/home/oracle]$ opatch lspatches 36360767;RHP RELEASE UPDATE 21.14.0.0.0 (36360767) 36360754;OCW RELEASE UPDATE 21.14.0.0.0 (36360754) 36352352;Database Release Update : 21.14.0.0.240416 (36352352) OPatch succeeded.
連接數(shù)據(jù)庫(kù):
[oracle@openeuler:/home/oracle]$ sas
SQL*Plus: Release 21.0.0.0.0 - Production on Wed May 8 17:19:21 2024
Version 21.14.0.0.0
Copyright (c) 1982, 2021, Oracle. All rights reserved.
Connected to:
Oracle Database 21c Enterprise Edition Release 21.0.0.0.0 - Production
Version 21.14.0.0.0
sys@LUCIFER 2024-05-08 17:19:21> show parameter name
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
cdb_cluster_name string
cell_offloadgroup_name string
db_file_name_convert string
db_name string lucifer
db_unique_name string lucifer
global_names boolean FALSE
instance_name string lucifer
lock_name_space string
log_file_name_convert string
pdb_file_name_convert string
processor_group_name string
service_names string lucifer
sys@LUCIFER 2024-05-08 17:19:24> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDB01 READ WRITE NO
數(shù)據(jù)庫(kù)連接正常。
最后修改時(shí)間:2026-03-23 16:19:26
「喜歡這篇文章,您的關(guān)注和贊賞是給作者最好的鼓勵(lì)」
關(guān)注作者
【版權(quán)聲明】本文為墨天輪用戶原創(chuàng)內(nèi)容,轉(zhuǎn)載時(shí)必須標(biāo)注文章的來(lái)源(墨天輪),文章鏈接,文章作者等基本信息,否則作者和墨天輪有權(quán)追究責(zé)任。如果您發(fā)現(xiàn)墨天輪中有涉嫌抄襲或者侵權(quán)的內(nèi)容,歡迎發(fā)送郵件至:contact@modb.pro進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),墨天輪將立刻刪除相關(guān)內(nèi)容。




