Breadcrumb

Description

# Oracle Database Server Release 21c (21.3.0.0) Docker Image Documentation Oracle Database Server Release 21c is an industry leading relational database server. The Oracle Database server docker image contains Oracle Database server Release 21c (21.3.0.0) Enterprise or Standard Edition running on Oracle Linux 7. This image contains a default database in a multitenant configuration with one pluggable database. For more information on Oracle Database server Release 21c, refer to [http://docs.oracle.com/en/database/](http://docs.oracle.com/en/database/). ## Using This Image ### Starting an Oracle Database Server Instance To start an Oracle Database server instance, execute the following command where `<oracle-db>` is the name of the container: ``` $ docker run -d --name <oracle-db> container-registry.oracle.com/database/enterprise:21.3.0.0 ``` The auto-generated default password for connecting to the Oracle Database server instance can be found from the logs using `$ docker logs <oracle-db>` **Note:** Refer to the section titled "Changing the Default Password for SYS User" to obtain the password. Oracle Database server is ready to use when the `STATUS` field shows `(healthy)` in the `docker ps` output. ### Connecting to Oracle Database Server Container Once Oracle Database server indicates that the container has started and the `STATUS` field shows `(healthy),`client applications can connect to the database. ### Connecting from within the container You can connect to Oracle Database server by executing a SQL\*Plus command from within the container using one of the following commands: ``` $ docker exec -it <oracle-db> sqlplus / as sysdba ``` ``` $ docker exec -it <oracle-db> sqlplus sys/<your_password>@<your_SID> as sysdba ``` ``` $ docker exec -it <oracle-db> sqlplus system/<your_password>@<your_SID> ``` ``` $ docker exec -it <oracle-db> sqlplus pdbadmin/<your_password>@<your_PDBname> ``` ### Connecting from outside of the container By default, Oracle Database server exposes port 1521 for Oracle client connections over Oracle's SQL\*Net protocol. SQL\*Plus or any Oracle Java Database Connectivity (JDBC) client can be used to connect to the database server from outside of the container. To connect from outside of the container, start the container with `-p`option as described in the detailed docker run command in the section titled "Custom Configurations". Discover the mapped port by executing the following command: `$ docker port <oracle-db>` To connect from outside of the container using SQL\*Plus, execute the following: ``` $ sqlplus sys/<your_password>@//localhost:<exposed_port>/<your_SID> as sysdba ``` ``` $ sqlplus system/<your_password>@//localhost:<exposed_port>/<your_SID> ``` ``` $ sqlplus pdbadmin/<your_password>@//localhost:<exposed_port>/<your_PDBname> ``` ### Database Alert Logs You can access the database alert log using the following command where `<oracle-db>` is the name of the container: `$ docker logs <oracle-db>` ### Changing the Default Password for SYS User On the first startup of the container, a random password will be generated for the database if not provided. The user has to mandatorily change the password after the database is created and the corresponding container is healthy. Using the docker exec command, change the password for those accounts by invoking the setPassword.sh script that is found in the container. Note that the container must be running. For example: `$ docker exec <oracle-db> ./setPassword.sh <your_password>` This new password will be used afterwards. ### Custom Configurations Oracle Database server container also provides configuration parameters that can be used when starting the container. Following is the detailed docker run command supporting all custom configurations: ``` docker run -d --name <container_name> \ -p <host_port>:1521 -p <host_port>:5500 \ -e ORACLE_SID=<your_SID> \ -e ORACLE_PDB=<your_PDBname> \ -e ORACLE_PWD=<your_database_password> \ -e INIT_SGA_SIZE=<your_database_SGA_memory_MB> \ -e INIT_PGA_SIZE=<your_database_PGA_memory_MB> \ -e ORACLE_EDITION=<your_database_edition> \ -e ORACLE_CHARACTERSET=<your_character_set> \ -e ENABLE_ARCHIVELOG=true \ -v [<host_mount_point>:]/opt/oracle/oradata \ container-registry.oracle.com/database/enterprise:21.3.0.0 Parameters: --name: The name of the container (default: auto generated -p: The port mapping of the host port to the container port. Two ports are exposed: 1521 (Oracle Listener), 5500 (OEM Express) -e ORACLE_SID: The Oracle Database SID that should be used (default:ORCLCDB) -e ORACLE_PDB: The Oracle Database PDB name that should be used (default: ORCLPDB1) -e ORACLE_PWD: The Oracle Database SYS, SYSTEM and PDBADMIN password (default: auto generated) -e INIT_SGA_SIZE: The total memory in MB that should be used for all SGA components (optional) -e INIT_PGA_SIZE: The target aggregate PGA memory in MB that should be used for all server processes attached to the instance (optional) -e ORACLE_EDITION: The Oracle Database Edition (enterprise/standard, default: enterprise) -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 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. ``` The supported configuration options are: - ORACLE_SID This parameter changes the Oracle system identifier (SID) of the database. This parameter is optional and the default value is set to ORCLCDB. - ORACLE_PDB This parameter modifies the name of the pluggable database (PDB). This parameter is optional and the default value is set to ORCLPDB1. - ORACLE_PWD This parameter modifies the password for the SYS, SYSTEM and PDBADMIN users. This parameter is optional and the default value is randomly generated. This password can be changed later as described in the section titled "Changing the Default Password for SYS User". - INIT_SGA_SIZE This parameter modifies the memory in MB that should be used for all SGA components. This parameter is optional, and the default value is calculated during database creation if it isn¿t provided. The user can refer to the section titled ¿Setting the SGA and PGA memory¿ for more details. - INIT_PGA_SIZE This parameter modifies the target aggregate memory in MB that should be used for all server processes attached to the instance. This parameter is optional, and the default value is calculated during database creation if it isn¿t provided. The user can refer to the section titled ¿Setting the SGA and PGA memory¿ for more details. - ORACLE_EDITION This parameter modifies the edition of the database when the container is started for the first time. This parameter is optional and the two values are enterprise or standard. The default value is enterprise. - ORACLE_CHARACTERSET This parameter modifies the character set of the database. This parameter is optional and the default value is set to AL32UTF8. - ENABLE_ARCHIVELOG This parameter enables the ARCHIVELOG mode while creating the database for the first time. Default value of this parameter is false. ## Oracle Enterprise Manager Database Express Oracle Database inside the container also has Oracle Enterprise Manager Database Express (EM Express) configured. To access EM Express, start your browser using the following URL: https://localhost:5500/em/ ### Reusing the Existing Database Oracle Database server image uses docker data volumes to store data files, redo logs, audit logs, alert logs, and trace files. The data volume is mounted within the container at /opt/oracle/oradata. To start a database with a data volume, use the docker run command as follows: ``` $ docker run -d --name <oracle-db> -v OracleDBData:/opt/oracle/oradata container-registry.oracle.com/database/enterprise:21.3.0.0 ``` OracleDBData is the data volume that is created by docker and mounted within the container in the path /opt/oracle/oradata. During the first instance, data files are created in the new data volume. After the container is destroyed, the data files are kept persistent and can be reused to start another container with the same data files if the same ORACLE_SID parameter is provided. When using data volumes created by docker, the file system used by docker affects the performance of Oracle Database server. The performance on the ext4 file system is better as compared to that on the btrfs file system. To use a directory on the host system for the data volume, execute the following: ``` $ docker run -d --name <oracle-db> -v <writable_directory_path>:/opt/oracle/oradata container-registry.oracle.com/database/enterprise:21.3.0.0 ``` **Note:** If you provide standard as the value for the ORACLE_EDITION parameter while creating the data files for the first time, you must provide the same value when reusing those data files to start a new container. ### Setting the SGA and PGA memory The SGA and PGA memory can be set during the first time when database is created by passing the INIT_SGA_SIZE and INIT_PGA_SIZE parameters respectively to the docker run command. The user must provide the values in MB and without any units appended to the values (For example: -e INIT_SGA_SIZE=1536). These parameters are optional and if they aren't provided these values will be calculated automatically during database creation. In case these parameters are passed to the docker run command while reusing existing datafiles, even though these values would be visible in the container environment, they would not be set inside the database. The values used at the time of database creation will continue to be used. ### Performing operations that require Database Shutdown/Startup To perform operations on the database that require the restart of the database, use the maintenance shutdown/startup scripts, /home/oracle/shutDown.sh and /home/oracle/startUp.sh instead of issuing shutdown immediate and startup commands respectively as the latter would lead to exiting of the container. ## Caveats This docker image has the following restrictions: - This docker image release supports only a single database instance. - Oracle Data Guard is not supported. ### Resource Requirements The minimum requirements for the container is 21 GB of disk space and 2 GB of memory. ### Running Scripts After Setup and on Startup The docker images can be configured to run scripts after setup and on startup. Currently, .sh and .sql extensions are supported. For post-setup scripts, mount the volume /opt/oracle/scripts/setup to include scripts in this directory. For post-startup scripts, mount the volume /opt/oracle/scripts/startup to include scripts in this directory. Both of these locations are also represented by the symbolic link /docker-entrypoint-initdb.d. This provides synergy with other database docker images. You can decide whether to put the setup and startup scripts under /opt/oracle/scripts or /docker-entrypoint-initdb.d. After the database is set up or started, the scripts in those folders are executed against the database in the container. SQL scripts are executed as sysdba and shell scripts are executed as the current user. To ensure proper order, it is recommended that you prefix your scripts with a number. For example, 01_users.sql, 02_permissions.sql, and so on. **Note:** The startup scripts are executed after the first time that the database setup is complete. The following example mounts the local directory myScripts to /opt/oracle/scripts/startup which is then searched for custom startup scripts: ``` $ docker run -d --name <oracle-db> -v /home/oracle/myScripts:/opt/oracle/scripts/startup container-registry.oracle.com/database/enterprise:21.3.0.0 ``` ## Documentation Accessibility For information about Oracle's commitment to accessibility, visit the Oracle Accessibility Program website at http://www.oracle.com/pls/topic/lookup?ctx=acc&id-docacc. ### Access to Oracle Support Oracle customers that have purchased support have access to electronic support through My Oracle Support. For information, visit http://www.oracle.com/pls/topic/lookup?ctx=acc&id=info or visit http://www.oracle.com/pls/topic/lookup?ctx=acc&id=trs if you are hearing impaired. ______ Oracle Database Server Release 21c (21.3.0.0) Docker Image Documentation Copyright © 2006, 2021, Oracle and/or its affiliates. This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited. The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing. If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, then the following notice is applicable: U.S. GOVERNMENT END USERS: Oracle programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, delivered to U.S. Government end users are "commercial computer software" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, use, duplication, disclosure, modification, and adaptation of the programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, shall be subject to license terms and license restrictions applicable to the programs. No other rights are granted to the U.S. Government. This software or hardware is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherently dangerous applications, including applications that may create a risk of personal injury. If you use this software or hardware in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure its safe use. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software or hardware in dangerous applications. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners. Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. AMD, Opteron, the AMD logo, and the AMD Opteron logo are trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered trademark of The Open Group. This software or hardware and documentation may provide access to or information about content, products, and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services unless otherwise set forth in an applicable agreement between you and Oracle. Oracle Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services, except as set forth in an applicable agreement between you and Oracle.

