自动化部署Oracle 19C数据库于Debian 12.5系统
概述
本指南演示基于华为云平台的Debian 12.5系统,实现Oracle 19C单节点数据库的全自动部署流程(全程无需人工干预)。
⚠️ 脚本获取方式:自动化部署脚本包
环境预置
-
- 安装基础操作系统镜像,建议启用图形界面
-
- 配置网络连接及DNS解析
-
- 上传核心安装文件(包含基础包与补丁包)
-
- 上传自动化部署脚本:OracleAutoDeploy
系统配置信息
# 操作系统版本
[root@myhost ~]# 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/"
# 网络配置
[root@myhost ~]# ip a
2: eth0: <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.1.100/24 brd 192.168.1.255 scope global dynamic noprefixroute eth0
valid_lft 85400sec preferred_lft 85400sec
inet6 fe80::20c:29ff:febc:250a/64 scope link noprefixroute
valid_lft forever preferred_lft forever
# 网络连通性测试
[root@myhost ~]# ping -c 4 www.baidu.com
PING www.a.shifen.com (180.101.50.242) 56(84) bytes of data.
64 bytes from 180.101.50.242: icmp_seq=1 ttl=53 time=5.70 ms
64 bytes from 180.101.50.242: icmp_seq=2 ttl=53 time=5.71 ms
64 bytes from 180.101.50.242: icmp_seq=3 ttl=53 time=5.61 ms
64 bytes from 180.101.50.242: icmp_seq=4 ttl=53 time=5.72 ms
# 安装文件存放路径
[root@myhost ~]# ls -l /opt/install/
-rwx------ 1 root root 3059705302 Jun 5 15:01 linuxx64_193000_db_home.zip
-rw-r--r-- 1 root root 217945 Jun 5 15:00 OracleAutoDeploy
-rwx------ 1 root root 321590 Jun 5 14:54 rlwrap-0.44.tar.gz
确认环境配置完成后执行部署流程。
部署指令
采用标准生产环境参数(安装失败时支持重试机制):
# 根据脚本说明文档配置参数,进入安装目录执行:
./OracleAutoDeploy -if eth0 \ # 网络接口名称
-hn myhost \ # 主机名
-pw dbpass \ # 数据库密码
-bd /u01 \ # 软件安装目录
-od /oradata \ # 数据存储路径
-db lucifer \ # 数据库实例名
-sp dbadmin \ # 系统账户密码
-cs AL32UTF8 \# 字符集
-ns AL16UTF16 \# 国家字符集
-rs 100 \ # 重做日志大小
-op Y \ # 数据库优化标志
部署流程
███████ ██ ████████ ██ ██ ██ ██ ██ ██ ██
██░░░░░██ ░██ ██░░░░░░ ░██ ░██ ░██░██ ░██ ░██ ░██
██ ░░██ ██████ ██████ █████ ░██ █████ ░██ ░██ █████ ░██ ░██░██ ███████ ██████ ██████ ██████ ░██ ░██
░██ ░██░░██░░█ ░░░░░░██ ██░░░██ ░██ ██░░░██░█████████░██████ ██░░░██ ░██ ░██░██ ░░██░░░██ ██░░░░ ░░░██░ ░░░░░░██ ░██ ░██
░██ ░██ ░██ ░ ███████ ░██ ░░ ░██░███████░░░░░░░░██░██░░░██░███████ ░██ ░██░██ ░██ ░██░░█████ ░██ ███████ ░██ ░██
░░██ ██ ░██ ██░░░░██ ░██ ██ ░██░██░░░░ ░██░██ ░██░██░░░░ ░██ ░██░██ ░██ ░██ ░░░░░██ ░██ ██░░░░██ ░██ ░██
░░███████ ░███ ░░████████░░█████ ███░░██████ ████████ ░██ ░██░░██████ ███ ███░██ ███ ░██ ██████ ░░██ ░░████████ ███ ███
░░░░░░░ ░░░ ░░░░░░░░ ░░░░░ ░░░ ░░░░░░ ░░░░░░░░ ░░ ░░ ░░░░░░ ░░░ ░░░ ░░ ░░░ ░░ ░░░░░░ ░░ ░░░░░░░░ ░░░ ░░░
注意:本方案仅适用于全新环境部署,禁止在已存在数据库的服务器上运行,防止数据丢失风险!!!
请选择部署模式 [单机(s)/ASM单机(a)/集群(r)] : s
数据库部署模式: 单节点
请选择数据库版本 [11/12/19/21] : 19
数据库版本: 19
!!! 风险提示:当前系统版本 [Debian GNU/Linux 12 (bookworm)] 未在Oracle官方支持列表中,本工具仅执行安装操作,请确认是否继续 (Y/N): [Y]
OracleAutoDeploy 开始执行,详细日志请查看: tail -2000f /opt/install/deploy_log_20240605165707.txt
正在移除密码策略限制......完成 (耗时: 1 秒)
正在配置软件源......完成 (耗时: 21 秒)
正在获取系统信息......完成 (耗时: 1 秒)
正在安装依赖组件......完成 (耗时: 142 秒)
正在配置交换分区......完成 (耗时: 75 秒)
正在设置防火墙规则......完成 (耗时: 1 秒)
正在处理SELinux配置......完成 (耗时: 0 秒)
正在配置主机名和hosts文件......完成 (耗时: 1 秒)
正在创建系统账户......完成 (耗时: 1 秒)
正在建立安装目录结构......完成 (耗时: 1 秒)
正在配置服务启动项......完成 (耗时: 2 秒)
正在优化内存管理及IO调度......完成 (耗时: 4 秒)
正在调整系统内核参数......完成 (耗时: 2 秒)
正在设置IPC清理策略......完成 (耗时: 0 秒)
正在配置资源限制......完成 (耗时: 0 秒)
正在初始化共享内存......完成 (耗时: 0 秒)
正在安装扩展工具......完成 (耗时: 18 秒)
正在设置环境变量......完成 (耗时: 1 秒)
正在解压数据库文件......完成 (耗时: 129 秒)
正在执行数据库安装......完成 (耗时: 132 秒)
正在创建监听器......完成 (耗时: 9 秒)
正在初始化数据库实例......完成 (耗时: 686 秒)
正在执行性能优化......完成 (耗时: 27 秒)
Oracle单节点部署成功 (耗时: 1255 秒),是否立即重启系统:[Y/N] Y
正在执行系统重启......
验证测试
系统版本确认:
[root@myhost ~]# 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@myhost ~]$ sqlplus -v
SQL*Plus: Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
[oracle@myhost ~]$ opatch lsinventory
Patch 29585399: OCW RELEASE UPDATE 19.3.0.0.0 (29585399)
Patch 29517242: DATABASE RELEASE UPDATE 19.3.0.0.190416 (29517242)
OPatch succeeded.
监听器状态检查:
[oracle@myhost ~]$ lsnrctl status
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=myhost)(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/myhost/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=myhost)(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@myhost ~]$ sqlplus / as sysdba
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
数据库连接正常。