docker image ls
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
REPOSITORY TAG IMAGE ID CREATED SIZE
container-registry.oracle.com/mysql/community-server 9.1 f1f889678a73 6 months ago 606 MB
container-registry.oracle.com/database/express 18.4.0-xe 364598d20118 4 years ago 6.03 GB
docker logs -f oracle-18ex
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
ORACLE PASSWORD FOR SYS AND SYSTEM: oracledocker
Specify a password to be used for database accounts. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9]. Note that the same password will be used for SYS, SYSTEM and PDBADMIN accounts:
Confirm the password:
Configuring Oracle Listener.
Listener configuration succeeded.
Configuring Oracle Database XE.
Enter SYS user password:
****************
Enter SYSTEM user password:
*************
Enter PDBADMIN User Password:
*************
Prepare for db operation
7% complete
Copying database files
29% complete
Creating and starting Oracle instance
30% complete
31% complete
34% complete
38% complete
41% complete
43% complete
Completing Database Creation
47% complete
50% complete
Creating Pluggable Databases
54% complete
71% complete
Executing Post Configuration Actions
93% complete
Running Custom Scripts
100% complete
Database creation complete. For details check the logfiles at:
/opt/oracle/cfgtoollogs/dbca/XE.
Database Information:
Global Database Name:XE
System Identifier(SID):XE
Look at the log file "/opt/oracle/cfgtoollogs/dbca/XE/XE.log" for further details.
Connect to Oracle Database using one of the connect strings:
Pluggable database: bd127ae4faab/XEPDB1
Multitenant container database: bd127ae4faab
Use https://localhost:5500/em to access Oracle Enterprise Manager for Oracle Database XE
The Oracle base remains unchanged with value /opt/oracle
#########################
DATABASE IS READY TO USE!
#########################
The following output is now a tail of the alert.log:
2025-04-17T03:40:43.663079+00:00
XEPDB1(3):Resize operation completed for file# 10, old size 358400K, new size 368640K
2025-04-17T03:40:44.483587+00:00
XEPDB1(3):CREATE SMALLFILE TABLESPACE "USERS" LOGGING DATAFILE '/opt/oracle/oradata/XE/XEPDB1/users01.dbf' SIZE 5M REUSE AUTOEXTEND ON NEXT 1280K MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO
XEPDB1(3):Completed: CREATE SMALLFILE TABLESPACE "USERS" LOGGING DATAFILE '/opt/oracle/oradata/XE/XEPDB1/users01.dbf' SIZE 5M REUSE AUTOEXTEND ON NEXT 1280K MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO
XEPDB1(3):ALTER DATABASE DEFAULT TABLESPACE "USERS"
XEPDB1(3):Completed: ALTER DATABASE DEFAULT TABLESPACE "USERS"
2025-04-17T03:40:44.930766+00:00
ALTER PLUGGABLE DATABASE XEPDB1 SAVE STATE
Completed: ALTER PLUGGABLE DATABASE XEPDB1 SAVE STATE
登录容器中的 Oracle 数据库
在上面的输出中可以看到,安装时会默认创建如下数据库:
Database Information:
Global Database Name:XE
System Identifier(SID):XE
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
SQL*Plus: Release 18.0.0.0.0 - Production on Thu Apr 17 03:56:27 2025
Version 18.4.0.0.0
Copyright (c) 1982, 2018, Oracle. All rights reserved.
Last Successful login time: Thu Apr 17 2025 03:49:37 +00:00
Connected to:
Oracle Database 18c Express Edition Release 18.0.0.0.0 - Production
Version 18.4.0.0.0
SQL>
如果没有认证或提前在官网统一协议,则可能遇到如下报错:requested access to the resource is denied:
docker pull container-registry.oracle.com/database/enterprise:12.2.0.1
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
Trying to pull container-registry.oracle.com/database/enterprise:12.2.0.1...
Error: initializing source docker://container-registry.oracle.com/database/enterprise:12.2.0.1: reading manifest 12.2.0.1 in container-registry.oracle.com/database/enterprise: requested access to the resource is denied
docker exec -it oracle-1202ee sqlplus / as sysdba
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
Error: crun: executable file `sqlplus` not found in $PATH: No such file or directory: OCI runtime attempted to invoke a command that was not found
当前的绕过方案是,进入容器的bash,然后再执行即可:
[root@oracle-docker-test ~]# docker exec -it oracle-1202ee bash
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
[oracle@8bb1ec09ec5e /]$ sqlplus / as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on Fri Apr 18 02:37:30 2025
Copyright (c) 1982, 2016, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
SQL>