SlideShare ist ein Scribd-Unternehmen logo
1 von 111
Best practices for
running
Oracle Database
on Docker
Gerald Venzl
Senior Principal Product Manager
Oracle Database Development
Twitter: @GeraldVenzl
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | 3
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
What is Docker?
• A software container platform
• Originated from Linux / Linux Containers
– Also available on Windows and Mac OS X
• Part of the Linux Open Container Initiative (OCI)
– Part of Open Source Linux
• Editions:
– Commercial Edition (EE) – Sold by Docker Corp
– Community Edition (CE) – Part of Open Source Linux
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
What is Docker?
• docker-engine: The engine running containers
• Images: Collection of software to be run as a container
• Containers: A container on the Linux host
• Registry: Place to store and download images
• Volumes: Place to persist data outside the container
Terminology
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Docker Key Components
Source: https://docs.docker.com/engine/docker-overview/
• Registry
• Images
• Containers
• Docker
daemon/engine
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Docker Key Components - Volumes
Source: https://docs.docker.com/engine/docker-overview/
• Registry
• Images
• Containers
• Docker
daemon/engine
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
What is Docker?
• Containers are non-persistent
– Once a container is deleted, all files inside that container are gone
Concepts
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
What is Docker?
• Containers are non-persistent
– Once a container is deleted, all files inside that container are gone
• Images are immutable
– Changes to an image require to build a new image
– Data to be persisted has to be stored in volumes
Concepts
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
What is Docker?
• Containers are non-persistent
– Once a container is deleted, all files inside that container are gone
• Images are immutable
– Changes to an image require to build a new image
– Data to be persisted has to be stored in volumes
• Containers are spun up from images
Concepts
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Why is Docker cool?
• Abstracts virtual environment (container) creation
into simple steps:
– docker create …
– docker run …
– docker rm …
• Runs directly on the Linux kernel (cgroups)
– Avoids the hypervisor overhead
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Why is Docker cool?
• Abstracts virtual environment (container) creation
into simple steps:
– docker create …
– docker run …
– docker rm …
• Runs directly on the Linux kernel (cgroups)
– Avoids the hypervisor overhead
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Why is Docker actually cool?
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Why is Docker actually cool?
• Allows abstraction of environments into images
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Why is Docker actually cool?
• Allows abstraction of environments into images
• Allows creation of hierarchical images
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Why is Docker actually cool?
• Allows abstraction of environments into images
• Allows creation of hierarchical images
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Why is Docker actually cool?
• Allows abstraction of environments into images
• Allows creation of hierarchical images
• Supports multi-layered image registries
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle MTO & Docker
App B App CApp A
App A App B App C
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle Database on Docker
• Oracle Database is fully supported on Docker
– Oracle Linux 7 - UEK 4
– Red Hat Enterprise Linux 7
• Oracle images on Oracle Container Registry & Docker Store
• Docker build files on GitHub
• RAC is not supported
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle Database on Docker
• Docker container contains single-PDB CDB (no MTO license required)
• PDB can be plugged, unplugged, etc.
• PDB can move bi-directional
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
BEST
PRACTICES
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Containers are not VMs!
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Containers are not VMs!
– No need to log into a container
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Containers are not VMs!
– No need to log into a container
– If you need to change something within the container  build a new image
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Containers are not VMs!
– No need to log into a container
– If you need to change something within the container  build a new image
– Example: Patching
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Use the latest Docker version but please, please, please, at least Docker
17.06
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Use the latest Docker version but please, please, please, at least Docker
17.06
• 115 bugs fixed in the last year, 24 bug fixes in 17.06 alone
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Use the latest Docker version but please, please, please, at least Docker
17.06
• 115 bugs fixed in the last year, 24 bug fixes in 17.06 alone
Step 16/17 : HEALTHCHECK --interval=1m --start-period=5m
CMD "$ORACLE_BASE/$CHECK_DB_FILE" >/dev/null || exit 1
Unknown flag: start-period There was an error building the
image.
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Use the latest Docker version but please, please, please, at least Docker
17.06
• 115 bugs fixed in the last year, 24 bug fixes in 17.06 alone
Step 16/17 : HEALTHCHECK --interval=1m --start-period=5m
CMD "$ORACLE_BASE/$CHECK_DB_FILE" >/dev/null || exit 1
Unknown flag: start-period There was an error building the
image.
• Healthcheck start-period introduced in 17.05 (Github issue #632)
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Use docker-engine on Oracle Linux
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Use docker-engine on Oracle Linux
• Fully supported by Oracle via Oracle Linux support
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Use docker-engine on Oracle Linux
• Fully supported by Oracle via Oracle Linux support
• Oracle Linux and docker-engine are fully free of charge for Oracle DB
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Use docker-engine on Oracle Linux
• Fully supported by Oracle via Oracle Linux support
• Oracle Linux and docker-engine are fully free of charge for Oracle DB
• Docker Corp only provides Docker EE for Oracle Linux (and Red Hat)
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Use docker-engine on Oracle Linux
• Fully supported by Oracle via Oracle Linux support
• Oracle Linux and docker-engine are fully free of charge for Oracle DB
• Docker Corp only provides Docker EE for Oracle Linux (and Red Hat)
• More recent docker-engine releases are in the “preview” yum repo
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Use btrfs (Oracle recommended) or overlay2 storage drivers
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Use btrfs (Oracle recommended) or overlay2 storage drivers
• overlay (Github issue #432)
bash-4.2# ls -ltr install
ls: cannot access install/checkSpace.sh: No such file or directory
ls: cannot access install/installDBBinaries.sh: No such file or directory
ls: cannot access install/installPerl.sh: No such file or directory
ls: cannot access install/setupLinuxEnv.sh: No such file or directory
ls: cannot access install/db_inst.rsp: No such file or directory
total 0
?????????? ? ? ? ? ? setupLinuxEnv.sh
?????????? ? ? ? ? ? installPerl.sh
?????????? ? ? ? ? ? installDBBinaries.sh
?????????? ? ? ? ? ? db_inst.rsp
?????????? ? ? ? ? ? checkSpace.sh
bash-4.2#
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Use btrfs (Oracle recommended) or overlay2 storage drivers
• aufs (Github issue #317)
mv: cannot move '/install/xe.rsp' to a subdirectory of itself,
'/u01/app/oracle/xe.rsp'**
Removing intermediate container 1dc7135ca679
The command 'mv $INSTALL_DIR/$CONFIG_RSP $ORACLE_BASE/ && mv
$INSTALL_DIR/$RUN_FILE ' returned a non-zero code: 1 There was an error
building the image.
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Do not use btrfs for data files storage
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Do not use btrfs for data files storage
• B-tree filesystem
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Do not use btrfs for data files storage
• B-tree filesystem
• Copy-on-write functionality
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Do not use btrfs for data files storage
• B-tree filesystem
• Copy-on-write functionality
• Transparent compression
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Do not use btrfs for data files storage
• B-tree filesystem
• Copy-on-write functionality
• Transparent compression
• Really not a good fit for your redo and undo
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Do not use btrfs for data files storage
• B-tree filesystem
• Copy-on-write functionality
• Transparent compression
• Really not a good fit for your redo and undo
• Also not really a good fit for data files either
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Do not use btrfs for data files storage
• B-tree filesystem
• Copy-on-write functionality
• Transparent compression
• Really not a good fit for your redo and undo
• Also not really a good fit for data files either
• Github issue #647
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Kernel parameters are global
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Kernel parameters are global
• You will have to set the kernel parameters correctly
– Considering each container
– On each Docker host those containers might run
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Kernel parameters are global
• You will have to set the kernel parameters correctly
– Considering each container
– On each Docker host those containers might run
sysctl: setting key "kernel.sem": Read-only file system
sysctl: setting key "fs.file-max": Read-only file system
Executing post-install steps... You must run '/etc/init.d/oracle-xe
configure' as the root user to configure the database.
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Kernel parameters are global
• You will have to set the kernel parameters correctly
– Considering each container
– On each Docker host those containers might run
• Can set them if the container runs in privileged mode, i.e. access
to the entire machine
sysctl: setting key "kernel.sem": Read-only file system
sysctl: setting key "fs.file-max": Read-only file system
Executing post-install steps... You must run '/etc/init.d/oracle-xe
configure' as the root user to configure the database.
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• SELinux policies are global
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• SELinux policies are global
• You will have to set SELinux policies correctly
– Considering each container
– On each Docker host those containers might run
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• /dev/shm mounted with no exec rights (and only 64MB by default)
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• /dev/shm mounted with no exec rights (and only 64MB by default)
• No native compiled PL/SQL
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• /dev/shm mounted with no exec rights (and only 64MB by default)
• No native compiled PL/SQL
• No Java stored procedures
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• /dev/shm mounted with no exec rights (and only 64MB by default)
• No native compiled PL/SQL
• No Java stored procedures
• No Automatic Memory Management
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• /dev/shm mounted with no exec rights (and only 64MB by default)
• No native compiled PL/SQL
• No Java stored procedures
• No Automatic Memory Management
• …
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• /dev/shm mounted with no exec rights (and only 64MB by default)
• No native compiled PL/SQL
• No Java stored procedures
• No Automatic Memory Management
• …
• docker run -v /dev/shm --tmpfs
/dev/shm:rw,nosuid,nodev,exec,size=1g ...
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Docker volumes
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Docker volumes contain data that should be persisted throughout a
container’s lifespan
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Docker volumes contain data that should be persisted throughout a
container’s lifespan
• Examples are:
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Docker volumes contain data that should be persisted throughout a
container’s lifespan
• Examples are:
– Configuration files
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Docker volumes contain data that should be persisted throughout a
container’s lifespan
• Examples are:
– Configuration files
– Log files
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Docker volumes contain data that should be persisted throughout a
container’s lifespan
• Examples are:
– Configuration files
– Log files
– Database files
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Docker volumes contain data that should be persisted throughout a
container’s lifespan
• Examples are:
– Configuration files
– Log files
– Database files
• Files inside a container are owned by the UID of the container’s user.
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Docker volumes contain data that should be persisted throughout a
container’s lifespan
• Examples are:
– Configuration files
– Log files
– Database files
• Files inside a container are owned by the UID of the container’s user.
– UID: 54321 for the oracle Unix user
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Docker volumes contain data that should be persisted throughout a
container’s lifespan
• Examples are:
– Configuration files
– Log files
– Database files
• Files inside a container are owned by the UID of the container’s user.
– UID: 54321 for the oracle Unix user
– Can be mapped to another UID with named volumes
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Docker Key Components - Volumes
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Three ways to create Docker volumes:
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Three ways to create Docker volumes:
• Anonymous volumes (no name specified)
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Three ways to create Docker volumes:
• Anonymous volumes (no name specified)
• Named volumes (a volume referred to by name)
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Three ways to create Docker volumes:
• Anonymous volumes (no name specified)
• Named volumes (a volume referred to by name)
• Host-only volume (a location on the host)
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
Anonymous volumes
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Are automatically created by Docker as soon as there is a VOLUME
instruction present in the Dockerfile
Anonymous volumes
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Are automatically created by Docker as soon as there is a VOLUME
instruction present in the Dockerfile
• Are not easily reusable across containers (you know, anonymous!)
Anonymous volumes
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Are automatically created by Docker as soon as there is a VOLUME
instruction present in the Dockerfile
• Are not easily reusable across containers (you know, anonymous!)
Anonymous volumes
"Type": "volume",
"Name":
"7a27a94df5192a20ec6a07502be9a2163faaa150e0076505937578ce785d5376",
"Source":
"/var/lib/docker/volumes/7a27a94df5192a20ec6a07502be9a2163faaa150e0076505937
578ce785d5376/_data",
"Destination": "/opt/oracle/oradata"
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
Named volumes
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Are explicitly created by the user using docker volume create
Named volumes
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Are explicitly created by the user using docker volume create
Named volumes
[oracle@localhost ~]$ docker volume create GeraldVol1
GeraldVol1
[oracle@localhost ~]$ docker volume inspect GeraldVol1
"Mountpoint": "/var/lib/docker/volumes/GeraldVol1/_data",
"Name": "GeraldVol1",
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Are explicitly created by the user using docker volume create
• Are great for making volumes specific
Named volumes
[oracle@localhost ~]$ docker volume create GeraldVol1
GeraldVol1
[oracle@localhost ~]$ docker volume inspect GeraldVol1
"Mountpoint": "/var/lib/docker/volumes/GeraldVol1/_data",
"Name": "GeraldVol1",
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Are explicitly created by the user using docker volume create
• Are great for making volumes specific
• Transparently copy data from the image into the volume first!
Named volumes
[oracle@localhost ~]$ docker volume create GeraldVol1
GeraldVol1
[oracle@localhost ~]$ docker volume inspect GeraldVol1
"Mountpoint": "/var/lib/docker/volumes/GeraldVol1/_data",
"Name": "GeraldVol1",
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Are explicitly created by the user using docker volume create
• Are great for making volumes specific
• Transparently copy data from the image into the volume first!
• But…
Named volumes
[oracle@localhost ~]$ docker volume create GeraldVol1
GeraldVol1
[oracle@localhost ~]$ docker volume inspect GeraldVol1
"Mountpoint": "/var/lib/docker/volumes/GeraldVol1/_data",
"Name": "GeraldVol1",
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Hold data in /var/lib/docker/volumes
Named volumes
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Hold data in /var/lib/docker/volumes
• Is usually owned by root
Named volumes
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Hold data in /var/lib/docker/volumes
• Is usually owned by root
• Contains all volumes of all containers
Named volumes
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Hold data in /var/lib/docker/volumes
• Is usually owned by root
– Do you really want to give a user root access?
• Contains all volumes of all containers
Named volumes
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Hold data in /var/lib/docker/volumes
• Is usually owned by root
– Do you really want to give a user root access?
• Contains all volumes of all containers
– Do you really want to give a user access to all volumes?
Named volumes
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
Host-only volumes
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Are created by specifying a location on the host
– docker run –v /home/gerald/volumes:…
Host-only volumes
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Are created by specifying a location on the host
– docker run –v /home/gerald/volumes:…
• Offer great flexibility where exactly volume data is being put
Host-only volumes
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Are created by specifying a location on the host
– docker run –v /home/gerald/volumes:…
• Offer great flexibility where exactly volume data is being put
• But…
Host-only volumes
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Do not transparently copy data from the image into volume first!
Host-only volumes
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Do not transparently copy data from the image into volume first!
• Have a static absolute path
Host-only volumes
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Do not transparently copy data from the image into volume first!
• Have a static absolute path
• You have to set permissions on the file system accordingly first!
Host-only volumes
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Do not transparently copy data from the image into volume first!
• Have a static absolute path
• You have to set permissions on the file system accordingly first!
• They are “host-only”, i.e not cluster aware (other than being put on a
SAN)
Host-only volumes
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• VOLUME instructions can’t be removed in child images.
Docker volumes
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• VOLUME instructions can’t be removed in child images.
• New --mount option was introduced with 17.06
Docker volumes
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• VOLUME instructions can’t be removed in child images.
• New --mount option was introduced with 17.06
– Allows passing on of multiple key/value pairs
Docker volumes
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
UNKNOWN
UNKNOWNS
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Github issue #601 – database is extremely slow
– PGA memory operation: Wait event for mmap and munmap Unix kernel
operations
Unknown unknowns
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Github issue #601 – database is extremely slow
– PGA memory operation: Wait event for mmap and munmap Unix kernel
operations
– ?
Unknown unknowns
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Github issue #601 – database is extremely slow
– PGA memory operation: Wait event for mmap and munmap Unix kernel
operations
– ?
• Github issue #525 – unable to connect / as sysdba when using
volumes on Windows 10
Unknown unknowns
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Github issue #601 – database is extremely slow
– PGA memory operation: Wait event for mmap and munmap Unix kernel
operations
– ?
• Github issue #525 – unable to connect / as sysdba when using
volumes on Windows 10
– ?
Unknown unknowns
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Github issue #601 – database is extremely slow
– PGA memory operation: Wait event for mmap and munmap Unix kernel
operations
– ?
• Github issue #525 – unable to connect / as sysdba when using
volumes on Windows 10
– ?
• Github issue #610 – “It was neither docker, nor Oracle scripts. The problem was
in CPU overclock which led to unstable executing of cp and unzip commands.
Restoring the original clock solved the problem.”
Unknown unknowns
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Github issue #601 – database is extremely slow
– PGA memory operation: Wait event for mmap and munmap Unix kernel
operations
– ?
• Github issue #525 – unable to connect / as sysdba when using
volumes on Windows 10
– ?
• Github issue #610 – “It was neither docker, nor Oracle scripts. The problem was
in CPU overclock which led to unstable executing of cp and unzip commands.
Restoring the original clock solved the problem.” ¯_(ツ)_/¯
Unknown unknowns
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Last but not least
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
Remember
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Use btrfs for Docker filesystem
Remember
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Use btrfs for Docker filesystem
• Use regular recommended filesystem for database files (ext4, xfs, etc)
– ASM is not supported!
Remember
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Use btrfs for Docker filesystem
• Use regular recommended filesystem for database files (ext4, xfs, etc)
– ASM is not supported!
• Use database features whenever possible
– resource manager, encryption, compression, etc.
Remember
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• Use btrfs for Docker filesystem
• Use regular recommended filesystem for database files (ext4, xfs, etc)
– ASM is not supported!
• Use database features whenever possible
– resource manager, encryption, compression, etc.
• Stop database containers gracefully
– Allow for higher timeout
Remember
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Oracle DB and Docker best practices
• PDBs can be plugged in and out of containers
– Great for patching
– Great for upgrade
– Great for placement flexibility
Oracle MTO & Docker – a great synergy
Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. |
Best practices for
running
Oracle Database
on Docker

Weitere ähnliche Inhalte

Was ist angesagt?

Docker Tutorial For Beginners | What Is Docker And How It Works? | Docker Tut...
Docker Tutorial For Beginners | What Is Docker And How It Works? | Docker Tut...Docker Tutorial For Beginners | What Is Docker And How It Works? | Docker Tut...
Docker Tutorial For Beginners | What Is Docker And How It Works? | Docker Tut...
Simplilearn
 

Was ist angesagt? (20)

Oracle Office Hours - Exposing REST services with APEX and ORDS
Oracle Office Hours - Exposing REST services with APEX and ORDSOracle Office Hours - Exposing REST services with APEX and ORDS
Oracle Office Hours - Exposing REST services with APEX and ORDS
 
Odi 12c-getting-started-guide-2032250
Odi 12c-getting-started-guide-2032250Odi 12c-getting-started-guide-2032250
Odi 12c-getting-started-guide-2032250
 
Dockerfile
Dockerfile Dockerfile
Dockerfile
 
Oracle GoldenGate Veridata 12cR2 セットアップガイド
Oracle GoldenGate Veridata 12cR2 セットアップガイドOracle GoldenGate Veridata 12cR2 セットアップガイド
Oracle GoldenGate Veridata 12cR2 セットアップガイド
 
Docker Tutorial For Beginners | What Is Docker And How It Works? | Docker Tut...
Docker Tutorial For Beginners | What Is Docker And How It Works? | Docker Tut...Docker Tutorial For Beginners | What Is Docker And How It Works? | Docker Tut...
Docker Tutorial For Beginners | What Is Docker And How It Works? | Docker Tut...
 
自律型データベース Oracle Autonomous Database 最新情報
自律型データベース Oracle Autonomous Database 最新情報自律型データベース Oracle Autonomous Database 最新情報
自律型データベース Oracle Autonomous Database 最新情報
 
Oracle GoldenGate on Docker
Oracle GoldenGate on DockerOracle GoldenGate on Docker
Oracle GoldenGate on Docker
 
Oracle REST Data Services: Options for your Web Services
Oracle REST Data Services: Options for your Web ServicesOracle REST Data Services: Options for your Web Services
Oracle REST Data Services: Options for your Web Services
 
Oracle Cloud Infrastructure:2023年2月度サービス・アップデート
Oracle Cloud Infrastructure:2023年2月度サービス・アップデートOracle Cloud Infrastructure:2023年2月度サービス・アップデート
Oracle Cloud Infrastructure:2023年2月度サービス・アップデート
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 
Oracle Integration Cloud 概要(20200507版)
Oracle Integration Cloud 概要(20200507版)Oracle Integration Cloud 概要(20200507版)
Oracle Integration Cloud 概要(20200507版)
 
Docker 101 : Introduction to Docker and Containers
Docker 101 : Introduction to Docker and ContainersDocker 101 : Introduction to Docker and Containers
Docker 101 : Introduction to Docker and Containers
 
Docker introduction for the beginners
Docker introduction for the beginnersDocker introduction for the beginners
Docker introduction for the beginners
 
Always on in sql server 2017
Always on in sql server 2017Always on in sql server 2017
Always on in sql server 2017
 
Docker basics
Docker basicsDocker basics
Docker basics
 
Docker on Docker
Docker on DockerDocker on Docker
Docker on Docker
 
Docker Commands With Examples | Docker Tutorial | DevOps Tutorial | Docker Tr...
Docker Commands With Examples | Docker Tutorial | DevOps Tutorial | Docker Tr...Docker Commands With Examples | Docker Tutorial | DevOps Tutorial | Docker Tr...
Docker Commands With Examples | Docker Tutorial | DevOps Tutorial | Docker Tr...
 
Yahoo! JAPANのOracle構成-2017年版
Yahoo! JAPANのOracle構成-2017年版Yahoo! JAPANのOracle構成-2017年版
Yahoo! JAPANのOracle構成-2017年版
 
Nabil Nawaz Oracle Oracle 12c Data Guard Deep Dive Presentation
Nabil Nawaz Oracle Oracle 12c Data Guard Deep Dive PresentationNabil Nawaz Oracle Oracle 12c Data Guard Deep Dive Presentation
Nabil Nawaz Oracle Oracle 12c Data Guard Deep Dive Presentation
 
Nick Fisk - low latency Ceph
Nick Fisk - low latency CephNick Fisk - low latency Ceph
Nick Fisk - low latency Ceph
 

Ähnlich wie Oracle Database on Docker - Best Practices

IBM Bluemix Paris Meetup #14 - Le Village by CA - 20160413 - Introduction Ă  D...
IBM Bluemix Paris Meetup #14 - Le Village by CA - 20160413 - Introduction Ă  D...IBM Bluemix Paris Meetup #14 - Le Village by CA - 20160413 - Introduction Ă  D...
IBM Bluemix Paris Meetup #14 - Le Village by CA - 20160413 - Introduction Ă  D...
IBM France Lab
 

Ähnlich wie Oracle Database on Docker - Best Practices (20)

Dockerizing Oracle Database
Dockerizing Oracle Database Dockerizing Oracle Database
Dockerizing Oracle Database
 
Running Oracle Database on Docker
Running Oracle Database on DockerRunning Oracle Database on Docker
Running Oracle Database on Docker
 
DevOps Supercharged with Docker on Exadata
DevOps Supercharged with Docker on ExadataDevOps Supercharged with Docker on Exadata
DevOps Supercharged with Docker on Exadata
 
Microcontainers and Tools for Hardcore Container Debugging
Microcontainers and Tools for Hardcore Container DebuggingMicrocontainers and Tools for Hardcore Container Debugging
Microcontainers and Tools for Hardcore Container Debugging
 
Michigan IT Symposium 2017 - Container BOF
Michigan IT Symposium 2017 - Container BOFMichigan IT Symposium 2017 - Container BOF
Michigan IT Symposium 2017 - Container BOF
 
Container Native Development Tools - Talk by Mickey Boxell
Container Native Development Tools - Talk by Mickey BoxellContainer Native Development Tools - Talk by Mickey Boxell
Container Native Development Tools - Talk by Mickey Boxell
 
Docker handons-workshop-for-charity
Docker handons-workshop-for-charityDocker handons-workshop-for-charity
Docker handons-workshop-for-charity
 
Using MySQL Containers
Using MySQL ContainersUsing MySQL Containers
Using MySQL Containers
 
Docker, what's next ?
Docker, what's next ?Docker, what's next ?
Docker, what's next ?
 
eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...
eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...
eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...
 
SQL Server in DevOps Town Hall Webinar
SQL Server in DevOps Town Hall WebinarSQL Server in DevOps Town Hall Webinar
SQL Server in DevOps Town Hall Webinar
 
Getting Started with Docker
Getting Started with DockerGetting Started with Docker
Getting Started with Docker
 
Docker 102 - Immutable Infrastructure
Docker 102 - Immutable InfrastructureDocker 102 - Immutable Infrastructure
Docker 102 - Immutable Infrastructure
 
Getting started with Docker
Getting started with DockerGetting started with Docker
Getting started with Docker
 
Containers and Microservices for Realists
Containers and Microservices for RealistsContainers and Microservices for Realists
Containers and Microservices for Realists
 
Containers and microservices for realists
Containers and microservices for realistsContainers and microservices for realists
Containers and microservices for realists
 
IBM Bluemix Paris Meetup #14 - Le Village by CA - 20160413 - Introduction Ă  D...
IBM Bluemix Paris Meetup #14 - Le Village by CA - 20160413 - Introduction Ă  D...IBM Bluemix Paris Meetup #14 - Le Village by CA - 20160413 - Introduction Ă  D...
IBM Bluemix Paris Meetup #14 - Le Village by CA - 20160413 - Introduction Ă  D...
 
Containers Docker Kind Kubernetes Istio
Containers Docker Kind Kubernetes IstioContainers Docker Kind Kubernetes Istio
Containers Docker Kind Kubernetes Istio
 
Containerization using docker and its applications
Containerization using docker and its applicationsContainerization using docker and its applications
Containerization using docker and its applications
 
Containerization using docker and its applications
Containerization using docker and its applicationsContainerization using docker and its applications
Containerization using docker and its applications
 

Mehr von gvenzl

Data Management in a Microservices World
Data Management in a Microservices WorldData Management in a Microservices World
Data Management in a Microservices World
gvenzl
 

Mehr von gvenzl (6)

Supercharge your Code to get optimal Database Performance
Supercharge your Code to get optimal Database PerformanceSupercharge your Code to get optimal Database Performance
Supercharge your Code to get optimal Database Performance
 
Data Management in a Microservices World
Data Management in a Microservices WorldData Management in a Microservices World
Data Management in a Microservices World
 
Top 10 SQL Performance tips & tricks for Java Developers
Top 10 SQL Performance tips & tricks for Java DevelopersTop 10 SQL Performance tips & tricks for Java Developers
Top 10 SQL Performance tips & tricks for Java Developers
 
Oracle Database features every developer should know about
Oracle Database features every developer should know aboutOracle Database features every developer should know about
Oracle Database features every developer should know about
 
Application Development with Oracle Database
Application Development with Oracle DatabaseApplication Development with Oracle Database
Application Development with Oracle Database
 
Developers vs DBAs - How to win the war
Developers vs DBAs - How to win the warDevelopers vs DBAs - How to win the war
Developers vs DBAs - How to win the war
 

KĂźrzlich hochgeladen

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

KĂźrzlich hochgeladen (20)

Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 

Oracle Database on Docker - Best Practices

  • 2. Gerald Venzl Senior Principal Product Manager Oracle Database Development Twitter: @GeraldVenzl
  • 3. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | 3
  • 4. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | What is Docker? • A software container platform • Originated from Linux / Linux Containers – Also available on Windows and Mac OS X • Part of the Linux Open Container Initiative (OCI) – Part of Open Source Linux • Editions: – Commercial Edition (EE) – Sold by Docker Corp – Community Edition (CE) – Part of Open Source Linux
  • 5. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | What is Docker? • docker-engine: The engine running containers • Images: Collection of software to be run as a container • Containers: A container on the Linux host • Registry: Place to store and download images • Volumes: Place to persist data outside the container Terminology
  • 6. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Docker Key Components Source: https://docs.docker.com/engine/docker-overview/ • Registry • Images • Containers • Docker daemon/engine
  • 7. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Docker Key Components - Volumes Source: https://docs.docker.com/engine/docker-overview/ • Registry • Images • Containers • Docker daemon/engine
  • 8. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | What is Docker? • Containers are non-persistent – Once a container is deleted, all files inside that container are gone Concepts
  • 9. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | What is Docker? • Containers are non-persistent – Once a container is deleted, all files inside that container are gone • Images are immutable – Changes to an image require to build a new image – Data to be persisted has to be stored in volumes Concepts
  • 10. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | What is Docker? • Containers are non-persistent – Once a container is deleted, all files inside that container are gone • Images are immutable – Changes to an image require to build a new image – Data to be persisted has to be stored in volumes • Containers are spun up from images Concepts
  • 11. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Why is Docker cool? • Abstracts virtual environment (container) creation into simple steps: – docker create … – docker run … – docker rm … • Runs directly on the Linux kernel (cgroups) – Avoids the hypervisor overhead
  • 12. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Why is Docker cool? • Abstracts virtual environment (container) creation into simple steps: – docker create … – docker run … – docker rm … • Runs directly on the Linux kernel (cgroups) – Avoids the hypervisor overhead
  • 13. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Why is Docker actually cool?
  • 14. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Why is Docker actually cool? • Allows abstraction of environments into images
  • 15. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Why is Docker actually cool? • Allows abstraction of environments into images • Allows creation of hierarchical images
  • 16. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Why is Docker actually cool? • Allows abstraction of environments into images • Allows creation of hierarchical images
  • 17. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Why is Docker actually cool? • Allows abstraction of environments into images • Allows creation of hierarchical images • Supports multi-layered image registries
  • 18. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle MTO & Docker App B App CApp A App A App B App C
  • 19. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle Database on Docker • Oracle Database is fully supported on Docker – Oracle Linux 7 - UEK 4 – Red Hat Enterprise Linux 7 • Oracle images on Oracle Container Registry & Docker Store • Docker build files on GitHub • RAC is not supported
  • 20. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle Database on Docker • Docker container contains single-PDB CDB (no MTO license required) • PDB can be plugged, unplugged, etc. • PDB can move bi-directional
  • 21. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | BEST PRACTICES
  • 22. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Containers are not VMs!
  • 23. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Containers are not VMs! – No need to log into a container
  • 24. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Containers are not VMs! – No need to log into a container – If you need to change something within the container  build a new image
  • 25. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Containers are not VMs! – No need to log into a container – If you need to change something within the container  build a new image – Example: Patching
  • 26. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Use the latest Docker version but please, please, please, at least Docker 17.06
  • 27. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Use the latest Docker version but please, please, please, at least Docker 17.06 • 115 bugs fixed in the last year, 24 bug fixes in 17.06 alone
  • 28. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Use the latest Docker version but please, please, please, at least Docker 17.06 • 115 bugs fixed in the last year, 24 bug fixes in 17.06 alone Step 16/17 : HEALTHCHECK --interval=1m --start-period=5m CMD "$ORACLE_BASE/$CHECK_DB_FILE" >/dev/null || exit 1 Unknown flag: start-period There was an error building the image.
  • 29. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Use the latest Docker version but please, please, please, at least Docker 17.06 • 115 bugs fixed in the last year, 24 bug fixes in 17.06 alone Step 16/17 : HEALTHCHECK --interval=1m --start-period=5m CMD "$ORACLE_BASE/$CHECK_DB_FILE" >/dev/null || exit 1 Unknown flag: start-period There was an error building the image. • Healthcheck start-period introduced in 17.05 (Github issue #632)
  • 30. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Use docker-engine on Oracle Linux
  • 31. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Use docker-engine on Oracle Linux • Fully supported by Oracle via Oracle Linux support
  • 32. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Use docker-engine on Oracle Linux • Fully supported by Oracle via Oracle Linux support • Oracle Linux and docker-engine are fully free of charge for Oracle DB
  • 33. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Use docker-engine on Oracle Linux • Fully supported by Oracle via Oracle Linux support • Oracle Linux and docker-engine are fully free of charge for Oracle DB • Docker Corp only provides Docker EE for Oracle Linux (and Red Hat)
  • 34. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Use docker-engine on Oracle Linux • Fully supported by Oracle via Oracle Linux support • Oracle Linux and docker-engine are fully free of charge for Oracle DB • Docker Corp only provides Docker EE for Oracle Linux (and Red Hat) • More recent docker-engine releases are in the “preview” yum repo
  • 35. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Use btrfs (Oracle recommended) or overlay2 storage drivers
  • 36. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Use btrfs (Oracle recommended) or overlay2 storage drivers • overlay (Github issue #432) bash-4.2# ls -ltr install ls: cannot access install/checkSpace.sh: No such file or directory ls: cannot access install/installDBBinaries.sh: No such file or directory ls: cannot access install/installPerl.sh: No such file or directory ls: cannot access install/setupLinuxEnv.sh: No such file or directory ls: cannot access install/db_inst.rsp: No such file or directory total 0 ?????????? ? ? ? ? ? setupLinuxEnv.sh ?????????? ? ? ? ? ? installPerl.sh ?????????? ? ? ? ? ? installDBBinaries.sh ?????????? ? ? ? ? ? db_inst.rsp ?????????? ? ? ? ? ? checkSpace.sh bash-4.2#
  • 37. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Use btrfs (Oracle recommended) or overlay2 storage drivers • aufs (Github issue #317) mv: cannot move '/install/xe.rsp' to a subdirectory of itself, '/u01/app/oracle/xe.rsp'** Removing intermediate container 1dc7135ca679 The command 'mv $INSTALL_DIR/$CONFIG_RSP $ORACLE_BASE/ && mv $INSTALL_DIR/$RUN_FILE ' returned a non-zero code: 1 There was an error building the image.
  • 38. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Do not use btrfs for data files storage
  • 39. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Do not use btrfs for data files storage • B-tree filesystem
  • 40. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Do not use btrfs for data files storage • B-tree filesystem • Copy-on-write functionality
  • 41. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Do not use btrfs for data files storage • B-tree filesystem • Copy-on-write functionality • Transparent compression
  • 42. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Do not use btrfs for data files storage • B-tree filesystem • Copy-on-write functionality • Transparent compression • Really not a good fit for your redo and undo
  • 43. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Do not use btrfs for data files storage • B-tree filesystem • Copy-on-write functionality • Transparent compression • Really not a good fit for your redo and undo • Also not really a good fit for data files either
  • 44. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Do not use btrfs for data files storage • B-tree filesystem • Copy-on-write functionality • Transparent compression • Really not a good fit for your redo and undo • Also not really a good fit for data files either • Github issue #647
  • 45. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Kernel parameters are global
  • 46. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Kernel parameters are global • You will have to set the kernel parameters correctly – Considering each container – On each Docker host those containers might run
  • 47. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Kernel parameters are global • You will have to set the kernel parameters correctly – Considering each container – On each Docker host those containers might run sysctl: setting key "kernel.sem": Read-only file system sysctl: setting key "fs.file-max": Read-only file system Executing post-install steps... You must run '/etc/init.d/oracle-xe configure' as the root user to configure the database.
  • 48. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Kernel parameters are global • You will have to set the kernel parameters correctly – Considering each container – On each Docker host those containers might run • Can set them if the container runs in privileged mode, i.e. access to the entire machine sysctl: setting key "kernel.sem": Read-only file system sysctl: setting key "fs.file-max": Read-only file system Executing post-install steps... You must run '/etc/init.d/oracle-xe configure' as the root user to configure the database.
  • 49. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • SELinux policies are global
  • 50. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • SELinux policies are global • You will have to set SELinux policies correctly – Considering each container – On each Docker host those containers might run
  • 51. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • /dev/shm mounted with no exec rights (and only 64MB by default)
  • 52. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • /dev/shm mounted with no exec rights (and only 64MB by default) • No native compiled PL/SQL
  • 53. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • /dev/shm mounted with no exec rights (and only 64MB by default) • No native compiled PL/SQL • No Java stored procedures
  • 54. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • /dev/shm mounted with no exec rights (and only 64MB by default) • No native compiled PL/SQL • No Java stored procedures • No Automatic Memory Management
  • 55. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • /dev/shm mounted with no exec rights (and only 64MB by default) • No native compiled PL/SQL • No Java stored procedures • No Automatic Memory Management • …
  • 56. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • /dev/shm mounted with no exec rights (and only 64MB by default) • No native compiled PL/SQL • No Java stored procedures • No Automatic Memory Management • … • docker run -v /dev/shm --tmpfs /dev/shm:rw,nosuid,nodev,exec,size=1g ...
  • 57. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Docker volumes
  • 58. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Docker volumes contain data that should be persisted throughout a container’s lifespan
  • 59. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Docker volumes contain data that should be persisted throughout a container’s lifespan • Examples are:
  • 60. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Docker volumes contain data that should be persisted throughout a container’s lifespan • Examples are: – Configuration files
  • 61. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Docker volumes contain data that should be persisted throughout a container’s lifespan • Examples are: – Configuration files – Log files
  • 62. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Docker volumes contain data that should be persisted throughout a container’s lifespan • Examples are: – Configuration files – Log files – Database files
  • 63. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Docker volumes contain data that should be persisted throughout a container’s lifespan • Examples are: – Configuration files – Log files – Database files • Files inside a container are owned by the UID of the container’s user.
  • 64. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Docker volumes contain data that should be persisted throughout a container’s lifespan • Examples are: – Configuration files – Log files – Database files • Files inside a container are owned by the UID of the container’s user. – UID: 54321 for the oracle Unix user
  • 65. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Docker volumes contain data that should be persisted throughout a container’s lifespan • Examples are: – Configuration files – Log files – Database files • Files inside a container are owned by the UID of the container’s user. – UID: 54321 for the oracle Unix user – Can be mapped to another UID with named volumes
  • 66. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Docker Key Components - Volumes
  • 67. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Three ways to create Docker volumes:
  • 68. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Three ways to create Docker volumes: • Anonymous volumes (no name specified)
  • 69. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Three ways to create Docker volumes: • Anonymous volumes (no name specified) • Named volumes (a volume referred to by name)
  • 70. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Three ways to create Docker volumes: • Anonymous volumes (no name specified) • Named volumes (a volume referred to by name) • Host-only volume (a location on the host)
  • 71. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices Anonymous volumes
  • 72. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Are automatically created by Docker as soon as there is a VOLUME instruction present in the Dockerfile Anonymous volumes
  • 73. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Are automatically created by Docker as soon as there is a VOLUME instruction present in the Dockerfile • Are not easily reusable across containers (you know, anonymous!) Anonymous volumes
  • 74. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Are automatically created by Docker as soon as there is a VOLUME instruction present in the Dockerfile • Are not easily reusable across containers (you know, anonymous!) Anonymous volumes "Type": "volume", "Name": "7a27a94df5192a20ec6a07502be9a2163faaa150e0076505937578ce785d5376", "Source": "/var/lib/docker/volumes/7a27a94df5192a20ec6a07502be9a2163faaa150e0076505937 578ce785d5376/_data", "Destination": "/opt/oracle/oradata"
  • 75. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices Named volumes
  • 76. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Are explicitly created by the user using docker volume create Named volumes
  • 77. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Are explicitly created by the user using docker volume create Named volumes [oracle@localhost ~]$ docker volume create GeraldVol1 GeraldVol1 [oracle@localhost ~]$ docker volume inspect GeraldVol1 "Mountpoint": "/var/lib/docker/volumes/GeraldVol1/_data", "Name": "GeraldVol1",
  • 78. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Are explicitly created by the user using docker volume create • Are great for making volumes specific Named volumes [oracle@localhost ~]$ docker volume create GeraldVol1 GeraldVol1 [oracle@localhost ~]$ docker volume inspect GeraldVol1 "Mountpoint": "/var/lib/docker/volumes/GeraldVol1/_data", "Name": "GeraldVol1",
  • 79. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Are explicitly created by the user using docker volume create • Are great for making volumes specific • Transparently copy data from the image into the volume first! Named volumes [oracle@localhost ~]$ docker volume create GeraldVol1 GeraldVol1 [oracle@localhost ~]$ docker volume inspect GeraldVol1 "Mountpoint": "/var/lib/docker/volumes/GeraldVol1/_data", "Name": "GeraldVol1",
  • 80. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Are explicitly created by the user using docker volume create • Are great for making volumes specific • Transparently copy data from the image into the volume first! • But… Named volumes [oracle@localhost ~]$ docker volume create GeraldVol1 GeraldVol1 [oracle@localhost ~]$ docker volume inspect GeraldVol1 "Mountpoint": "/var/lib/docker/volumes/GeraldVol1/_data", "Name": "GeraldVol1",
  • 81. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Hold data in /var/lib/docker/volumes Named volumes
  • 82. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Hold data in /var/lib/docker/volumes • Is usually owned by root Named volumes
  • 83. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Hold data in /var/lib/docker/volumes • Is usually owned by root • Contains all volumes of all containers Named volumes
  • 84. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Hold data in /var/lib/docker/volumes • Is usually owned by root – Do you really want to give a user root access? • Contains all volumes of all containers Named volumes
  • 85. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Hold data in /var/lib/docker/volumes • Is usually owned by root – Do you really want to give a user root access? • Contains all volumes of all containers – Do you really want to give a user access to all volumes? Named volumes
  • 86. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices Host-only volumes
  • 87. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Are created by specifying a location on the host – docker run –v /home/gerald/volumes:… Host-only volumes
  • 88. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Are created by specifying a location on the host – docker run –v /home/gerald/volumes:… • Offer great flexibility where exactly volume data is being put Host-only volumes
  • 89. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Are created by specifying a location on the host – docker run –v /home/gerald/volumes:… • Offer great flexibility where exactly volume data is being put • But… Host-only volumes
  • 90. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Do not transparently copy data from the image into volume first! Host-only volumes
  • 91. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Do not transparently copy data from the image into volume first! • Have a static absolute path Host-only volumes
  • 92. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Do not transparently copy data from the image into volume first! • Have a static absolute path • You have to set permissions on the file system accordingly first! Host-only volumes
  • 93. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Do not transparently copy data from the image into volume first! • Have a static absolute path • You have to set permissions on the file system accordingly first! • They are “host-only”, i.e not cluster aware (other than being put on a SAN) Host-only volumes
  • 94. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • VOLUME instructions can’t be removed in child images. Docker volumes
  • 95. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • VOLUME instructions can’t be removed in child images. • New --mount option was introduced with 17.06 Docker volumes
  • 96. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • VOLUME instructions can’t be removed in child images. • New --mount option was introduced with 17.06 – Allows passing on of multiple key/value pairs Docker volumes
  • 97. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | UNKNOWN UNKNOWNS
  • 98. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Github issue #601 – database is extremely slow – PGA memory operation: Wait event for mmap and munmap Unix kernel operations Unknown unknowns
  • 99. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Github issue #601 – database is extremely slow – PGA memory operation: Wait event for mmap and munmap Unix kernel operations – ? Unknown unknowns
  • 100. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Github issue #601 – database is extremely slow – PGA memory operation: Wait event for mmap and munmap Unix kernel operations – ? • Github issue #525 – unable to connect / as sysdba when using volumes on Windows 10 Unknown unknowns
  • 101. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Github issue #601 – database is extremely slow – PGA memory operation: Wait event for mmap and munmap Unix kernel operations – ? • Github issue #525 – unable to connect / as sysdba when using volumes on Windows 10 – ? Unknown unknowns
  • 102. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Github issue #601 – database is extremely slow – PGA memory operation: Wait event for mmap and munmap Unix kernel operations – ? • Github issue #525 – unable to connect / as sysdba when using volumes on Windows 10 – ? • Github issue #610 – “It was neither docker, nor Oracle scripts. The problem was in CPU overclock which led to unstable executing of cp and unzip commands. Restoring the original clock solved the problem.” Unknown unknowns
  • 103. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Github issue #601 – database is extremely slow – PGA memory operation: Wait event for mmap and munmap Unix kernel operations – ? • Github issue #525 – unable to connect / as sysdba when using volumes on Windows 10 – ? • Github issue #610 – “It was neither docker, nor Oracle scripts. The problem was in CPU overclock which led to unstable executing of cp and unzip commands. Restoring the original clock solved the problem.” ÂŻ_(ツ)_/ÂŻ Unknown unknowns
  • 104. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Last but not least
  • 105. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices Remember
  • 106. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Use btrfs for Docker filesystem Remember
  • 107. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Use btrfs for Docker filesystem • Use regular recommended filesystem for database files (ext4, xfs, etc) – ASM is not supported! Remember
  • 108. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Use btrfs for Docker filesystem • Use regular recommended filesystem for database files (ext4, xfs, etc) – ASM is not supported! • Use database features whenever possible – resource manager, encryption, compression, etc. Remember
  • 109. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • Use btrfs for Docker filesystem • Use regular recommended filesystem for database files (ext4, xfs, etc) – ASM is not supported! • Use database features whenever possible – resource manager, encryption, compression, etc. • Stop database containers gracefully – Allow for higher timeout Remember
  • 110. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Oracle DB and Docker best practices • PDBs can be plugged in and out of containers – Great for patching – Great for upgrade – Great for placement flexibility Oracle MTO & Docker – a great synergy
  • 111. Copyright Š 2017 Oracle and/or its affiliates. All rights reserved. | Best practices for running Oracle Database on Docker