一、环境说明
- 虚拟机:VMware Workstation Pro 17
- 系统:Ubuntu 24.04.2 服务器版
- 内存:6G
- 处理器:2
- 硬盘:300G
- SSH:FinalShell 4.5.12
- Docker 版本:Docker 28.4.0
- 数据库:Oracle 11.2.0.4
- 数据库管理工具:DBeaver
当前登录用户已加入 docker 组,所以在执行 Docker 命令时无需添加 sudo。
二、安装
2.1 拉取镜像
Oracle 官方提供的 Docker 镜像最低版本的是 Oracle 19c,此次使用第三方的镜像 yycx/oracle11:
- 国内镜像
- Docker Hub:11.2.0.4 与 latest 为同一个。
拉取国内镜像:
docker pull swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/yycx/oracle11:11.2.0.4
如果可以连接到 Docker Hub,那么可以使用下面的命令:
docker pull yycx/oracle11
通过 docker images 命令,可以看到下载的镜像。
lanyu@server:~$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest 1b44b5a3e06a 3 months ago 10.1kB
swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/yycx/oracle11 11.2.0.4 5cdb14deb3f8 3 years ago 7.35GB
2.2 创建文件存储目录
- oracle-11g:存放 Oracle 11g 相关文件。
- dump:用于挂载,存放需要导入的 dmp 文件,如果不需要可以不建这个文件夹。
mkdir -p ~/app/docker/oracle-11g/dump # 创建目录
chmod -R 777 ~/app/docker/oracle-11g # 授予读写执行权限
2.3 Oracle 目录
容器内 Oracle 安装位置:/opt/oracle
/opt/
├── ORCLfmap/ # Oracle 文件映射目录
│ └── prot1_64/ # 协议相关目录
│ ├── bin/ # 二进制文件
│ ├── etc/ # 配置文件
│ └── log/ # 日志文件
└── oracle/ # Oracle 主目录
├── app/ # Oracle 应用目录
│ ├── admin/ # 管理文件
│ ├── cfgtoollogs/ # 配置工具日志
│ ├── checkpoints/ # 检查点
│ ├── diag/ # 诊断文件
│ ├── fast_recovery_area/ # 快速恢复区
│ │ ├── ORCL/ # ORCL 实例恢复文件
│ │ │ └── onlinelog/ # 在线重做日志(空目录)
│ │ └── orcl/ # orcl 实例恢复文件
│ │ └── control02.ctl # 控制文件副本
│ ├── oradata/ # 数据文件目录
│ │ └── orcl/ # orcl 实例数据文件
│ │ ├── ODB1 # 数据文件
│ │ ├── ODB2 # 数据文件
│ │ ├── control01.ctl # 控制文件
│ │ ├── redo01.log # 重做日志文件
│ │ ├── redo02.log # 重做日志文件
│ │ ├── redo03.log # 重做日志文件
│ │ ├── sysaux01.dbf # Sysaux 表空间
│ │ ├── system01.dbf # System 表空间
│ │ ├── temp01.dbf # 临时表空间
│ │ ├── undotbs01.dbf # Undo 表空间
│ │ └── users01.dbf # Users 表空间
│ └── product/ # Oracle 产品目录
│ └── 11.2.0/ # 11.2.0 版本
│ └── dbhome_1/ # 数据库主目录
│ ├── EMStage/ # Enterprise Manager 阶段
│ ├── OPatch/ # 补丁工具
│ ├── apex/ # APEX
│ ├── assistants/ # 助手工具
│ ├── bin/ # 可执行文件
│ ├── ccr/ # 集群就绪服务
│ ├── cdata/ # 字符数据
│ ├── cfgtoollogs/ # 配置工具日志
│ ├── clone/ # 克隆相关
│ ├── config/ # 配置
│ ├── crs/ # 集群就绪服务
│ ├── css/ # 集群同步服务
│ ├── ctx/ # 文本选项
│ ├── csmig/ # 迁移工具
│ ├── cv/ # 恢复目录
│ ├── dbs/ # 数据库文件
│ ├── dc_ocm/ # 配置管理器
│ ├── deinstall/ # 卸载工具
│ ├── demo/ # 演示文件
│ ├── diagnostics/ # 诊断工具
│ ├── dv/ # 数据库保险库
│ ├── emcli/ # Enterprise Manager CLI
│ ├── has/ # 高可用服务
│ ├── hs/ # 异构服务
│ ├── ide/ # 集成开发环境
│ ├── install/ # 安装文件
│ ├── instantclient/ # 即时客户端
│ ├── inventory/ # 库存
│ ├── j2ee/ # Java 2 Enterprise Edition
│ ├── javavm/ # Java 虚拟机
│ ├── jdbc/ # JDBC 驱动
│ ├── jdev/ # JDeveloper
│ ├── jdk/ # Java 开发工具包
│ ├── jlib/ # Java 库
│ ├── ldap/ # LDAP 目录
│ ├── lib/ # 库文件
│ ├── log/ # 日志
│ ├── md/ # 元数据
│ ├── mesg/ # 消息文件
│ ├── mgw/ # 管理网关
│ ├── network/ # 网络配置
│ ├── nls/ # 国家语言支持
│ ├── oc4j/ # Oracle Containers for J2EE
│ ├── odbc/ # ODBC 驱动
│ ├── olap/ # OLAP
│ ├── opmn/ # Oracle Process Manager and Notification
│ ├── oraInst.loc # Oracle 安装位置
│ ├── oracore/ # Oracle 核心
│ ├── ord/ # Oracle 空间数据
│ ├── oui/ # Oracle 通用安装程序
│ ├── owb/ # Oracle Warehouse Builder
│ ├── owm/ # Oracle Workspace Manager
│ ├── perl/ # Perl
│ ├── plsql/ # PL/SQL
│ ├── precomp/ # 预编译器
│ ├── racg/ # 真实应用集群守护进程
│ ├── rdbms/ # 关系数据库管理系统
│ ├── relnotes/ # 发布说明
│ ├── root.sh # 根脚本
│ ├── scheduler/ # 调度程序
│ ├── slax/ # 样式表语言
│ ├── sqldeveloper/ # SQL 开发工具
│ ├── sqlj/ # SQLJ
│ ├── sqlplus/ # SQL*Plus
│ ├── suptools/ # 支持工具
│ ├── sysman/ # 系统管理
│ ├── timingframework/ # 计时框架
│ ├── ucp/ # 通用连接池
│ ├── uix/ # 用户界面 XML
│ ├── usm/ # 用户安全管理
│ ├── utl/ # 实用程序
│ └── wwg/ # 无线网关
├── dpdump/ # 数据泵目录
└── oraInventory/ # Oracle 库存目录
2.4 Docker Compose
此次通过 Docker Compose 启动项目,在 ~/app/docker/oracle-11g 目录下创 建 yml 文件:
lanyu@server:~$ vim ~/app/docker/oracle-11g/oracle-11g-compose.yml
compose 内容:
name: oracle11g
services:
oracle11g:
container_name: oracle11g
image: swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/yycx/oracle11:11.2.0.4
ports:
- "1522:1521"
volumes:
- oracle_oradata:/opt/oracle/app/oradata/orcl
- oracle_fra:/opt/oracle/app/fast_recovery_area/orcl
- ~/app/docker/oracle-11g/dump:/opt/oracle/dpdump
privileged: true
restart: unless-stopped
volumes:
oracle_oradata:
oracle_fra:
2.5 命令解析
1. 项目名称
name: oracle11g
- 作用:定义 Docker Compose 项目的名称。
- 说明:所有资源(容器、网络、卷)都会使用这个名称作为前缀。
2. 服务定义
services:
oracle11g:
- 作用:定义要运行的服务列表。
- 说明:这里定义了一个名为 oracle11g 的服务。
3. 容器名称
container_name: oracle11g
- 作用:指定容器的具体名称。
- 说明:如果不指定,Docker 会生成随机名称。
4. 镜像来源
image: swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/yycx/oracle11:11.2.0.4
- 作用:指定使用的 Docker 镜像。
- 说明:包含 Oracle 11g 数据库 11.2.0.4 版本。
5. 端口映射
ports:
- "1522:1521"
- 作用:将容器端口映射到宿主机端口。
- 说明:
1521是 Oracle 数据库的标准监听端口。- 格式:
宿主机端口:容器端口。 - 允许外部应用通过宿主机的 1522 端口访问数据库。
6. 数据卷挂载
volumes:
- oracle_oradata:/opt/oracle/app/oradata/orcl
- oracle_fra:/opt/oracle/app/fast_recovery_area/orcl
- ~/app/docker/oracle-11g/dump:/opt/oracle/dpdump
- 作用:配置数据持久化和文件共享。
- 说明:
- 由于当前数据库中本身就包含数据,所以数据相关使用 docker 卷。
/opt/oracle/app/oradata/orcl:存储数据库文件(表空间、数据文件等)。/opt/oracle/app/fast_recovery_area/orcl:存储归档日志、备份文件等恢复相关数据。/opt/oracle/dpdump:容器内数据泵目录,存储导入/导出操作的文件。
7. 特权模式
privileged: true
- 作用:授予容器完全的宿主机权限
- 说明:
- Oracle 数据库安装和运行需要较高的系统权限
- 允许容器访问宿主机的设备和内核功能
- 注意:在生产环境中应谨慎使用
8. 重启策略
restart: unless-stopped
- 作用:定义容器退出时的重启行为
- 说明:
unless-stopped:除非手动停止,否则总是重启- 确保数据库服务在意外退出时自动恢复
- 提高服务的可靠性
9. 卷定义
volumes:
oracle_oradata:
oracle_fra:
- 作用:声明命名的 Docker 卷
- 说明:
oracle_oradata:用于数据库数据文件存储oracle_fra:用于快速恢复区文件存储- 这些卷由 Docker 管理,提供数据持久化
2.6 启动
当前要通过 Docker Compose 命令启动,但只能在文件所在目录执行命令,或者在命令中指明文件位置。对此,可以通过在 ~/.bashrc 增加命令别名(alias),简化命令。
lanyu@server:~$ vim ~/.bashrc
在文件最底部增加内容:
alias ora11g-compose='docker compose -f ~/app/docker/oracle-11g/oracle-11g-compose.yml'
修改后重新加载文件。
lanyu@server:~$ source ~/.bashrc
启动容器:
lanyu@server:~$ ora11g-compose up -d
[+] Running 4/4
✔ Network oracle11g_default Created 0.0s
✔ Volume "oracle11g_oracle_oradata" Created 0.0s
✔ Volume "oracle11g_oracle_fra" Created 0.0s
✔ Container oracle11g Started 8.9s
日志查看:
lanyu@server:~$ ora11g-compose logs
oracle11g | Checking shared memory...
oracle11g | Filesystem Size Used Avail Use% Mounted on
oracle11g | shm 64M 0 64M 0% /dev/shm
oracle11g | Starting listener...
oracle11g | tail: cannot open '/opt/oracle/app/diag/tnslsnr/aa33285b8df0/listener/trace/listener.log' for reading: No such file or directory
oracle11g | tail: cannot watch parent directory of '/opt/oracle/app/diag/tnslsnr/aa33285b8df0/listener/trace/listener.log': No such file or directory
oracle11g | tail: inotify cannot be used, reverting to polling
oracle11g | lsnrctl:
oracle11g | lsnrctl: LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 18-NOV-2025 07:38:23
oracle11g | lsnrctl:
oracle11g | lsnrctl: Copyright (c) 1991, 2013, Oracle. All rights reserved.
oracle11g | lsnrctl:
oracle11g | lsnrctl: Starting /opt/oracle/app/product/11.2.0/dbhome_1/bin/tnslsnr: please wait...
oracle11g | lsnrctl:
oracle11g | lsnrctl: TNSLSNR for Linux: Version 11.2.0.4.0 - Production
oracle11g | lsnrctl: Log messages written to /opt/oracle/app/diag/tnslsnr/aa33285b8df0/listener/alert/log.xml
oracle11g | lsnrctl: Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=aa33285b8df0)(PORT=1521)))
oracle11g | lsnrctl:
oracle11g | lsnrctl: Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
oracle11g | lsnrctl: STATUS of the LISTENER
oracle11g | lsnrctl: ------------------------
oracle11g | lsnrctl: Alias LISTENER
oracle11g | lsnrctl: Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production
oracle11g | lsnrctl: Start Date 18-NOV-2025 07:38:24
oracle11g | lsnrctl: Uptime 0 days 0 hr. 0 min. 0 sec
oracle11g | lsnrctl: Trace Level off
oracle11g | lsnrctl: Security ON: Local OS Authentication
oracle11g | lsnrctl: SNMP OFF
oracle11g | lsnrctl: Listener Log File /opt/oracle/app/diag/tnslsnr/aa33285b8df0/listener/alert/log.xml
oracle11g | lsnrctl: Listening Endpoints Summary...
oracle11g | lsnrctl: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=aa33285b8df0)(PORT=1521)))
oracle11g | lsnrctl: The listener supports no services
oracle11g | lsnrctl: The command completed successfully
oracle11g | Starting database...
oracle11g | tail: unrecognized file system type 0x794c7630 for '/opt/oracle/app/diag/rdbms/orcl/orcl/trace/alert_orcl.log'. please report this to bug-coreutils@gnu.org. reverting to polling
oracle11g | sqlplus:
oracle11g | sqlplus: SQL*Plus: Release 11.2.0.4.0 Production on Tue Nov 18 07:38:24 2025
oracle11g | sqlplus:
oracle11g | sqlplus: Copyright (c) 1982, 2013, Oracle. All rights reserved.
oracle11g | sqlplus:
oracle11g | sqlplus: Connected to an idle instance.
oracle11g | sqlplus:
oracle11g | sqlplus: SQL> Starting with pfile='/opt/oracle/app/product/11.2.0/dbhome_1/dbs/initorcl.ora' ...
oracle11g | tail: '/opt/oracle/app/diag/tnslsnr/aa33285b8df0/listener/trace/listener.log' has appeared; following end of new file
oracle11g | alertlog: Tue Nov 18 07:38:24 2025
oracle11g | alertlog: Starting ORACLE instance (normal)
oracle11g | alertlog: ************************ Large Pages Information *******************
oracle11g | alertlog: Per process system memlock (soft) limit = 8192 KB
oracle11g | alertlog:
oracle11g | alertlog: Total Shared Global Region in Large Pages = 0 KB (0%)
oracle11g | alertlog:
oracle11g | alertlog: Large Pages used by this instance: 0 (0 KB)
oracle11g | alertlog: Large Pages unused system wide = 0 (0 KB)
oracle11g | alertlog: Large Pages configured system wide = 0 (0 KB)
oracle11g | alertlog: Large Page size = 2048 KB
oracle11g | alertlog:
oracle11g | alertlog: RECOMMENDATION:
oracle11g | alertlog: Total System Global Area size is 502 MB. For optimal performance,
oracle11g | alertlog: prior to the next instance restart:
oracle11g | alertlog: 1. Increase the number of unused large pages by
oracle11g | alertlog: at least 251 (page size 2048 KB, total size 502 MB) system wide to
oracle11g | alertlog: get 100% of the System Global Area allocated with large pages
oracle11g | alertlog: 2. Large pages are automatically locked into physical memory.
oracle11g | alertlog: Increase the per process memlock (soft) limit to at least 510 MB to lock
oracle11g | alertlog: 100% System Global Area's large pages into physical memory
oracle11g | alertlog: ********************************************************************
oracle11g | alertlog: Errors in file /opt/oracle/app/diag/rdbms/orcl/orcl/trace/orcl_ora_33.trc:
oracle11g | alertlog: ORA-27167: Attempt to determine if Oracle binary image is stored on remote server failed
oracle11g | alertlog: ORA-27300: OS system dependent operation:parse_df failed with status: 2
oracle11g | alertlog: ORA-27301: OS failure message: No such file or directory
oracle11g | alertlog: ORA-27302: failure occurred at: parse failed
oracle11g | alertlog: ORA-27303: additional information: Filesystem 1K-blocks Used Available Use% Mounted on
oracle11g | alertlog: overlay 307438784 41700220 253077184 15% /
oracle11g | alertlog: Image consistency checking encountered an error, checking disabled
oracle11g | alertlog: LICENSE_MAX_SESSION = 0
oracle11g | alertlog: LICENSE_SESSIONS_WARNING = 0
oracle11g | alertlog: Initial number of CPU is 2
oracle11g | alertlog: Number of processor cores in the system is 2
oracle11g | alertlog: Number of processor sockets in the system is 2
oracle11g | alertlog: CELL communication is configured to use 0 interface(s):
oracle11g | alertlog: CELL IP affinity details:
oracle11g | alertlog: NUMA status: non-NUMA system
oracle11g | alertlog: cellaffinity.ora status: N/A
oracle11g | alertlog: CELL communication will use 1 IP group(s):
oracle11g | alertlog: Grp 0:
oracle11g | alertlog: Picked latch-free SCN scheme 3
oracle11g | alertlog: Using LOG_ARCHIVE_DEST_1 parameter default value as USE_DB_RECOVERY_FILE_DEST
oracle11g | alertlog: Autotune of undo retention is turned on.
oracle11g | alertlog: IMODE=BR
oracle11g | alertlog: ILAT =27
oracle11g | listener: Tue Nov 18 07:38:24 2025
oracle11g | listener: Create Relation ADR_CONTROL
oracle11g | listener: Create Relation ADR_INVALIDATION
oracle11g | listener: Create Relation INC_METER_IMPT_DEF
oracle11g | listener: Create Relation INC_METER_PK_IMPTS
oracle11g | listener: Log messages written to /opt/oracle/app/diag/tnslsnr/aa33285b8df0/listener/alert/log.xml
oracle11g | listener: Trace information written to /opt/oracle/app/diag/tnslsnr/aa33285b8df0/listener/trace/ora_25_135769878087488.trc
oracle11g | listener: Trace level is currently 0
oracle11g | listener:
oracle11g | listener: Started with pid=25
oracle11g | listener: Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=aa33285b8df0)(PORT=1521)))
oracle11g | listener: Listener completed notification to CRS on start
oracle11g | listener:
oracle11g | listener: TIMESTAMP * CONNECT DATA [* PROTOCOL INFO] * EVENT [* SID] * RETURN CODE
oracle11g | listener: WARNING: Subscription for node down event still pending
oracle11g | listener: 18-NOV-2025 07:38:24 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=aa33285b8df0)(USER=oracle))(COMMAND=status)(ARGUMENTS=64)(SERVICE=LISTENER)(VERSION=186647552)) * status * 0
oracle11g | alertlog: LICENSE_MAX_USERS = 0
oracle11g | alertlog: SYS auditing is disabled
oracle11g | alertlog: Starting up:
oracle11g | alertlog: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
oracle11g | listener: Dynamic address is already listened on (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=aa33285b8df0)(PORT=1521)))
oracle11g | listener: 18-NOV-2025 07:38:30 * service_register * orcl * 0
oracle11g | alertlog: With the Partitioning, OLAP, Data Mining and Real Application Testing options.
oracle11g | alertlog: ORACLE_HOME = /opt/oracle/app/product/11.2.0/dbhome_1
oracle11g | alertlog: System name: Linux
oracle11g | alertlog: Node name: aa33285b8df0
oracle11g | alertlog: Release: 6.8.0-53-generic
oracle11g | alertlog: Version: #55-Ubuntu SMP PREEMPT_DYNAMIC Fri Jan 17 15:37:52 UTC 2025
oracle11g | alertlog: Machine: x86_64
oracle11g | alertlog: VM name: VMWare Version: 6
oracle11g | alertlog: Using parameter settings in server-side spfile /opt/oracle/app/product/11.2.0/dbhome_1/dbs/spfileorcl.ora
oracle11g | alertlog: System parameters with non-default values:
oracle11g | alertlog: processes = 150
oracle11g | alertlog: sga_target = 500M
oracle11g | alertlog: memory_target = 0
oracle11g | alertlog: control_files = "/opt/oracle/app/oradata/orcl/control01.ctl"
oracle11g | alertlog: control_files = "/opt/oracle/app/fast_recovery_area/orcl/control02.ctl"
oracle11g | alertlog: db_block_size = 8192
oracle11g | alertlog: compatible = "11.2.0.4.0"
oracle11g | alertlog: db_recovery_file_dest = "/opt/oracle/app/fast_recovery_area"
oracle11g | alertlog: db_recovery_file_dest_size= 4182M
oracle11g | alertlog: undo_tablespace = "UNDOTBS1"
oracle11g | alertlog: remote_login_passwordfile= "EXCLUSIVE"
oracle11g | alertlog: db_domain = ""
oracle11g | alertlog: dispatchers = "(PROTOCOL=TCP) (SERVICE=orclXDB)"
oracle11g | alertlog: java_jit_enabled = FALSE
oracle11g | alertlog: audit_file_dest = "/opt/oracle/app/admin/orcl/adump"
oracle11g | alertlog: audit_trail = "DB"
oracle11g | alertlog: db_name = "orcl"
oracle11g | alertlog: open_cursors = 300
oracle11g | alertlog: pga_aggregate_target = 100M
oracle11g | alertlog: diagnostic_dest = "/opt/oracle/app"
oracle11g | alertlog: Tue Nov 18 07:38:30 2025
oracle11g | alertlog: PMON started with pid=2, OS id=36
oracle11g | alertlog: Tue Nov 18 07:38:30 2025
oracle11g | alertlog: PSP0 started with pid=3, OS id=38
oracle11g | sqlplus: SQL> ORACLE instance started.
oracle11g | sqlplus:
oracle11g | sqlplus: Total System Global Area 521936896 bytes
oracle11g | sqlplus: Fixed Size 2254824 bytes
oracle11g | sqlplus: Variable Size 209717272 bytes
oracle11g | sqlplus: Database Buffers 301989888 bytes
oracle11g | sqlplus: Redo Buffers 7974912 bytes
oracle11g | listener: 18-NOV-2025 07:38:31 * service_update * orcl * 0
oracle11g | alertlog: Tue Nov 18 07:38:31 2025
oracle11g | alertlog: VKTM started with pid=4, OS id=40 at elevated priority
oracle11g | alertlog: VKTM running at (1)millisec precision with DBRM quantum (100)ms
oracle11g | alertlog: Tue Nov 18 07:38:31 2025
oracle11g | alertlog: GEN0 started with pid=5, OS id=44
oracle11g | alertlog: Tue Nov 18 07:38:31 2025
oracle11g | alertlog: DIAG started with pid=6, OS id=46
oracle11g | alertlog: Tue Nov 18 07:38:31 2025
oracle11g | alertlog: DBRM started with pid=7, OS id=48
oracle11g | alertlog: Tue Nov 18 07:38:31 2025
oracle11g | alertlog: DIA0 started with pid=8, OS id=50
oracle11g | alertlog: Tue Nov 18 07:38:31 2025
oracle11g | alertlog: MMAN started with pid=9, OS id=52
oracle11g | alertlog: Tue Nov 18 07:38:31 2025
oracle11g | alertlog: DBW0 started with pid=10, OS id=54
oracle11g | alertlog: Tue Nov 18 07:38:31 2025
oracle11g | alertlog: LGWR started with pid=11, OS id=56
oracle11g | alertlog: Tue Nov 18 07:38:31 2025
oracle11g | alertlog: CKPT started with pid=12, OS id=58
oracle11g | alertlog: Tue Nov 18 07:38:31 2025
oracle11g | alertlog: SMON started with pid=13, OS id=60
oracle11g | alertlog: Tue Nov 18 07:38:31 2025
oracle11g | alertlog: RECO started with pid=14, OS id=62
oracle11g | alertlog: Tue Nov 18 07:38:31 2025
oracle11g | alertlog: MMON started with pid=15, OS id=64
oracle11g | alertlog: Tue Nov 18 07:38:31 2025
oracle11g | alertlog: MMNL started with pid=16, OS id=66
oracle11g | alertlog: starting up 1 dispatcher(s) for network address '(ADDRESS=(PARTIAL=YES)(PROTOCOL=TCP))'...
oracle11g | alertlog: starting up 1 shared server(s) ...
oracle11g | alertlog: ORACLE_BASE from environment = /opt/oracle/app
oracle11g | alertlog: Tue Nov 18 07:38:31 2025
oracle11g | alertlog: ALTER DATABASE MOUNT
oracle11g | sqlplus: Database mounted.
oracle11g | alertlog: Successful mount of redo thread 1, with mount id 1745285239
oracle11g | alertlog: Database mounted in Exclusive Mode
oracle11g | alertlog: Lost write protection disabled
oracle11g | alertlog: Completed: ALTER DATABASE MOUNT
oracle11g | alertlog: Tue Nov 18 07:38:35 2025
oracle11g | alertlog: ALTER DATABASE OPEN
oracle11g | alertlog: Beginning crash recovery of 1 threads
oracle11g | alertlog: parallel recovery started with 2 processes
oracle11g | alertlog: Started redo scan
oracle11g | alertlog: Completed redo scan
oracle11g | alertlog: read 52 KB redo, 36 data blocks need recovery
oracle11g | alertlog: Started redo application at
oracle11g | alertlog: Thread 1: logseq 7, block 3
oracle11g | alertlog: Recovery of Online Redo Log: Thread 1 Group 1 Seq 7 Reading mem 0
oracle11g | alertlog: Mem# 0: /opt/oracle/app/oradata/orcl/redo01.log
oracle11g | alertlog: Completed redo application of 0.04MB
oracle11g | alertlog: Completed crash recovery at
oracle11g | alertlog: Thread 1: logseq 7, block 107, scn 1024049
oracle11g | alertlog: 36 data blocks read, 36 data blocks written, 52 redo k-bytes read
oracle11g | alertlog: Thread 1 advanced to log sequence 8 (thread open)
oracle11g | sqlplus: Database opened.
oracle11g | sqlplus: SQL>
oracle11g | sqlplus: System altered.
oracle11g | sqlplus:
oracle11g | sqlplus: SQL> Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
oracle11g | sqlplus: With the Partitioning, OLAP, Data Mining and Real Application Testing options
oracle11g | listener: Tue Nov 18 07:38:36 2025
oracle11g | listener: 18-NOV-2025 07:38:36 * service_update * orcl * 0
oracle11g | listener: 18-NOV-2025 07:38:36 * service_update * orcl * 0
oracle11g | listener: 18-NOV-2025 07:38:36 * service_update * orcl * 0
oracle11g | alertlog: Thread 1 opened at log sequence 8
oracle11g | alertlog: Current log# 2 seq# 8 mem# 0: /opt/oracle/app/oradata/orcl/redo02.log
oracle11g | alertlog: Successful open of redo thread 1
oracle11g | alertlog: MTTR advisory is disabled because FAST_START_MTTR_TARGET is not set
oracle11g | alertlog: SMON: enabling cache recovery
oracle11g | alertlog: [76] Successfully onlined Undo Tablespace 2.
oracle11g | alertlog: Undo initialization finished serial:0 start:7024754 end:7024774 diff:20 (0 seconds)
oracle11g | alertlog: Verifying file header compatibility for 11g tablespace encryption..
oracle11g | alertlog: Verifying 11g file header compatibility for tablespace encryption completed
oracle11g | alertlog: SMON: enabling tx recovery
oracle11g | alertlog: Database Characterset is AL32UTF8
oracle11g | alertlog: No Resource Manager plan active
oracle11g | alertlog: replication_dependency_tracking turned off (no async multimaster replication found)
oracle11g | alertlog: Starting background process QMNC
oracle11g | alertlog: Tue Nov 18 07:38:36 2025
oracle11g | alertlog: QMNC started with pid=22, OS id=82
oracle11g | alertlog: Completed: ALTER DATABASE OPEN
oracle11g | alertlog: Tue Nov 18 07:38:36 2025
oracle11g | alertlog: db_recovery_file_dest_size of 4182 MB is 0.00% used. This is a
oracle11g | alertlog: user-specified limit on the amount of space that will be used by this
oracle11g | alertlog: database for recovery-related files, and does not reflect the amount of
oracle11g | alertlog: space available in the underlying filesystem or ASM diskgroup.
oracle11g | alertlog: Starting background process CJQ0
oracle11g | alertlog: Tue Nov 18 07:38:36 2025
oracle11g | alertlog: CJQ0 started with pid=24, OS id=96
oracle11g | listener: 18-NOV-2025 07:38:39 * service_update * orcl * 0
oracle11g | listener: Tue Nov 18 07:38:48 2025
oracle11g | listener: 18-NOV-2025 07:38:48 * service_update * orcl * 0
oracle11g | listener: Tue Nov 18 07:39:13 2025
oracle11g | listener: 18-NOV-2025 07:39:13 * service_update * orcl * 0
三、连接
3.1 用户信息
这些用户信息是初始就存在的。
OS 操作系统用户:
- root/install
- oracle/install
Oracle 数据库用户:
- SYS/5208
- SYSTEM/5208
- ODBA/5208
3.2 进入容器数据库
进入容器:
lanyu@server:~$ docker exec -it oracle11g bash
切换 oracle 用户:
[root@cc81d423f128 /]# su - oracle
Last login: Tue Nov 18 06:23:12 UTC 2025 on pts/0
连接到数据库:
# 以 SYSDBA 身份连接
[oracle@cc81d423f128 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Tue Nov 18 06:31:55 2025
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
3.2 修改管理员密码
当前数据库中所有用户的密码都是 5208,如果想要修改可以通过下面的语句进行修改,将每个语句中最后的 5208 改成你想要的新密码。
ALTER USER SYS IDENTIFIED BY 5208;
ALTER USER SYSTEM IDENTIFIED BY 5208;
3.3 密码策略
在 Oracle 11 中,默认的密码策略存在密码过期时间,但当前为 Docker 容器环境,所以密码需要设置为永不过期。
Alter PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;
如果有需要进行自动化脚本调试、安全测试和渗透测试等操作,可以设置密码登录尝试次数为不受限。
ALTER PROFILE DEFAULT LIMIT FAILED_LOGIN_ATTEMPTS UNLIMITED;
3.4 DBeaver 连接
除了直接进入容器外,还可以通过数据库管理工具连接,以下为 DBeaver 连接的配置内容。
