Oracle Database 19c EE on Docker

On April 25, 2019 Oracle Released Database version 19c for Linux and I took the time to build a Docker instance for it.

Below are the procedures I used to create my 19c Docker instance in my MACBOOK. If you need to get Docker installed in your MAC, here is a good reference as of today: https://docs.docker.com/v17.12/docker-for-mac/install

First download file V982063-01.zip from http://edelivery.oracle.com

I used Marcelo Ochoa pre-built dockerfiles and you can download it from below info:

$ git clone https://github.com/marcelo-ochoa/docker-images.git 
$ cd docker-images/OracleDatabase/SingleInstance/dockerfiles/
Alexs-MBP-BIAS:dockerfiles alexlima$ ls -la
total 40
drwxr-xr-x 8 mochoa mochoa 4096 feb 15 11:24 .
drwxr-xr-x 5 mochoa mochoa 4096 feb 15 11:24 ..
drwxr-xr-x 2 mochoa mochoa 4096 feb 15 11:24 11.2.0.2
drwxr-xr-x 2 mochoa mochoa 4096 feb 15 11:24 12.1.0.2
drwxr-xr-x 2 mochoa mochoa 4096 feb 15 11:24 12.2.0.1
drwxr-xr-x 2 mochoa mochoa 4096 feb 15 11:24 18.3.0
drwxr-xr-x 2 mochoa mochoa 4096 feb 15 11:24 18.4.0
drwxr-xr-x 2 mochoa mochoa 4096 feb 15 11:24 19.2.0
-rwxr-xr-x 1 mochoa mochoa 5145 feb 15 11:24 buildDockerImage.sh

Place the downloaded file V982063-01.zip inside the 19.2.0

Edit Dockerfile file inside the 19.2.0 folder, modify the parameter INSTALL_FILE_1 to INSTALL_FILE_1=”V982063-01.zip” if it’s not already modified.

Then execute buildDockerImage.sh

Alexs-MBP-BIAS:dockerfiles alexlima$ ls -lrt
total 16
drwxr-xr-x   8 alexlima  staff   256 Feb 18 15:13 11.2.0.2
drwxr-xr-x  18 alexlima  staff   576 Feb 18 15:13 12.1.0.2
drwxr-xr-x  16 alexlima  staff   512 Feb 18 15:13 12.2.0.1
drwxr-xr-x  16 alexlima  staff   512 Feb 18 15:13 18.3.0
drwxr-xr-x   8 alexlima  staff   256 Feb 18 15:13 18.4.0
drwxr-xr-x  15 alexlima  staff   480 Feb 18 15:13 19.2.0
-rwxr-xr-x   1 alexlima  staff  5145 Feb 18 15:13 buildDockerImage.sh
Alexs-MBP-BIAS:dockerfiles alexlima$ ./buildDockerImage.sh -v 19.2.0 -e
Ignored MD5 sum, 'md5sum' command not available.
==========================
DOCKER info:
Containers: 4
 Running: 3
 Paused: 0
 Stopped: 1
Images: 13
Server Version: 18.09.2
Storage Driver: overlay2
 Backing Filesystem: extfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
.........
.............
Successfully built 26cf314a8e52
Successfully tagged oracle/database:19.2.0-ee


  Oracle Database Docker Image for 'ee' version 19.2.0 is ready to be extended:

    --> oracle/database:19.2.0-ee

  Build completed in 697 seconds.

Feel free to see the image creation full logs here

Once the image is created start it with “run” command:

Alexs-MBP-BIAS:dockerfiles alexlima$ docker run -d --name AOFL-19c -p 1521:1521 -p 5500:5500 oracle/database:19.2.0-ee
ad576927f6511e3ca78d4e7b0b386e5762414ef9b9d2178a9e7c7c4b49e52075
Alexs-MBP-BIAS:dockerfiles alexlima$ docker ps
CONTAINER ID        IMAGE                       COMMAND                  CREATED             STATUS                             PORTS                                            NAMES
ad576927f651        oracle/database:19.2.0-ee   "/bin/sh -c 'exec $O…"   11 seconds ago      Up 10 seconds (health: starting)   0.0.0.0:1521->1521/tcp, 0.0.0.0:5500->5500/tcp   AOFL-19c

Login to the host and database


Alexs-MBP-BIAS:dockerfiles alexlima$ docker start AOFL-19c 
Alexs-MBP-BIAS:dockerfiles alexlima$ docker exec -it AOFL-19c /bin/bash
[oracle@ad576927f651 ~]$
[oracle@ad576927f651 ~]$ ps -ef | grep pmon
oracle     492     1  0 21:31 ?        00:00:00 ora_pmon_ORCLCDB
oracle     644   587  0 21:32 pts/0    00:00:00 grep --color=auto pmon
[oracle@ad576927f651 ~]$
[oracle@ad576927f651 ~]$ cat /etc/oratab
#
# This file is used by ORACLE utilities.  It is created by root.sh
# and updated by either Database Configuration Assistant while creating
# a database or ASM Configuration Assistant while creating ASM instance.

# A colon, ':', is used as the field terminator.  A new line terminates
# the entry.  Lines beginning with a pound sign, '#', are comments.
#
# Entries are of the form:
#   $ORACLE_SID:$ORACLE_HOME:<N|Y>:
#
# The first and second fields are the system identifier and home
# directory of the database respectively.  The third field indicates
# to the dbstart utility that the database should , "Y", or should not,
# "N", be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
ORCLCDB:/opt/oracle/product/19c/dbhome_1:N
[oracle@ad576927f651 ~]$
[oracle@ad576927f651 ~]$ . oraenv
ORACLE_SID = [] ? ORCLCDB
The Oracle base remains unchanged with value /opt/oracle

