前言
Oracle 一鍵安裝腳本,演示 Deepin 20.9 一鍵安裝 Oracle 19C 單機版過程(全程無需人工干預)。
?? 腳本下載地址:Shell腳本安裝Oracle數據庫
?? 更多教程參考:Oracle 一鍵安裝腳本實操合集,持續更新中?。?!
前置準備
- 1、系統組安裝好操作系統(支持最小化安裝)
- 2、網絡組配置好主機網絡,通常只需要一個公網 IP 地址
- 3、DBA 創建軟件目錄:
mkdir /soft - 4、DBA 上傳 Oracle 安裝介質(基礎包,補丁包)到 /soft 目錄下
- 5、DBA 上傳 Oracle 一鍵安裝腳本到 /soft 目錄下,授予腳本執行權限:
chmod +x OracleshellInstall - 6、確保能連通外網,需要配置網絡軟件源
- 7、根據腳本安裝腳本以及實際情況,配置好腳本的安裝參數,在 /soft 目錄下執行一鍵安裝即可。
環境信息
# 主機版本
root@deepin:/soft# cat /etc/os-release
PRETTY_NAME="Deepin 20.9"
NAME="Deepin"
VERSION_ID="20.9"
VERSION="20.9"
VERSION_CODENAME="apricot"
ID=Deepin
HOME_URL="https://www.deepin.org/"
BUG_REPORT_URL="https://bbs.deepin.org/"
# 網絡信息
root@deepin:/soft# ip a
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:0c:29:8b:c7:d9 brd ff:ff:ff:ff:ff:ff
inet 192.168.6.62/24 brd 192.168.6.255 scope global dynamic noprefixroute ens33
valid_lft 78639sec preferred_lft 78639sec
inet6 fe80::7355:4d89:a6ba:412d/64 scope link noprefixroute
valid_lft forever preferred_lft forever
# 連接外網測試
root@deepin:/soft# ping www.baidu.com
PING www.a.shifen.com (180.101.50.242) 56(84) bytes of data.
64 bytes from www.baidu.com (180.101.50.242): icmp_seq=1 ttl=53 time=8.45 ms
64 bytes from www.baidu.com (180.101.50.242): icmp_seq=2 ttl=53 time=7.61 ms
64 bytes from www.baidu.com (180.101.50.242): icmp_seq=3 ttl=53 time=7.70 ms
64 bytes from www.baidu.com (180.101.50.242): icmp_seq=4 ttl=53 time=7.86 ms
64 bytes from www.baidu.com (180.101.50.242): icmp_seq=5 ttl=53 time=7.81 ms
# 安裝包存放在 /soft 目錄下
root@deepin:/soft# ls -l
-rwx------ 1 root root 3059705302 7月 12 13:24 LINUX.X64_193000_db_home.zip
-rwxr-xr-x 1 root root 233744 7月 12 13:24 OracleShellInstall
確保安裝環境準備完成后,即可執行一鍵安裝。
安裝命令
使用標準生產環境安裝參數(安裝過程若失敗,腳本支持重復執行安裝):
# 根據腳本 README 或者 -h 命令提示,編輯好一鍵安裝命令,進入 /soft 目錄執行安裝:
root@deepin:~# cd /soft/
root@deepin:/soft# chmod +x OracleShellInstall
./OracleShellInstall -lf ens33 `# 主機網卡名稱`\
-n deepin `# 主機名`\
-op oracle `# 主機 oracle 用戶密碼`\
-d /u01 `# Oracle 軟件安裝基礎目錄`\
-ord /oradata `# 數據庫文件存放目錄`\
-o lucifer `# 數據庫名稱`\
-dp 'Passw0rd#PST' `# sys/system 用戶密碼`\
-ds AL32UTF8 `# 數據庫字符集`\
-ns AL16UTF16 `# 國家字符集`\
-redo 100 `# 在線重做日志大?。∕)`\
-opd Y `# 是否優化數據庫`
安裝過程
███████ ██ ████████ ██ ██ ██ ██ ██ ██ ██
██?????██ ?██ ██?????? ?██ ?██ ?██?██ ?██ ?██ ?██
██ ??██ ██████ ██████ █████ ?██ █████ ?██ ?██ █████ ?██ ?██?██ ███████ ██████ ██████ ██████ ?██ ?██
?██ ?██??██??█ ??????██ ██???██ ?██ ██???██?█████████?██████ ██???██ ?██ ?██?██??██???██ ██???? ???██? ??????██ ?██ ?██
?██ ?██ ?██ ? ███████ ?██ ?? ?██?███████????????██?██???██?███████ ?██ ?██?██ ?██ ?██??█████ ?██ ███████ ?██ ?██
??██ ██ ?██ ██????██ ?██ ██ ?██?██???? ?██?██ ?██?██???? ?██ ?██?██ ?██ ?██ ?????██ ?██ ██????██ ?██ ?██
??███████ ?███ ??████████??█████ ███??██████ ████████ ?██ ?██??██████ ███ ███?██ ███ ?██ ██████ ??██ ??████████ ███ ███
??????? ??? ???????? ????? ??? ?????? ???????? ?? ?? ?????? ??? ??? ?? ??? ?? ?????? ?? ???????? ??? ???
注意:本腳本僅用于新服務器上實施部署數據庫使用,嚴禁在已運行數據庫的主機上執行,以免發生數據丟失或者損壞,造成不可挽回的損失!??!
請選擇安裝模式 [單機(si)/單機ASM(sa)/集群(rac)] : si
數據庫安裝模式: single
請選擇數據庫版本 [11/12/19/21] : 19
數據庫版本: 19
!!! 免責聲明:當前操作系統版本是 [ Deepin 20.9 ] 不在 Oracle 官方支持列表,本腳本只負責安裝,請確認是否繼續安裝 (Y/N): [Y]
OracleShellInstall 開始安裝,詳細安裝過程可查看日志: tail -2000f /soft/print_shell_install_20240712133415.log
正在進行安裝前檢查,請稍等......
正在檢測安裝包 /soft/LINUX.X64_193000_db_home.zip 的 MD5 值是否正確,請稍等......
正在配置網絡軟件源......已完成 (耗時: 24 秒)
正在獲取操作系統信息......已完成 (耗時: 1 秒)
正在安裝依賴包......已完成 (耗時: 215 秒)
正在禁用防火墻......已完成 (耗時: 0 秒)
正在配置主機名和 /etc/hosts......已完成 (耗時: 0 秒)
正在創建用戶和組......已完成 (耗時: 1 秒)
正在創建安裝目錄......已完成 (耗時: 1 秒)
正在配置 Avahi-daemon 服務......已完成 (耗時: 2 秒)
正在配置透明大頁 && NUMA && 磁盤 IO 調度器......已完成 (耗時: 8 秒)
正在配置操作系統參數 sysctl......已完成 (耗時: 1 秒)
正在配置 RemoveIPC......已完成 (耗時: 0 秒)
正在配置用戶限制 limit......已完成 (耗時: 2 秒)
正在配置 shm 目錄......已完成 (耗時: 1 秒)
正在配置用戶環境變量......已完成 (耗時: 1 秒)
正在解壓 Oracle 安裝包以及補丁......已完成 (耗時: 101 秒)
正在安裝 Oracle 軟件以及補丁......已完成 (耗時: 158 秒)
正在創建監聽......已完成 (耗時: 9 秒)
正在創建數據庫......已完成 (耗時: 644 秒)
正在優化數據庫......已完成 (耗時: 34 秒)
恭喜!Oracle 一鍵安裝執行完成 (耗時: 1209 秒),現在是否重啟主機:[Y/N] Y
正在重啟當前節點主機......
連接測試
查看系統版本:
[root@deepin:/root]# cat /etc/os-release
PRETTY_NAME="Deepin 20.9"
NAME="Deepin"
VERSION_ID="20.9"
VERSION="20.9"
VERSION_CODENAME="apricot"
ID=Deepin
HOME_URL="https://www.deepin.org/"
BUG_REPORT_URL="https://bbs.deepin.org/"
查看 Oracle 版本以及補?。?/p>
[oracle@deepin:/home/oracle]$ sqlplus -v SQL*Plus: Release 19.0.0.0.0 - Production Version 19.3.0.0.0 [oracle@deepin:/home/oracle]$ opatch lspatches 29585399;OCW RELEASE UPDATE 19.3.0.0.0 (29585399) 29517242;Database Release Update : 19.3.0.0.190416 (29517242) OPatch succeeded.
查看監聽:
[oracle@deepin:/home/oracle]$ lsnrctl stat
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 12-JUL-2024 14:12:08
Copyright (c) 1991, 2019, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=deepin)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date 12-JUL-2024 14:06:01
Uptime 0 days 0 hr. 6 min. 7 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/19.3.0/db/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/deepin/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=deepin)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "lucifer" has 1 instance(s).
Instance "lucifer", status READY, has 1 handler(s) for this service...
Service "luciferXDB" has 1 instance(s).
Instance "lucifer", status READY, has 1 handler(s) for this service...
The command completed successfully
連接數據庫:
[oracle@deepin:/home/oracle]$ sas SQL*Plus: Release 19.0.0.0.0 - Production on Fri Jul 12 14:12:16 2024 Version 19.3.0.0.0 Copyright (c) 1982, 2019, Oracle. All rights reserved. Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.3.0.0.0 sys@LUCIFER 2024-07-12 14:12:16> 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 16:07:00
「喜歡這篇文章,您的關注和贊賞是給作者最好的鼓勵」
關注作者
【版權聲明】本文為墨天輪用戶原創內容,轉載時必須標注文章的來源(墨天輪),文章鏈接,文章作者等基本信息,否則作者和墨天輪有權追究責任。如果您發現墨天輪中有涉嫌抄襲或者侵權的內容,歡迎發送郵件至:contact@modb.pro進行舉報,并提供相關證據,一經查實,墨天輪將立刻刪除相關內容。




