当前位置:首页 > 技术 > 正文内容

自动化部署Oracle 19C数据库于Debian 12.5系统

访客 技术 2026年6月28日 1

概述

本指南演示基于华为云平台的Debian 12.5系统,实现Oracle 19C单节点数据库的全自动部署流程(全程无需人工干预)。

⚠️ 脚本获取方式:自动化部署脚本包

环境预置

    1. 安装基础操作系统镜像,建议启用图形界面
    1. 配置网络连接及DNS解析
    1. 上传核心安装文件(包含基础包与补丁包)
    1. 上传自动化部署脚本: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

数据库连接正常。

相关文章

Linux crontab 详解

1) crontab 是什么cron 是 Linux 的定时任务守护进程;crontab 是用来编辑/查看“按时间周期执行命令”的表(cron table)。常见两类:用户 crontab:每个用户一份(crontab -e 编辑)系统级 crontab / cron.d:可指定执行用户(/etc/crontab、/etc/cron.d/*)2) crontab 时间...

富文本里可以允许的 HTML 属性

一、所有标签默认允许的安全属性(极少)class        (可选)id           (通常建议禁用)title️ 注意:id 容易被滥用做锚点注入,很多系统直接禁用class 允许的话最好只允许固定前缀(如 editor-*)二、a 标签允许属性<a href="" t...

Mac 安装 Node.js 指南

方法一:通过官网安装包(最简单,适合初学者)如果你只是想快速安装并开始使用,这是最直接的方法。访问 Node.js 官网。页面会显示两个版本:LTS (Recommended For Most Users):长期支持版,最稳定。建议选这个。Current:最新特性版,包含最新功能但可能不够稳定。下载 .pkg 安装包并运行。按照安装向导点击“下一步”即可完成。方法二:使用 Homebrew 安装(...

Dom\HTML_NO_DEFAULT_NS 的副作用:自动加闭合标签

在使用Dom\HTMLDocument时,Dom\HTML_NO_DEFAULT_NS 将禁止在解析过程中设置元素的命名空间, 此设置是为了与DOMDocument向后兼容而存在的。当使用它时,已知的一个副作用就是:自动加闭合标签例如 </img> 为什么会这样?当你使用:Dom\HTML_NO_DEFAULT_NS文档会变成 无命名空间模式,此时内部更接近 XML...

Laravel 事件和监听器创建

在 Laravel 中,使用 Artisan 命令创建 Events(事件) 和 Listeners(监听器) 是非常高效的。你可以通过以下几种方式来实现:1. 手动创建单个 Event如果你只想创建一个事件类,可以使用 make:event 命令:Bashphp artisan make:event UserRegistered执行后,文件将生成在 app/Even...

linux screen 用法详情 (nohup 的替代方案)

一、screen 是什么?能干嘛?screen 是一个终端复用器,可以:在一个 SSH 会话中开多个“虚拟终端”SSH 断线后,程序仍然在后台运行随时重新连接到原来的会话特别适合:nohup 的替代方案跑脚本 / 爬虫 / 训练模型运维、远程开发二、安装 screen# CentOS / Rocky / Almayum install -y screen# Debian / Ubuntuapt i...

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。