[oracle@ad576927f651 ~]$
[oracle@ad576927f651 ~]$ sqlplus '/as sysdba'

SQL*Plus: Release 19.0.0.0.0 - Production on Thu Apr 25 21:36:09 2019
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL> select banner from v$version;

BANNER
--------------------------------------------------------------------------------
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production

SQL> select instance_name, host_name, version from v$instance;

INSTANCE_NAME	 HOST_NAME							  VERSION
---------------- ---------------------------------------------------------------- -----------------
ORCLCDB 	 ad576927f651							 19.0.0.0.0

SQL> select file_name from dba_data_files;

FILE_NAME
----------------------------------------------------------------------------------
/opt/oracle/oradata/ORCLCDB/system01.dbf
/opt/oracle/oradata/ORCLCDB/sysaux01.dbf
/opt/oracle/oradata/ORCLCDB/undotbs01.dbf
/opt/oracle/oradata/ORCLCDB/users01.dbf

SQL> show pdbs

    CON_ID CON_NAME			  OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
	 2 PDB$SEED			  READ ONLY  NO
	 3 ORCLPDB1			  READ WRITE NO

SQL> alter session set container=ORCLPDB1;

Session altered.

SQL> select file_name from dba_data_files;

FILE_NAME
--------------------------------------------------------------------------------
/opt/oracle/oradata/ORCLCDB/ORCLPDB1/system01.dbf
/opt/oracle/oradata/ORCLCDB/ORCLPDB1/sysaux01.dbf
/opt/oracle/oradata/ORCLCDB/ORCLPDB1/undotbs01.dbf
/opt/oracle/oradata/ORCLCDB/ORCLPDB1/users01.dbf

SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
[oracle@ad576927f651 ~]$ df -h
Filesystem      Size  Used Avail Use% Mounted on
overlay          88G   64G   20G  77% /
tmpfs            64M     0   64M   0% /dev
tmpfs           1.5G     0  1.5G   0% /sys/fs/cgroup
/dev/sda1        88G   64G   20G  77% /etc/hosts
shm              64M     0   64M   0% /dev/shm
tmpfs           1.5G     0  1.5G   0% /proc/acpi
tmpfs           1.5G     0  1.5G   0% /sys/firmware
[oracle@ad576927f651 ~]$ cd /opt/
ORCLfmap/ oracle/
[oracle@ad576927f651 ~]$ cd /opt/oracle/
admin/             cfgtoollogs/       checkpoints/       dbca.rsp.tmpl      oraInventory/      product/           runUserScripts.sh  setPassword.sh
audit/             checkDBStatus.sh   createDB.sh        diag/              oradata/           runOracle.sh       scripts/           startDB.sh
[oracle@ad576927f651 ~]$ cd /opt/oracle/oradata/ORCLCDB/
[oracle@ad576927f651 ORCLCDB]$ ls
ORCLPDB1  control01.ctl  control02.ctl  pdbseed  redo01.log  redo02.log  redo03.log  sysaux01.dbf  system01.dbf  temp01.dbf  undotbs01.dbf  users01.dbf
[oracle@ad576927f651 ORCLCDB]$ ls -lrt
total 2449716
drwxr-x--- 2 oracle oinstall      4096 Apr 25 21:37 pdbseed
drwxr-x--- 2 oracle oinstall      4096 Apr 25 21:48 ORCLPDB1
-rw-r----- 1 oracle oinstall  33562624 Apr 25 22:01 temp01.dbf
-rw-r----- 1 oracle oinstall  18726912 Apr 25 22:53 control02.ctl
-rw-r----- 1 oracle oinstall 209715712 Apr 26 15:17 redo03.log
-rw-r----- 1 oracle oinstall 209715712 Apr 26 15:17 redo02.log
-rw-r----- 1 oracle oinstall   5251072 Apr 26 15:17 users01.dbf
-rw-r----- 1 oracle oinstall 346038272 Apr 26 15:17 undotbs01.dbf
-rw-r----- 1 oracle oinstall 943726592 Apr 26 15:17 system01.dbf
-rw-r----- 1 oracle oinstall 545267712 Apr 26 15:17 sysaux01.dbf
-rw-r----- 1 oracle oinstall 209715712 Apr 26 15:21 redo01.log
-rw-r----- 1 oracle oinstall  18726912 Apr 26 15:22 control01.ctl
[oracle@ad576927f651 ORCLCDB]$
[oracle@ad576927f651 ORCLCDB]$ cd ORCLPDB1/
[oracle@ad576927f651 ORCLPDB1]$ pwd
/opt/oracle/oradata/ORCLCDB/ORCLPDB1
[oracle@ad576927f651 ORCLPDB1]$ ls -lrt
total 722020
-rw-r----- 1 oracle oinstall  37756928 Apr 25 22:48 temp01.dbf
-rw-r----- 1 oracle oinstall   5251072 Apr 26 15:17 users01.dbf
-rw-r----- 1 oracle oinstall 104865792 Apr 26 16:22 undotbs01.dbf
-rw-r----- 1 oracle oinstall 283123712 Apr 26 16:22 system01.dbf
-rw-r----- 1 oracle oinstall 346038272 Apr 26 16:22 sysaux01.dbf
[oracle@ad576927f651 ORCLPDB1]$
Advertisements

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.