SlideShare uma empresa Scribd logo
1 de 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

Mais conteúdo relacionado

Mais procurados

Oracle GoldenGate Architecture Performance
Oracle GoldenGate Architecture PerformanceOracle GoldenGate Architecture Performance
Oracle GoldenGate Architecture Performance
Enkitec
 

Mais procurados (20)

The Oracle RAC Family of Solutions - Presentation
The Oracle RAC Family of Solutions - PresentationThe Oracle RAC Family of Solutions - Presentation
The Oracle RAC Family of Solutions - Presentation
 
Understanding Oracle RAC 12c Internals OOW13 [CON8806]
Understanding Oracle RAC 12c Internals OOW13 [CON8806]Understanding Oracle RAC 12c Internals OOW13 [CON8806]
Understanding Oracle RAC 12c Internals OOW13 [CON8806]
 
MAA Best Practices for Oracle Database 19c
MAA Best Practices for Oracle Database 19cMAA Best Practices for Oracle Database 19c
MAA Best Practices for Oracle Database 19c
 
Part5 sql tune
Part5 sql tunePart5 sql tune
Part5 sql tune
 
Migration to Oracle Multitenant
Migration to Oracle MultitenantMigration to Oracle Multitenant
Migration to Oracle Multitenant
 
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 GoldenGate Architecture Performance
Oracle GoldenGate Architecture PerformanceOracle GoldenGate Architecture Performance
Oracle GoldenGate Architecture Performance
 
MySQL InnoDB Cluster / ReplicaSet - Tutorial
MySQL InnoDB Cluster / ReplicaSet - TutorialMySQL InnoDB Cluster / ReplicaSet - Tutorial
MySQL InnoDB Cluster / ReplicaSet - Tutorial
 
Rac questions
Rac questionsRac questions
Rac questions
 
The Top 5 Reasons to Deploy Your Applications on Oracle RAC
The Top 5 Reasons to Deploy Your Applications on Oracle RACThe Top 5 Reasons to Deploy Your Applications on Oracle RAC
The Top 5 Reasons to Deploy Your Applications on Oracle RAC
 
Oracle Performance Tools of the Trade
Oracle Performance Tools of the TradeOracle Performance Tools of the Trade
Oracle Performance Tools of the Trade
 
ORDS - Oracle REST Data Services
ORDS - Oracle REST Data ServicesORDS - Oracle REST Data Services
ORDS - Oracle REST Data Services
 
SQL Monitoring in Oracle Database 12c
SQL Monitoring in Oracle Database 12cSQL Monitoring in Oracle Database 12c
SQL Monitoring in Oracle Database 12c
 
FOSDEM 2022 MySQL Devroom: MySQL 8.0 - Logical Backups, Snapshots and Point-...
FOSDEM 2022 MySQL Devroom:  MySQL 8.0 - Logical Backups, Snapshots and Point-...FOSDEM 2022 MySQL Devroom:  MySQL 8.0 - Logical Backups, Snapshots and Point-...
FOSDEM 2022 MySQL Devroom: MySQL 8.0 - Logical Backups, Snapshots and Point-...
 
MySQL Shell for DBAs
MySQL Shell for DBAsMySQL Shell for DBAs
MySQL Shell for DBAs
 
Oracle Real Application Clusters (RAC) 12c Rel. 2 - Operational Best Practices
Oracle Real Application Clusters (RAC) 12c Rel. 2 - Operational Best PracticesOracle Real Application Clusters (RAC) 12c Rel. 2 - Operational Best Practices
Oracle Real Application Clusters (RAC) 12c Rel. 2 - Operational Best Practices
 
Oracle 12c PDB insights
Oracle 12c PDB insightsOracle 12c PDB insights
Oracle 12c PDB insights
 
MySQL Shell - The Best MySQL DBA Tool
MySQL Shell - The Best MySQL DBA ToolMySQL Shell - The Best MySQL DBA Tool
MySQL Shell - The Best MySQL DBA Tool
 
Automate Oracle database patches and upgrades using Fleet Provisioning and Pa...
Automate Oracle database patches and upgrades using Fleet Provisioning and Pa...Automate Oracle database patches and upgrades using Fleet Provisioning and Pa...
Automate Oracle database patches and upgrades using Fleet Provisioning and Pa...
 
Oracle RAC on Extended Distance Clusters - Presentation
Oracle RAC on Extended Distance Clusters - PresentationOracle RAC on Extended Distance Clusters - Presentation
Oracle RAC on Extended Distance Clusters - Presentation
 

Semelhante a 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
 

Semelhante a 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
 

Mais de 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
 

Mais de 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
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
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
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
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
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
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
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 

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