前言
Oracle 一鍵安裝腳本,演示 openEuler 22.03 LTS SP3 一鍵安裝 Oracle 19C 單機 ASM(19.23)過程(全程無需人工干預)。
?? 腳本下載地址:Shell腳本安裝Oracle數據庫
安裝準備
- 1、安裝好操作系統,建議安裝圖形化
- 2、配置好網絡
- 3、掛載本地 ISO 鏡像源
- 4、上傳軟件安裝包(安裝基礎包,補丁包)
- 5、上傳一鍵安裝腳本:OracleShellInstall
環境信息
# 主機版本
[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"
# 網絡信息
[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 共享磁盤掛載(有存儲就不需要使用 starwind,直接存儲上劃盤掛載就可)
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 磁盤
iscsiadm -m node -T iqn.2008-08.com.starwindsoftware:192.168.6.188-lucifer -p 192.168.6.188 -l
## 配置開機自動掛載
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 3059705302 Mar 29 15:48 LINUX.X64_193000_db_home.zip
-rwx------. 1 root root 2889184573 Mar 29 15:47 LINUX.X64_193000_grid_home.zip
-rwxr-xr-x. 1 root root 199538 Mar 29 15:48 OracleShellInstall
-rwx------. 1 root root 127475677 Mar 29 15:46 p36199232_190000_Linux-x86-64.zip
-rwx------. 1 root root 3411816300 Mar 29 15:48 p36233126_190000_Linux-x86-64.zip
-rwx------. 1 root root 133535622 Mar 29 15:46 p6880880_190000_Linux-x86-64.zip
-rwx------. 1 root root 321590 Mar 20 13:58 rlwrap-0.44.tar.gz
確保安裝環境準備完成后,即可執行一鍵安裝。
安裝命令
使用標準生產環境安裝參數(安裝過程若失敗,腳本支持重復執行安裝):
# 根據腳本 README 或者 -h 命令提示,編輯好一鍵安裝命令,進入 /soft 目錄執行安裝:
./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 36233126 `# grid PSU/RU`\
-jpa 36199232 `# OJVM PSU/RU`\
-opd Y `# optimize db`
安裝過程
███████ ██ ████████ ██ ██ ██ ██ ██ ██ ██
██?????██ ?██ ██?????? ?██ ?██ ?██?██ ?██ ?██ ?██
██ ??██ ██████ ██████ █████ ?██ █████ ?██ ?██ █████ ?██ ?██?██ ███████ ██████ ██████ ██████ ?██ ?██
?██ ?██??██??█ ??????██ ██???██ ?██ ██???██?█████████?██████ ██???██ ?██ ?██?██??██???██ ██???? ???██? ??????██ ?██ ?██
?██ ?██ ?██ ? ███████ ?██ ?? ?██?███████????????██?██???██?███████ ?██ ?██?██ ?██ ?██??█████ ?██ ███████ ?██ ?██
??██ ██ ?██ ██????██ ?██ ██ ?██?██???? ?██?██ ?██?██???? ?██ ?██?██ ?██ ?██ ?????██ ?██ ██????██ ?██ ?██
??███████ ?███ ??████████??█████ ███??██████ ████████ ?██ ?██??██████ ███ ███?██ ███ ?██ ██████ ??██ ??████████ ███ ███
??????? ??? ???????? ????? ??? ?????? ???????? ?? ?? ?????? ??? ??? ?? ??? ?? ?????? ?? ???????? ??? ???
注意:本腳本僅用于新服務器上實施部署數據使用,嚴禁在已運行數據庫的主機上執行,以免發生數據丟失或者損壞,造成不可挽回的損失!!!
請選擇安裝模式 [單機(si)/單機ASM(sa)/集群(rac)] : sa
數據庫安裝模式: standalone
請選擇數據庫版本 [11/12/19/21] : 19
數據庫版本: 19
OracleShellInstall 開始安裝,安裝過程可查看日志: /soft/print_ora_install_20240329160031.log
正在檢查操作系統是否符合安裝條件......已完成 (耗時: 0 秒)
正在去除密碼復雜度配置......已完成 (耗時: 0 秒)
正在配置 YUM 源......已完成 (耗時: 0 秒)
正在獲取操作系統信息......已完成 (耗時: 1 秒)
正在配置 Swap......已完成 (耗時: 0 秒)
正在配置防火墻......已完成 (耗時: 2 秒)
正在配置 selinux......已完成 (耗時: 1 秒)
正在配置 nsyctl......已完成 (耗時: 0 秒)
正在安裝依賴包......已完成 (耗時: 183 秒)
正在配置主機名和 /etc/hosts......已完成 (耗時: 1 秒)
正在創建用戶和組......已完成 (耗時: 2 秒)
正在創建安裝目錄......已完成 (耗時: 1 秒)
正在配置 Avahi-daemon 服務......已完成 (耗時: 3 秒)
正在配置透明大頁 && NUMA && 磁盤 IO 調度器......已完成 (耗時: 1 秒)
正在配置操作系統參數 sysctl......已完成 (耗時: 1 秒)
正在配置 RemoveIPC......已完成 (耗時: 1 秒)
正在配置用戶限制 limit......已完成 (耗時: 2 秒)
正在配置 shm 目錄......已完成 (耗時: 1 秒)
正在安裝 rlwrap 插件......已完成 (耗時: 17 秒)
正在配置用戶環境變量......已完成 (耗時: 1 秒)
正在解壓 Grid 安裝包以及補丁......已完成 (耗時: 226 秒)
正在解壓 Oracle 安裝包以及補丁......已完成 (耗時: 152 秒)
正在安裝 Grid 軟件以及補丁......已完成 (耗時: 2091 秒)
正在安裝 Oracle 軟件以及補丁......已完成 (耗時: 2014 秒)
正在創建數據庫......已完成 (耗時: 1823 秒)
正在優化數據庫......已完成 (耗時: 158 秒)
恭喜!Oracle 單機 ASM 安裝成功 (耗時: 6688 秒),現在是否重啟主機:[Y/N] Y
正在重啟主機......
連接測試
查看系統版本:
[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 版本以及補丁:
[grid@openeuler:/home/grid]$ sqlplus -v SQL*Plus: Release 19.0.0.0.0 - Production Version 19.23.0.0.0 [grid@openeuler:/home/grid]$ opatch lspatches 36460248;TOMCAT RELEASE UPDATE 19.0.0.0.0 (36460248) 36383196;DBWLM RELEASE UPDATE 19.0.0.0.0 (36383196) 36240578;OCW RELEASE UPDATE 19.23.0.0.0 (36240578) 36233343;ACFS RELEASE UPDATE 19.23.0.0.0 (36233343) 36233263;Database Release Update : 19.23.0.0.240416 (36233263) 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/19.3.0
/db,STABLE
--------------------------------------------------------------------------------
查看 Oracle 版本以及補丁:
[oracle@openeuler:/home/oracle]$ sqlplus -v SQL*Plus: Release 19.0.0.0.0 - Production Version 19.23.0.0.0 [oracle@openeuler:/home/oracle]$ opatch lspatches 36199232;OJVM RELEASE UPDATE: 19.23.0.0.240416 (36199232) 36240578;OCW RELEASE UPDATE 19.23.0.0.0 (36240578) 36233263;Database Release Update : 19.23.0.0.240416 (36233263) OPatch succeeded.
連接數據庫:
[oracle@openeuler:/home/oracle]$ sas SQL*Plus: Release 19.0.0.0.0 - Production on Tue Apr 30 12:13:41 2024 Version 19.23.0.0.0 Copyright (c) 1982, 2023, Oracle. All rights reserved. Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.23.0.0.0 sys@LUCIFER 2024-04-30 12:13:42> 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
數據庫連接正常。
最后修改時間:2026-03-23 17:00:16
「喜歡這篇文章,您的關注和贊賞是給作者最好的鼓勵」
關注作者
【版權聲明】本文為墨天輪用戶原創內容,轉載時必須標注文章的來源(墨天輪),文章鏈接,文章作者等基本信息,否則作者和墨天輪有權追究責任。如果您發現墨天輪中有涉嫌抄襲或者侵權的內容,歡迎發送郵件至:contact@modb.pro進行舉報,并提供相關證據,一經查實,墨天輪將立刻刪除相關內容。