Short URL for Repo

https://container-registry.oracle.com/ords/ocr/ba/database/enterprise

License Agreement (Not Logged In)

Please sign in using your Oracle Account to accept the license agreement for the Oracle container you have selected.

Pull Command for Latest

docker pull

Tags

TagOS/ArchitectureSizePull CommandLast UpdatedImage ID
19.3.0.0linux/amd643.38 GBdocker pull container-registry.oracle.com/database/enterprise:19.3.0.01.1 years ago291fd8c7958b
latestlinux/amd643.48 GBdocker pull container-registry.oracle.com/database/enterprise:latest1.1 years ago35e92315f1f8
21.3.0.0linux/amd643.48 GBdocker pull container-registry.oracle.com/database/enterprise:21.3.0.01.1 years ago35e92315f1f8
19.19.0.0linux/arm643.01 GBdocker pull container-registry.oracle.com/database/enterprise:19.19.0.01.2 years ago979416fa8cea
12.2.0.1linux/amd642.76 GBdocker pull container-registry.oracle.com/database/enterprise:12.2.0.17.1 years ago12a359cd0528
12.2.0.1-slimlinux/amd641.5 GBdocker pull container-registry.oracle.com/database/enterprise:12.2.0.1-slim7.1 years ago27c9559d36ec
12.1.0.2linux/amd644.65 GBdocker pull container-registry.oracle.com/database/enterprise:12.1.0.27.2 years agodb889cfe1e90