Deploy Oracle 18c Enterprise Edition or XE on Docker

  1. Download Oracle 18c XE from Oracles Website :
    https://www.oracle.com/database/technologies/xe-downloads.html
  2. Create Oracle Docker Project Directory

$ mkdir -p ~/oracle_docker

$ cd oracle_docker

$ git clone https://github.com/oracle/docker-images.git

$ cd docker-images

$ pwd
/Users/shadmha/oracle_docker/docker-images

$ cd ./OracleDatabase/SingleInstance/dockerfiles

  1. Copy the RPM downloaded for Oracle 18c from Oracle Website to 18.4.0 folder

$ cp ~/Downloads/oracle-database-xe-18c-1.0-1.x86_64.rpm ./18.4.0

$ pwd
/Users/shadmha/oracle_docker/docker-images/OracleDatabase/SingleInstance/dockerfiles

  1. Build the Oracle 18c XE Docker Image

$ sh buildDockerImage.sh -x -v 18.4.0

Checking Docker version.

DOCKER info:
Client:
Debug Mode: false
….
Successfully tagged oracle/database:18.4.0-xe

version: “3”
Oracle Database Docker Image for ‘xe’ version 18.4.0 is ready to be extended:

--> oracle/database:18.4.0-xe

Build completed in 752 seconds.

You will now have a docker image named oracle/database:18.4.0-xe which you can deploy to Docker as a container. The Oracle 18c XE image can be up-to 10GB so ensure you have the requisite space.

  1. Create a docker-compose.yml file and deploy the container
version: '3'
services:
 oracle:
 image: oracle/database:18.4.0-xe
 environment:
 - ORACLE_PWD=testing12345
 ports:
 - "11521:1521"

$ docker-compose up

Creating network “dockerfiles_default” with the default driver
Creating dockerfiles_oracle_1 … done
Attaching to dockerfiles_oracle_1

oracle_1 | Use https://localhost:5500/em to access Oracle Enterprise Manager for Oracle Database XE
oracle_1 | The Oracle base remains unchanged with value /opt/oracle
oracle_1 | #########################
oracle_1 | DATABASE IS READY TO USE!
oracle_1 | #########################
oracle_1 | The following output is now a tail of the alert.log:
oracle_1 | Pluggable database XEPDB1 opened read write
oracle_1 | Completed: alter pluggable database XEPDB1 open

The process can take up-to 15-20 mins for the container to start

  1. Connect using SQL Developer to your Oracle Xe Docker DB

Username : sys
Password : testing12345
Role : SYSDBA

Hostname : localhost
Port : 11521
Service Name : XE

== Connect to the Pluggable DB part of Oracle XE ==

Username : sys
Password : testing12345
Role : SYSDBA

Hostname : localhost
Port : 11521
Service Name : XEPDB1

=================================================================================================

Docker Procedure for Enteprise Edition Oracle. Only change is in Steps 3,4,5,6

=================================================================================================

  1. Download and Build the Oracle 18c EE Docker Image
    == Enterprise Edition Oracle Database 18c 18.3.0 ==
    Download Enterprise Edition Oracle Database Binary from Oracle Website For eg: 18.3 Linux : https://www.oracle.com/database/technologies/oracle18c-linux-180000-downloads.html

$ cp -p ~/Downloads/LINUX.X64_180000_db_home.zip ~/oracle_docker/docker-images/OracleDatabase/SingleInstance/dockerfiles/18.3.0/

$ cd ..

$ sh buildDockerImage.sh -e -v 18.3.0

-e Flag to install Enterprise Edition

Checking Docker version.

DOCKER info:
….
Successfully built fda25b164cd4
Successfully tagged oracle/database:18.3.0-ee

Oracle Database Docker Image for ‘ee’ version 18.3.0 is ready to be extended:
–> oracle/database:18.3.0-ee
Build completed in 2265 seconds.

  1. Now the Image build has been completed, now time to deploy the Enterprise Edition Oracle DB Container

$ pwd
/Users/shadmha/oracle_docker/docker-images/OracleDatabase/SingleInstance/dockerfiles

$ mkdir oracle_ee_18c
$ cd oracle_ee_18c
$ vim docker-compose.yml

version: '3'
services:
oracle:
image: oracle/database:18.3.0-ee
environment:
- ORACLE_PWD=testing12345
ports:
- "11522:1521"

$ docker-compose up

Creating network “oracle_ee_18c_default” with the default driver
Creating oracle_ee_18c_oracle_1 … done
Attaching to oracle_ee_18c_oracle_1
oracle_1 | ORACLE PASSWORD FOR SYS, SYSTEM AND PDBADMIN: testing12345

Database creation complete. For details check the logfiles at:
oracle_1 | /opt/oracle/cfgtoollogs/dbca/ORCLCDB.
oracle_1 | Database Information:
oracle_1 | Global Database Name:ORCLCDB
oracle_1 | System Identifier(SID):ORCLCDB
racle_1 | #########################
oracle_1 | DATABASE IS READY TO USE!
oracle_1 | #########################
oracle_1 | The following output is now a tail of the alert.log:
oracle_1 | ORCLPDB1(3):CREATE SMALLFILE TABLESPACE “USERS” LOGGING DATAFILE ‘/opt/oracle/oradata/ORCLCDB/ORCLPDB1/users01.dbf’ SIZE 5M REUSE AUTOEXTEND ON NEXT 1280K MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO
oracle_1 | ORCLPDB1(3):Completed: CREATE SMALLFILE TABLESPACE “USERS” LOGGING DATAFILE ‘/opt/oracle/oradata/ORCLCDB/ORCLPDB1/users01.dbf’ SIZE 5M REUSE AUTOEXTEND ON NEXT 1280K MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO
oracle_1 | ORCLPDB1(3):ALTER DATABASE DEFAULT TABLESPACE “USERS”
oracle_1 | ORCLPDB1(3):Completed: ALTER DATABASE DEFAULT TABLESPACE “USERS”
oracle_1 | 2020-02-16T04:47:06.581223+00:00
oracle_1 | ALTER SYSTEM SET control_files=’/opt/oracle/oradata/ORCLCDB/control01.ctl’ SCOPE=SPFILE;
oracle_1 | 2020-02-16T04:47:06.789543+00:00
oracle_1 | ALTER SYSTEM SET local_listener=” SCOPE=BOTH;
oracle_1 | ALTER PLUGGABLE DATABASE ORCLPDB1 SAVE STATE
oracle_1 | Completed: ALTER PLUGGABLE DATABASE ORCLPDB1 SAVE STATE

  1. Connect with SQL Developer

Username : sys
Password : testing12345
Role : SYSDBA

Hostname : localhost
Port : 11522
Service Name : ORCLCDB

== Connect to the Pluggable DB part of Oracle 18c EE ==

Username : sys
Password : testing12345
Role : SYSDBA

Hostname : localhost
Port : 11522
Service Name : ORCLPDB1

=================================================================================================

=================================================================================================

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s