Sign inSign up

semon40/oracle-xe

By semon40

•Updated over 3 years ago

基于官方提供Dockerfile制作的Oracle XE 11.2.0.2 数据库精简版镜像文件

Image
0

42

semon40/oracle-xe repository overview

Oracle官方提供了当前支持的数据库版本镜像制作Git项目 https://github.com/oracle/docker-images⁠

本镜像为Oracle 11G 精简版制作数据库镜像,该版本默认SID为XE,不支持修改;

容器启动命令示例:

docker run  --memory=4g --shm-size=2g  -dti --name oracle11g   semon40/oracle-xe:11.2.0.2
# 指定容器分配内存
 --memory=4g 
# 指定容器分配共享内容
--shm-size=2g

基于本镜像创建容器时支持添加参数对数据库进行自定义配置;

docker run --name <container name> \
-p <host port>:1521 -p <host port>:5500 -p <host port>:2484 \
-e ORACLE_PDB=<your PDB name> \
-e ORACLE_PWD=<your database passwords> \
-e INIT_SGA_SIZE=<your database SGA memory in MB> \
-e INIT_PGA_SIZE=<your database PGA memory in MB> \
-e INIT_CPU_COUNT=<cpu_count init-parameter> \
-e INIT_PROCESSES=<processes init-parameter> \
-e ORACLE_EDITION=<your database edition> \
-e ORACLE_CHARACTERSET=<your character set> \
-e ENABLE_ARCHIVELOG=true \
-e ENABLE_TCPS=true \
-v [<host mount point>:]/opt/oracle/oradata \
oracle/database:21.3.0-ee

Parameters:
   --name:        The name of the container (default: auto generated).
   -p:            The port mapping of the host port to the container port.
                  The following ports are exposed: 1521 (Oracle Listener), 5500 (OEM Express), 2484 (TCPS Listener Port if TCPS is enabled).
   -e ORACLE_PWD: The Oracle Database SYS, SYSTEM and PDB_ADMIN password (default: auto generated).
   -e INIT_SGA_SIZE:
                  The total memory in MB that should be used for all SGA components (optional).
                  Supported by Oracle Database 19.3 onwards.
   -e INIT_PGA_SIZE:
                  The target aggregate PGA memory in MB that should be used for all server processes attached to the instance (optional).
                  Supported by Oracle Database 19.3 onwards.
   -e INIT_CPU_COUNT:
                  Specifies the number of CPUs available for Oracle Database to use. 
                  On CPUs with multiple CPU threads, it specifies the total number of available CPU threads (optional).
   -e INIT_PROCESSES:
                  Specifies the maximum number of operating system user processes that can simultaneously connect to Oracle Database. 
                  Its value should allow for all background processes such as locks, job queue processes, and parallel execution processes (optional).
   -e AUTO_MEM_CALCULATION:
                  To enable auto calculation of the DBCA total memory limit during the database creation, based on
                  the available memory of the container, which can be constrained using the `docker run --memory`
                  option. If set to 'false', the total memory will be set as 2GB (default: true).
                  Note that this parameter is not taken into account if the `-e INIT_SGA_SIZE` or `-e INIT_PGA_SIZE`
                  are set.
                  Supported by Oracle Database 19.3 onwards.
   -e ORACLE_CHARACTERSET:
                  The character set to use when creating the database (default: AL32UTF8).
   -e ENABLE_ARCHIVELOG:
                  To enable archive log mode when creating the database (default: false).
                  Supported by Oracle Database 19.3 onwards.
   -e ENABLE_TCPS:
                  To enable TCPS connections for Oracle Database.
                  Supported by Oracle Database 19.3 onwards.
   -v /opt/oracle/oradata
                  The data volume to use for the database.
                  Has to be writable by the Unix "oracle" (uid: 54321) user inside the container!
                  If omitted the database will not be persisted over container recreation.
   -v /opt/oracle/scripts/startup | /docker-entrypoint-initdb.d/startup
                  Optional: A volume with custom scripts to be run after database startup.
                  For further details see the "Running scripts after setup and on startup" section below.
  -v /opt/oracle/scripts/setup | /docker-entrypoint-initdb.d/setup
                  Optional: A volume with custom scripts to be run after database setup.
                  For further details see the "Running scripts after setup and on startup" section below.

当使用镜像创建容器成功后,可进入容器通过以下命令链接数据库:

sqlplus sys/<your password>@//localhost:1521/XE as sysdba
sqlplus system/<your password>@//localhost:1521/XE

Tag summary

Content type

Image

Digest

sha256:75de7824d…

Size

696 MB

Last updated

over 3 years ago

docker pull semon40/oracle-xe:11.2.0.2