前言
Oracle 一鍵安裝腳本,演示華為 Debian 12.5 一鍵安裝 Oracle 19C 單機(jī)版過(guò)程(全程無(wú)需人工干預(yù))。
?? 腳本下載地址:Shell腳本安裝Oracle數(shù)據(jù)庫(kù)
安裝準(zhǔn)備
- 1、安裝好操作系統(tǒng),建議安裝圖形化
- 2、配置好網(wǎng)絡(luò)
- 3、上傳軟件安裝包(安裝基礎(chǔ)包,補(bǔ)丁包)
- 4、上傳一鍵安裝腳本:OracleShellInstall
環(huán)境信息
# 主機(jī)版本
root@debian12:/soft# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
# 網(wǎng)絡(luò)信息
root@debian12:/soft# 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:bc:25:0a brd ff:ff:ff:ff:ff:ff
altname enp2s1
inet 192.168.6.139/24 brd 192.168.6.255 scope global dynamic noprefixroute ens33
valid_lft 85400sec preferred_lft 85400sec
inet6 fe80::20c:29ff:febc:250a/64 scope link noprefixroute
valid_lft forever preferred_lft forever
# 連接外網(wǎng)測(cè)試
root@debian12:/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=5.70 ms
64 bytes from www.baidu.com (180.101.50.242): icmp_seq=2 ttl=53 time=5.71 ms
64 bytes from www.baidu.com (180.101.50.242): icmp_seq=3 ttl=53 time=5.61 ms
64 bytes from www.baidu.com (180.101.50.242): icmp_seq=4 ttl=53 time=5.72 ms
64 bytes from www.baidu.com (180.101.50.242): icmp_seq=5 ttl=53 time=5.70 ms
# 安裝包存放在 /soft 目錄下
root@debian12:/soft# ls -l
-rwx------ 1 root root 3059705302 Jun 5 15:01 LINUX.X64_193000_db_home.zip
-rw-r--r-- 1 root root 217945 Jun 5 15:00 OracleShellInstall
-rwx------ 1 root root 321590 Jun 5 14:54 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 -lf ens33 `# local ip ifname`\
-n debian12 `# hostname`\
-op oracle `# oracle password`\
-d /u01 `# software base dir`\
-ord /oradata `# data dir`\
-o lucifer `# dbname`\
-dp oracle `# sys/system password`\
-ds AL32UTF8 `# database character`\
-ns AL16UTF16 `# national character`\
-redo 100 `# redo size`\
-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)] : si
數(shù)據(jù)庫(kù)安裝模式: single
請(qǐng)選擇數(shù)據(jù)庫(kù)版本 [11/12/19/21] : 19
數(shù)據(jù)庫(kù)版本: 19
!!! 免責(zé)聲明:當(dāng)前操作系統(tǒng)版本是 [ Debian GNU/Linux 12 (bookworm) ] 不在 Oracle 官方支持列表,本腳本只負(fù)責(zé)安裝,請(qǐng)確認(rèn)是否繼續(xù)安裝 (Y/N): [Y]
OracleShellInstall 開(kāi)始安裝,詳細(xì)安裝過(guò)程可查看日志: tail -2000f /soft/print_shell_install_20240605165707.log
正在去除密碼復(fù)雜度配置......已完成 (耗時(shí): 1 秒)
正在配置軟件源......已完成 (耗時(shí): 21 秒)
正在獲取操作系統(tǒng)信息......已完成 (耗時(shí): 1 秒)
正在安裝依賴(lài)包......已完成 (耗時(shí): 142 秒)
正在配置 Swap......已完成 (耗時(shí): 75 秒)
正在配置防火墻......已完成 (耗時(shí): 1 秒)
正在配置 selinux......已完成 (耗時(shí): 0 秒)
正在配置主機(jī)名和 /etc/hosts......已完成 (耗時(shí): 1 秒)
正在創(chuàng)建用戶(hù)和組......已完成 (耗時(shí): 1 秒)
正在創(chuàng)建安裝目錄......已完成 (耗時(shí): 1 秒)
正在配置 Avahi-daemon 服務(wù)......已完成 (耗時(shí): 2 秒)
正在配置透明大頁(yè) && NUMA && 磁盤(pán) IO 調(diào)度器......已完成 (耗時(shí): 4 秒)
正在配置操作系統(tǒng)參數(shù) sysctl......已完成 (耗時(shí): 2 秒)
正在配置 RemoveIPC......已完成 (耗時(shí): 0 秒)
正在配置用戶(hù)限制 limit......已完成 (耗時(shí): 0 秒)
正在配置 shm 目錄......已完成 (耗時(shí): 0 秒)
正在安裝 rlwrap 插件......已完成 (耗時(shí): 18 秒)
正在配置用戶(hù)環(huán)境變量......已完成 (耗時(shí): 1 秒)
正在解壓 Oracle 安裝包以及補(bǔ)丁......已完成 (耗時(shí): 129 秒)
正在安裝 Oracle 軟件以及補(bǔ)丁......已完成 (耗時(shí): 132 秒)
正在創(chuàng)建監(jiān)聽(tīng)......已完成 (耗時(shí): 9 秒)
正在創(chuàng)建數(shù)據(jù)庫(kù)......已完成 (耗時(shí): 686 秒)
正在優(yōu)化數(shù)據(jù)庫(kù)......已完成 (耗時(shí): 27 秒)
恭喜!Oracle 單機(jī)安裝成功 (耗時(shí): 1255 秒),現(xiàn)在是否重啟主機(jī):[Y/N] Y
正在重啟當(dāng)前節(jié)點(diǎn)主機(jī)......
連接測(cè)試
查看系統(tǒng)版本:
[root@debian12:/root]# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
查看 Oracle 版本以及補(bǔ)丁:
[oracle@debian12:/home/oracle]$ sqlplus -v SQL*Plus: Release 19.0.0.0.0 - Production Version 19.3.0.0.0 [oracle@debian12:/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.
查看監(jiān)聽(tīng):
[oracle@debian12:/home/oracle]$ lsnrctl stat
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 05-JUN-2024 17:51:19
Copyright (c) 1991, 2019, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=debian12)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date 05-JUN-2024 17:27:57
Uptime 0 days 0 hr. 23 min. 21 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/debian12/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=debian12)(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
連接數(shù)據(jù)庫(kù):
[oracle@debian12:/home/oracle]$ sas SQL*Plus: Release 19.0.0.0.0 - Production on Wed Jun 5 17:51:28 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-06-05 17:51:28> 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
數(shù)據(jù)庫(kù)連接正常。
最后修改時(shí)間:2026-03-23 16:43:45
「喜歡這篇文章,您的關(guān)注和贊賞是給作者最好的鼓勵(lì)」
關(guān)注作者
【版權(quán)聲明】本文為墨天輪用戶(hù)原創(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)容。




