SlideShare a Scribd company logo
1 of 48
Download to read offline
Practical guide to Oracle
Virtual environments
ODC Tour Latin America – August 2018
Nelson Calero
Today’s topics • Virtual environments review
– Docker
– Oracle VirtualBox
– Oracle VM
– Oracle Cloud
• Automation
– Vagrant
– Ansible
– Terraform
• Examples
– VirtualBox VMs using Vagrant/Ansible
– Docker on Windows
– RAC using VirtualBox and Docker
– Terraform for Oracle Cloud instances
2 © 2018 Pythian
Motivation
Explore alternatives to create
database environments
Intended audience
DBAs and Developers
• Database Consultant at Pythian since 2014
• Working with Oracle tools and Linux environments since 1996
• DBA Oracle (2001) & MySQL (2005)
• Co-founder and President of the Oracle user Group of Uruguay (2009)
• LAOUC Director of events (2013)
• Computer Engineer (1998)
• Oracle ACE (2014), Oracle ACE Director (2017)
• Oracle Certified Professional 10g/11g/12c, OCE, Cloud DB & Infra
• Amazon Solutions Architect – Associate (2016)
• Google Cloud Architect (2017), Google Cloud Data Engineer (2017)
• Oracle University Instructor (2011)
• Blogger and speaker: Oracle Open World, Collaborate, OTN Tour, Regional conferences
About me
3 © 2018 Pythian
http://www.linkedin.com/in/ncalero @ncalerouy
Pythian overview
© 2015 Pythian Confidential4
• 22 Years of data infrastructure management consulting
• 250+ Top brands
• 11800+ Systems under management
• 400+ employees in 35 countries
• 10 Oracle ACEs, 4 ACED,
3 OakTable members, 2 OCM, 6 Microsoft MVPs,
1 Cloudera Champion of Big Data,
AWS Certified Solutions Architect – 2 Professional, 12 Associate
• Oracle, Microsoft, MySQL, Hadoop, Cassandra, MongoDB, and more
• Infrastructure, Cloud, DevOps, and application expertise
5 © 2018 Pythian
Introduction to Virtual environments
6
KVM, Oracle VM, VirtualBox, … LXC, WPAR, Docker, …
Sharing server resources isolating processes
https://docs.docker.com/get-started/
Introduction to Virtual environments
• Hypervisors (Server virtualization)
– Type 1: run directly in host’s hardware
• Xen, Oracle VM, Hyper-V, Vmware ESX, KVM, …
– Type 2: run on a OS (host)
• VMware Workstation, VirtualBox, QEMU, …
• Containers (OS virtualization)
– Share OS kernel and libraries
– LXC, Docker
– MOS 2216342.1 Oracle Support for Database Running on Docker
 Supported SI on Oracle Linux 7 with UEK4 (and later) or RHEL7
7 © 2018 Pythian
Not only server virtualization
• Data virtualization
– Delphix, …
• Storage snapshots (vendor based)
– SMO, NetAPP, Oracle ACFS, ..
– gDBClone – clone databases based on ACFS snapshots
http://www.oracle.com/technetwork/indexes/samplecode/gdbclone-download-2295388.html
• Cloud provisioning
– Compute instances – managed hypervisor
– Bare Metal – bring your own hypervisor (only on new OCI, not classic)
– Containers – as managed services or DIY in BM
8 © 2018 Pythian
Today’s focus: VMs and containers
9 © 2018 Pythian
Containers with Docker
10
• Creates process with access to same OS binaries and resources from the host,
executing programs in isolation as if they were inside a VM
• Runs on any OS
- Download latest binary from https://www.docker.com
- On Windows it creates a VirtualBox VM to execute containers inside it
 VM needs CPU, disk and RAM adjustments to be useful
• Commands:
- docker-machine: manage machines running Docker (Windows/Mac before v1.12)
- docker
o build: Build an image from a Dockerfile
o run: Run a command in a new container
o exec: Run a command in a running container
© 2018 Pythian
Docker – command line
Windows – control VM status
11
D:>docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
default - virtualbox Running tcp://192.168.99.100:2376 v18.01.0-ce
Management Commands:
checkpoint Manage checkpoints
config Manage Docker configs
container Manage containers
image Manage images
network Manage networks
node Manage Swarm nodes
plugin Manage plugins
secret Manage Docker secrets
service Manage services
stack Manage Docker stacks
swarm Manage Swarm
system Manage Docker
volume Manage volumes
D:>docker Commands:
attach Attach local standard input, output, and error streams to a running contain
build Build an image from a Dockerfile
commit Create a new image from a container's changes
cp Copy files/folders between a container and the local filesystem
create Create a new container
deploy Deploy a new stack or update an existing stack
diff Inspect changes to files or directories on a container's filesystem
events Get real time events from the server
exec Run a command in a running container
export Export a container's filesystem as a tar archive
history Show the history of an image
images List images
import Import the contents from a tarball to create a filesystem image
info Display system-wide information
inspect Return low-level information on Docker objects
kill Kill one or more running containers
load Load an image from a tar archive or STDIN
login Log in to a Docker registry
logout Log out from a Docker registry
logs Fetch the logs of a container
pause Pause all processes within one or more containers
port List port mappings or a specific mapping for the container
ps List containers
...
Docker – configuration
12
Dockerfile – instructions to execute when a container starts
FROM oraclelinux:7-Slim # Pull base image
…
USER Oracle
RUN $INSTALL_DIR/$INSTALL_DB_BINARIES_FILE EE
…
CMD exec $ORACLE_BASE/$RUN_FILE
Base image usually are OS images, not including Oracle binaries (license restriction)
Exception: Oracle provided images:
- Docker Store: https://store.docker.com/images/oracle-database-enterprise-edition
- Oracle Container Registry: https://container-registry.oracle.com
Useful github repositories:
– https://github.com/oracle/docker-images/OracleDatabase - RAC and Single instance
– https://github.com/Seth-Miller/12c-rac-docker - pioneer RAC configuration
© 2018 Pythian
Docker – creating a container
13
Install github repository
D:GitHub>git clone https://github.com/oracle/docker-images.git
Cloning into 'docker-images'...
remote: Counting objects: 7740, done.
remote: Compressing objects: 100% (36/36), done.
rRemote: Total 7740 (delta 18), reused 45 (delta 16), pack-reused 7688
Receiving objects: 100% (7740/7740), 9.70 MiB | 870.00 KiB/s, done.
Resolving deltas: 100% (4286/4286), done.
Checking connectivity... done.
Checking out files: 100% (968/968), done.
Create the container (11.2.0.2 XE, 12.1.0.2 or 12.2.0.1 EE or SE as of March 2018):
D:GitHub12.1.0.2/…>docker build -t oracle/database:12.1.0.2-ee -f Dockerfile.ee .
Download Oracle installation files from OTN:
• http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html
• Copy to directory D:GitHubdocker-imagesOracleDatabasedockerfiles12.1.0.2
© 2018 Pythian
Docker – creating a container
14
Start the container (Windows example):
D:>docker run --name ora121 -p 1521:1521 -p 5500:5500 -e ORACLE_SID=orcl -e
ORACLE_PDB=pdb1 -e ORACLE_PWD=Oracle_123 -e ORACLE_CHARACTERSET=AL32UTF8 -v
//c/users/calero/.docker/persistentdisk/ora121://opt/oracle/oradata
oracle/database:12.1.0.2-ee
Status of running containers
D:>docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS
PORTS NAMES
2c1afcad6a50 oracle/database:12.1.0.2-ee "/bin/sh -c 'exec $O…" 11 hours ago Up 11 hours
(healthy) 0.0.0.0:1521->1521/tcp, 0.0.0.0:5500->5500/tcp ora121
Status
D:>docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
oracle/database 12.1.0.2-ee c175ddb41772 4 minutes ago 10.6GB
oraclelinux 7-slim 9870bebfb1d5 2 months ago 118MB
© 2018 Pythian
Docker – connecting to Oracle
15
Using sqlplus binary from container
Connect to database running in container – using host Oracle client
D:>docker-machine ip
192.168.99.100
C:Userscalero>sqlplus system/Oracle_123@"192.168.99.100:1521/orcl"
SQL*Plus: Release 12.1.0.2.0 Production on Sun Feb 4 01:51:50 2018
...
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
D:>docker exec -ti 2c1afcad6a50 sqlplus pdbadmin/Oracle_123@pdb1
SQL*Plus: Release 12.1.0.2.0 Production on Sun Feb 4 16:23:47 2018
...
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
© 2018 Pythian
Docker - images from container-registry
Register in container-registry.oracle.com
Start session
Download image
Step by step guide:
16
D:>docker login container-registry.oracle.com
Username: nelson.calero@gmail.com
Password: xxx
Login Succeeded
D:>docker pull container-registry.oracle.com/database/enterprise:12.2.0.1
12.2.0.1: Pulling from database/enterprise
9bd4d110366e: Downloading [> ] 2.668MB/143MB
af8b29651e27: Download complete
http://databaseindex.blogspot.com/2018/04/oracle-12c-docker-windows-ocr.html
© 2018 Pythian
Example – Oracle DB using Docker Image
Check local images
17
D:>docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
container-registry.oracle.com/database/enterprise 12.2.0.1 12a359cd0528 5 months ago 3.44GB
Define image settings
D:>echo DB_MEMORY=1Gb >ora.conf
Start the container
D:>docker run -d -it --name ora122 -P --env-file ora.conf container-registry.oracle.com/database/enterprise:12.2.0.1
5896d37c1cae083c9ab82ec52cf9900a3b22a012b5257c1cb065a6093d7d55c5
Check running containers
D:>docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
5896d37c1cae container-registry.oracle.com/database/enterprise:12.2.0.1 "/bin/sh -c '/bin/ba…" 24 minutes ago Up
24 minutes (healthy) 0.0.0.0:32769->1521/tcp, 0.0.0.0:32768->5500/tcp ora122
Summary – Oracle DB using Docker
Using images with preinstalled Oracle binaries
- Docker Store
- Container registry
Step-by-step: http://databaseindex.blogspot.com/2018/04/oracle-12c-docker-windows-ocr.html
Using Oracle github repository, must download binaries from OTN
- Step-by-step example on Windows 10:
http://www.oracle.com/technetwork/es/articles/datawarehouse/oracle12c-docker-win10-4485487-esa.html
More examples:
- Standby: https://github.com/jamesattard/oracle-xe-docker
- RAC: https://github.com/Seth-Miller/12c-rac-docker
https://github.com/oracle/docker-images/tree/master/OracleDatabase/RAC
18 © 2018 Pythian
Docker - creating a container
19
Demo
© 2018 Pythian
Hypervisors – Oracle VM (type 1)
• Xen Kernel – UEK R4 as of July 2018 with OVM 3.4.4
• Server needs to boot with it (reinstall needed if other OS was used)
• Minimal resources used by OVM server (1 CPU 2Gg RAM)
• VMs uses free available server’s resources
– can be created from OVS using CLI (xm) or using OVM manager web client
– RAM/CPUs can be allocated dynamically without restarting VMs (up to max config)
– Only supported method to reduce license costs (hard partitioning)
– HA configuration allowed with clustered repositories (using SAN, not with local HDs)
– Windows, Linux and Solaris guests
• OVM Manager
– Needs to be installed in a different server
– Uses MySQL as metadata repository
20 © 2018 Pythian
Oracle VM - examples
21 © 2018 Pythian
[root@ovs ~]# xm list
Name ID Mem VCPUs State Time(s)
0004fb00000600001000d7829bf5a105 4 30723 4 -b---- 2415636.4
0004fb0000060000cf08a173c50efdc1 2 13063 4 r----- 784876.4
Domain-0 0 1958 20 r----- 1211462.2
[root@ovs /OVS/Repositories]# ls -l */VirtualMachines/*/vm.cfg
-rw------- 1 root root 1950 Apr 19 02:37
0004fb00000300005b800c75ea8932be/VirtualMachines/0004fb00000600001000d7829bf5a105/vm.cfg
-rw-r--r-- 1 root root 1946 Apr 19 02:36
0004fb00000300005b800c75ea8932be/VirtualMachines/0004fb0000060000cf08a173c50efdc1/vm.cfg
[root@ovs ~]# lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 20
Hypervisor vendor: Xen
Virtualization type: none
[root@ovs ~]# cd
/OVS/Repositories/*/VirtualMachines
[root@ovs VirtualMachines]# grep cpus
0004fb0000060000cf08a173c50efdc1/vm.cfg
maxvcpus = 4
vcpus = 4
cpus = '0-3‘ # '2,3'
Oracle VM Manager console
22 © 2018 Pythian
VirtualBox VMs (type 2)
• Run on any OS (Linux, Windows, Mac)
• Download binaries for your platform
• How to create your Oracle VM?
– a) Download OS ISO+ Oracle binaries
Create VM, boot from ISO, install OS + DB, create DB
– b) Download VM template - all pre(installed/configured)
http://www.oracle.com/technetwork/community/developer-vm/index.html
– c) use tools to automate a)
• Several github repos available (details later)
• Allows to customize your VM and create your own template
23 © 2018 Pythian
Example – Oracle DB using Vbox
© 2015 Pythian Confidential24
25
CLI tools
• VBox: VBoxManage
post creation steps?
• Docker: dockerfile
– ENTRYPOINT – commands to execute when container is run
– CMD – provide default parameters for ENTRYPOINTS or executing an ad-hoc command
26
C:Program FilesOracleVirtualBox> ./VBoxManage list vms
"Oracle DB Developer VM" {6f3d3706-a84d-4163-9bf7-14da26393179}
"oracle-OEL69" {2b835d64-f868-44d8-88e9-9f214dd2fb7d}
"oel68-asm2" {e4d7eb54-2159-4398-a49a-3c2ccfe3cc86}
"oel68-asm1" {bc5e8bc7-3e15-47a1-b81c-2d7bca77b7dd}
"ora12c-si-asm-oel682" {a7318e8a-5b6d-496f-992c-46f84108d345}
"ora12c-si-asm-oel681" {19e74473-bb07-423d-914c-354dc94d6b61}
"default" {fbe05e1e-3c50-4f8f-ba29-6a795a56bdc8}
© 2018 Pythian
Automation tools
Vagrant (from HashiCorp)
- Manage VMs with a standard workflow
- Out of the box with support for VirtualBox,
Hyper-V, and Docker
- Uses CLI (Vbox, Vmware, Docker) to
manage lifecycle
- Handles CLI parameters accordingly with
their different versions
- Automatic ssh setup, etc
- Configuration files, providers, plugins
- Use case: few local VMs
- Runs on any OS – Linux, Windows, Mac
27
Ansible (from RedHat)
• Automation tool using a simple configuration
language
• Agentless, uses OpenSSH and WinRM
• Provisioning, configuration management and
workload orchestration
• Available on Linux and Mac
Terraform (from HashiCorp)
• Build infrastructure, complex sets, local and
remote using simple language
• Runs on any OS
© 2018 Pythian
Vagrant
28
$ vagrant init hashicorp/precise64
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'hashicorp/precise64'...
==> default: Forwarding ports...
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Waiting for machine to boot...
$ vagrant ssh
vagrant@precise64:~$ _
Install latest binaries: https://www.vagrantup.com/downloads.html
OS Images
- Called box: used to create your VM.
- Public catalog: https://app.vagrantup.com/boxes/search
- or create your own, or use from any URL
Vagrantfile
- Configuration and provisioning steps
- Ruby syntax
- Created with defaults using init
Simple example: creating a VM based
on precise64 image (Ubuntu 12.04 64-
bit) from their public catalog
© 2018 Pythian
Vagrant
Provisioning: execute steps after it is running
- part of initial up process, or called manually
- Built-in types: Shell, Ansible, Chef, Docker, Puppet, Salt, …
Sample Vagrantfile using a shell provisioner
Providers: virtual machine to manage
- Out of the box for: VirtualBox (default), Docker, Hyper-V
- More can be installed as plugins: Vmware, Custom
29 © 2018 Pythian
Vagrant.configure("2") do |config|
config.vm.provision "shell",
inline: "echo Hello, World"
end
Vagrant - commands
30
D:GitHub>vagrant box list
bento/oracle-6.9 (virtualbox, 201801.02.0)
kikitux/oracle6-racattack (virtualbox, 16.01.01)
oravirt/ol67 (virtualbox, 20170424)
oravirt/ol68 (virtualbox, 20170418)
oravirt/ol72 (virtualbox, 20170425)
D:GitHub>vagrant
Usage: vagrant [options] <command> [<args>]
box manages boxes: installation, removal, etc.
init initializes a new Vagrant environment by creating a Vagrantfile
validate validates the Vagrantfile
up starts and provisions the vagrant environment
provision provisions the vagrant machine
push deploys code in this environment to a configured destination
port displays information about guest port mappings
status outputs status of the vagrant machine
connect connect to a remotely shared Vagrant environment
suspend suspends the machine
resume resume a suspended vagrant machine
halt stops the vagrant machine
destroy stops and deletes all traces of the vagrant machine
reload restarts vagrant machine, loads new Vagrantfile configuration
snapshot manages snapshots: saving, restoring, etc.
ssh connects to machine via SSH
powershell connects to machine via powershell remoting
rdp connects to machine via RDP
Ansible
• Install binaries in a control machine (Windows not supported)
• No agent – uses ssh to connect to remote machines
• Inventory to define machines to use - /etc/ansible/hosts
• Playbook: language used for configuration, deployment, and orchestration
– YAML format
– tags and actions to execute
– conditional control: when, loop, until
– this is the main code to keep under source control
• Modules describing resources and desired state
– Created by us or built-in modules: http://docs.ansible.com/modules_by_category.html
– Can be executed directly or inside playbooks
31 © 2018 Pythian
Ansible playbooks
Sample playbook – playbook.yml
To execute it:
32
- hosts: webservers
remote_user: root
tasks:
- name: ensure apache is at the latest version
yum:
name: httpd
state: latest
- name: write the apache config file
template:
src: /srv/httpd.j2
dest: /etc/httpd.conf
$ ansible-playbook playbook.yml
© 2018 Pythian
Oracle VBox VMs using Vagrant/Ansible (1)
Repository with several configurations: https://github.com/oravirt/
Example for single instance: vagrant-vbox-si-asm
 Customization explained: ${INST_DIR}/README.md
 Code to change:
o vagrant-vbox-si-asmhosts.yml:
o vagrant-vbox-si-asmextra-provisionansible-oraclegroup_vars
 Copy binary files from OTN - ${INST_DIR}vagrant-vbox-si-asmswrepo
33
basename_vm: ora12c-si-asm-oel68
num_vm: 2
base_priv_ip: 172.16.56.30 # (your chosen IP)
oracle_install_version_gi: 12.1.0.2
oracle_version_db: 12.1.0.2
© 2018 Pythian
Oracle VBox VMs using Vagrant/Ansible (2)
To create the VM without installing Oracle:
To install Oracle after the VM is created:
All together:
34
D:GitHubvboxsi2vagrant-vbox-si-asm>vagrant provision
==> oel68-asm1: Running provisioner: ansible_local...
Vagrant has automatically selected the compatibility mode '2.0'
according to the Ansible version installed (2.2.1.0).
…
PLAY [all] *********************************************************************
TASK [setup] *******************************************************************
ok: [oel68-asm1]
TASK [init : Install packages] *************************************************
ok: [oel68-asm1] => (item=[u'ntp', u'dnsmasq'])
…
$ vagrant up
$ setup=true ; vagrant up
© 2018 Pythian
Oracle VBox VMs using Vagrant/Ansible
DEMO time
More step-by-step examples:
- Oracle Standby 12c using vagrant-vbox-si-asm:
http://databaseindex.blogspot.com/2018/02/crear-oracle-standby-12c-usando.html
- Oracle 12c VM on Windows 10 using ubuntu shell (WLS) and ansible:
http://databaseindex.blogspot.com/2018/03/oracle-12c-vagrant-windows-wls-ubuntu.html
35 © 2018 Pythian
Oracle RAC VBox VMs
• Similar approach: https://github.com/racattack/racattack-ansible-oracle
• Implements configuration described in RAC Attack handbook:
https://en.wikibooks.org/wiki/RAC_Attack_-_Oracle_Cluster_Database_at_Home/RAC_Attack_12c
• Customization explained
in project readme (README.md)
on Vagrantfile:
step-by-step example on Windows:
http://databaseindex.blogspot.com/2017/04/automatizar-instalacion-de-oracle-rac.html
36 © 2018 Pythian
#############################
##### BEGIN CUSTOMIZATION #####
#############################
#define number of nodes
num_APPLICATION = 0
num_LEAF_INSTANCES = 0
num_DB_INSTANCES = 1
#define number of cores for guest
num_CORE = 1
#define memory for each type of node in MBytes
memory_APPLICATION = 1500
memory_LEAF_INSTANCES = 2300
memory_DB_INSTANCES = 3072
Oracle RAC with Docker
As pointed earlier: https://github.com/oracle/docker-images/tree/master/OracleDatabase/RAC
Several containers needs to be created:
- OracleConnectionManager: bind single port to host and serve containers on different ports
- OracleRACStorageServer: Oracle ASM on NFS Server for RAC testing
- OracleRealApplicationClusters: RAC instance, minimum two
Several steps for each container.
37 © 2018 Pythian
VMs in Oracle Cloud
• Infrastructure services
– Database Cloud Service (DBCS): all managed, pre-built configurations
– Compute (OCI or OCI-C): install DB manually as in VirtualBox
– Bare Metal and BYOH (OCI): entire server, can install OVM or use as Compute
• Container services
• Automation
– Terraform for OCI and OCI-C
– Orchestration for OCI-C
– REST API
Upcoming example – already in my other session about that topic
38 © 2018 Pythian
Example: OCI Instance using Terraform
• Download Terraform binary (my example uses v0.11.3)
– https://www.terraform.io/downloads.html
• Download Terraform OCI-provider (using v2.1.0)
– https://github.com/oracle/terraform-provider-oci/releases
• Create .tf HCL Project (based on examples):
– https://github.com/oracle/terraform-provider-oci/tree/master/docs/examples
• Configure your account Access (env-vars.ps1)
– Tenancy and user OCIDs, fingerprint, private key, region
• Terraform Plan
• Terraform Apply
• Step by step guide: https://community.oracle.com/docs/DOC-1019936
39 © 2018 Pythian
ncalero@H6RMYZ1:/mnt/d/GitHub/terraform-OCI/$ ls
block.tf compute.tf env-vars.ps1 outputs.tf userdata
datasources.tf network.tf provider.tf remote-exec.tf variables.tf
ncalero@H6RMYZ1:/mnt/d/GitHub/terraform-OCI$ cat /mnt/c/users/calero/AppData/Roaming/terraform.rc
providers { oci = "d:softterraform-provider-oci_v2.1.0.exe" }
40 © 2018 Pythian
PS D:GitHubterraform-OCI> cat ./env-vars.ps1
$env:TF_VAR_tenancy_ocid="ocid1.tenancy.oc1..aaaaaaaaw5hodl4pajmymyo62bwkj4kokziowmjkvj7fvmgt4lqia3yg7km"
$env:TF_VAR_user_ocid="ocid1.user.oc1..aaaaaaaaiyhrscq7rhfiyhrscql4tb3ojto2ysw72l656yknkyqau2lxotqf"
$env:TF_VAR_compartment_ocid="ocid1.compartment.oc1.. aaaaaaaakdevdha7q7yjdheridcy63sgv2syefv7x46u67jk4hj"
$env:TF_VAR_region="us-ashburn-1“
$env:TF_VAR_fingerprint="db:a3:b8:59:ce:05:ff:78:c0:fb:aa:ca:d7:09:77:ad"
$env:TF_VAR_private_key_path="C:Userscalero.ocioci_api_key.pem"
### Public/private keys used on the instances
$env:TF_VAR_ssh_public_key = Get-Content C:Userscalero.sshid_rsa.pub -Raw
$env:TF_VAR_ssh_private_key = Get-Content C:Userscalero.sshid_rsa -Raw
PS D:GitHubterraform-OCI> ./env-vars.ps1
ncalero@H6RMYZ1:/mnt/d/GitHub/terraform-OCI$ cat compute.tf
resource "oci_core_instance" "DemoInstance" {
availability_domain =
"${lookup(data.oci_identity_availability_domains.ADs.availability_domains[0],"name")}"
compartment_id = "${var.compartment_ocid}"
display_name = "Demo-Instance"
image = "${lookup(data.oci_core_images.OLImageOCID.images[0], "id")}"
shape = "${var.InstanceShape}"
subnet_id = "${oci_core_subnet.SN-DemoSubnetAD1.id}"
metadata {
ssh_authorized_keys = "${var.ssh_public_key}"
user_data = "${base64encode(file(var.InstanceBootStrap))}"
}
}
ncalero@H6RMYZ1:/mnt/d/GitHub/terraform-OCI/demo$ cat provider.tf
provider "oci" {
tenancy_ocid = "${var.tenancy_ocid}"
user_ocid = "${var.user_ocid}"
fingerprint = "${var.fingerprint}"
private_key_path = "${var.private_key_path}“
region = "${var.region}"
}
41 © 2018 Pythian
42 © 2018 Pythian
43 © 2018 Pythian
© 2015 Pythian Confidential44
PS D:GitHubterraform-OCI> d:softterraform graph | dot -Tpng -o demo-graph.png
Terraform apply
© 2015 Pythian Confidential45
Summary
Comparing options to create an Oracle instance using dataguard (2 VMs)
Notes:
* host CPU can be shared among VMs but performance will be impacted. Use 1 CPU per VM for prod
** only as described in MOS 2216342.1 - SI on OEL7 with UEK4 or RHEL7 as of July 2018
*** once familiar with the tool and concepts
46
Solution Host OS Disk
space
CPU
min.
License Creation
effort
Production
support
OVM OVM 2xVM+ 1 (*) VM CPUs Medium yes
VirtualBox any 2xVM 1 (*) Entire host Easy (***) no
Docker any 1xVM+ 1 (*) Entire host Easy (***) yes (**)
Cloud any 2xVM 1 (*) VM shape Easiest yes
© 2018 Pythian
References - documentation
• Virtualization concepts: https://en.wikipedia.org/wiki/X86_virtualization
• Docker documentation: https://docs.docker.com/
• Oracle database on Docker – github project: https://github.com/oracle/docker-images
• VirtualBox user guide: https://www.virtualbox.org/manual/ch01.html
• Oracle VM documentation: https://www.oracle.com/technetwork/documentation/vm-096300.html
• Vagrant documentation: https://www.vagrantup.com/intro/index.html
• Ansible user guide: https://docs.ansible.com/ansible/latest/user_guide/index.html
• Terraform documentation: https://www.terraform.io/intro/index.html
47 © 2018 Pythian
THANK YOU
Questions?
48
calero@pythian.com
@ncalerouy
http://www.linkedin.com/in/ncalero
© 2017 Pythian

More Related Content

What's hot

Extreme Replication - RMOUG Presentation
Extreme Replication - RMOUG PresentationExtreme Replication - RMOUG Presentation
Extreme Replication - RMOUG PresentationBobby Curtis
 
Oracle Drivers configuration for High Availability
Oracle Drivers configuration for High AvailabilityOracle Drivers configuration for High Availability
Oracle Drivers configuration for High AvailabilityLudovico Caldara
 
Moving your Oracle Databases to the Oracle Cloud
Moving your Oracle Databases to the Oracle CloudMoving your Oracle Databases to the Oracle Cloud
Moving your Oracle Databases to the Oracle CloudAlex Zaballa
 
Oracle GoldenGate Presentation from OTN Virtual Technology Summit - 7/9/14 (PDF)
Oracle GoldenGate Presentation from OTN Virtual Technology Summit - 7/9/14 (PDF)Oracle GoldenGate Presentation from OTN Virtual Technology Summit - 7/9/14 (PDF)
Oracle GoldenGate Presentation from OTN Virtual Technology Summit - 7/9/14 (PDF)Bobby Curtis
 
ECO 2022 - OCI and HashiCorp Terraform
ECO 2022 - OCI and HashiCorp TerraformECO 2022 - OCI and HashiCorp Terraform
ECO 2022 - OCI and HashiCorp TerraformBobby Curtis
 
Oracle virtualbox basic to rac attack
Oracle virtualbox basic to rac attackOracle virtualbox basic to rac attack
Oracle virtualbox basic to rac attackBobby Curtis
 
VMworld 2013: Virtualizing Mission Critical Oracle RAC with vSphere and vCOPS
VMworld 2013: Virtualizing Mission Critical Oracle RAC with vSphere and vCOPSVMworld 2013: Virtualizing Mission Critical Oracle RAC with vSphere and vCOPS
VMworld 2013: Virtualizing Mission Critical Oracle RAC with vSphere and vCOPSVMworld
 
20171104 hk-py con-mysql-documentstore_v1
20171104 hk-py con-mysql-documentstore_v120171104 hk-py con-mysql-documentstore_v1
20171104 hk-py con-mysql-documentstore_v1Ivan Ma
 
Heat - keep the clouds up
Heat - keep the clouds upHeat - keep the clouds up
Heat - keep the clouds upKiran Murari
 
Oracle WebLogic 12c New Multitenancy features
Oracle WebLogic 12c New Multitenancy featuresOracle WebLogic 12c New Multitenancy features
Oracle WebLogic 12c New Multitenancy featuresMichel Schildmeijer
 
Oracle GoldenGate 21c New Features and Best Practices
Oracle GoldenGate 21c New Features and Best PracticesOracle GoldenGate 21c New Features and Best Practices
Oracle GoldenGate 21c New Features and Best PracticesBobby Curtis
 
Oracle WebLogic Server 12c with Docker
Oracle WebLogic Server 12c with DockerOracle WebLogic Server 12c with Docker
Oracle WebLogic Server 12c with DockerGuatemala User Group
 
Oracle GoldenGate 18c - REST API Examples
Oracle GoldenGate 18c - REST API ExamplesOracle GoldenGate 18c - REST API Examples
Oracle GoldenGate 18c - REST API ExamplesBobby Curtis
 
A Second Look at Oracle RAC 12c
A Second Look at Oracle RAC 12cA Second Look at Oracle RAC 12c
A Second Look at Oracle RAC 12cLeighton Nelson
 
Database As A Service: OEM + ODA (OOW 15 Presentation)
Database As A Service: OEM + ODA (OOW 15 Presentation)Database As A Service: OEM + ODA (OOW 15 Presentation)
Database As A Service: OEM + ODA (OOW 15 Presentation)Bobby Curtis
 
Developing Java EE Applications on IntelliJ IDEA with Oracle WebLogic 12c
Developing Java EE Applications on IntelliJ IDEA with Oracle WebLogic 12cDeveloping Java EE Applications on IntelliJ IDEA with Oracle WebLogic 12c
Developing Java EE Applications on IntelliJ IDEA with Oracle WebLogic 12cBruno Borges
 
MySQL 5.7: Focus on InnoDB
MySQL 5.7: Focus on InnoDBMySQL 5.7: Focus on InnoDB
MySQL 5.7: Focus on InnoDBMario Beck
 
2017 OWASP SanFran March Meetup - Hacking SQL Server on Scale with PowerShell
2017 OWASP SanFran March Meetup - Hacking SQL Server on Scale with PowerShell2017 OWASP SanFran March Meetup - Hacking SQL Server on Scale with PowerShell
2017 OWASP SanFran March Meetup - Hacking SQL Server on Scale with PowerShellScott Sutherland
 

What's hot (20)

Extreme Replication - RMOUG Presentation
Extreme Replication - RMOUG PresentationExtreme Replication - RMOUG Presentation
Extreme Replication - RMOUG Presentation
 
Oracle Drivers configuration for High Availability
Oracle Drivers configuration for High AvailabilityOracle Drivers configuration for High Availability
Oracle Drivers configuration for High Availability
 
Moving your Oracle Databases to the Oracle Cloud
Moving your Oracle Databases to the Oracle CloudMoving your Oracle Databases to the Oracle Cloud
Moving your Oracle Databases to the Oracle Cloud
 
Oracle GoldenGate Presentation from OTN Virtual Technology Summit - 7/9/14 (PDF)
Oracle GoldenGate Presentation from OTN Virtual Technology Summit - 7/9/14 (PDF)Oracle GoldenGate Presentation from OTN Virtual Technology Summit - 7/9/14 (PDF)
Oracle GoldenGate Presentation from OTN Virtual Technology Summit - 7/9/14 (PDF)
 
ECO 2022 - OCI and HashiCorp Terraform
ECO 2022 - OCI and HashiCorp TerraformECO 2022 - OCI and HashiCorp Terraform
ECO 2022 - OCI and HashiCorp Terraform
 
Oracle virtualbox basic to rac attack
Oracle virtualbox basic to rac attackOracle virtualbox basic to rac attack
Oracle virtualbox basic to rac attack
 
VMworld 2013: Virtualizing Mission Critical Oracle RAC with vSphere and vCOPS
VMworld 2013: Virtualizing Mission Critical Oracle RAC with vSphere and vCOPSVMworld 2013: Virtualizing Mission Critical Oracle RAC with vSphere and vCOPS
VMworld 2013: Virtualizing Mission Critical Oracle RAC with vSphere and vCOPS
 
20171104 hk-py con-mysql-documentstore_v1
20171104 hk-py con-mysql-documentstore_v120171104 hk-py con-mysql-documentstore_v1
20171104 hk-py con-mysql-documentstore_v1
 
Heat - keep the clouds up
Heat - keep the clouds upHeat - keep the clouds up
Heat - keep the clouds up
 
Oracle WebLogic 12c New Multitenancy features
Oracle WebLogic 12c New Multitenancy featuresOracle WebLogic 12c New Multitenancy features
Oracle WebLogic 12c New Multitenancy features
 
Oracle GoldenGate 21c New Features and Best Practices
Oracle GoldenGate 21c New Features and Best PracticesOracle GoldenGate 21c New Features and Best Practices
Oracle GoldenGate 21c New Features and Best Practices
 
Monoliths to the cloud!
Monoliths to the cloud!Monoliths to the cloud!
Monoliths to the cloud!
 
Oracle WebLogic Server 12c with Docker
Oracle WebLogic Server 12c with DockerOracle WebLogic Server 12c with Docker
Oracle WebLogic Server 12c with Docker
 
Oracle GoldenGate 18c - REST API Examples
Oracle GoldenGate 18c - REST API ExamplesOracle GoldenGate 18c - REST API Examples
Oracle GoldenGate 18c - REST API Examples
 
A Second Look at Oracle RAC 12c
A Second Look at Oracle RAC 12cA Second Look at Oracle RAC 12c
A Second Look at Oracle RAC 12c
 
Database As A Service: OEM + ODA (OOW 15 Presentation)
Database As A Service: OEM + ODA (OOW 15 Presentation)Database As A Service: OEM + ODA (OOW 15 Presentation)
Database As A Service: OEM + ODA (OOW 15 Presentation)
 
Developing Java EE Applications on IntelliJ IDEA with Oracle WebLogic 12c
Developing Java EE Applications on IntelliJ IDEA with Oracle WebLogic 12cDeveloping Java EE Applications on IntelliJ IDEA with Oracle WebLogic 12c
Developing Java EE Applications on IntelliJ IDEA with Oracle WebLogic 12c
 
MySQL 5.7: Focus on InnoDB
MySQL 5.7: Focus on InnoDBMySQL 5.7: Focus on InnoDB
MySQL 5.7: Focus on InnoDB
 
Rapid Home Provisioning
Rapid Home ProvisioningRapid Home Provisioning
Rapid Home Provisioning
 
2017 OWASP SanFran March Meetup - Hacking SQL Server on Scale with PowerShell
2017 OWASP SanFran March Meetup - Hacking SQL Server on Scale with PowerShell2017 OWASP SanFran March Meetup - Hacking SQL Server on Scale with PowerShell
2017 OWASP SanFran March Meetup - Hacking SQL Server on Scale with PowerShell
 

Similar to Practical guide to Oracle Virtual environments

Oracle database on Docker Container
Oracle database on Docker ContainerOracle database on Docker Container
Oracle database on Docker ContainerJesus Guzman
 
Docker-Hanoi @DKT , Presentation about Docker Ecosystem
Docker-Hanoi @DKT , Presentation about Docker EcosystemDocker-Hanoi @DKT , Presentation about Docker Ecosystem
Docker-Hanoi @DKT , Presentation about Docker EcosystemVan Phuc
 
Docker 101 - Nov 2016
Docker 101 - Nov 2016Docker 101 - Nov 2016
Docker 101 - Nov 2016Docker, Inc.
 
Docker for developers
Docker for developersDocker for developers
Docker for developersandrzejsydor
 
Docker containers & the Future of Drupal testing
Docker containers & the Future of Drupal testing Docker containers & the Future of Drupal testing
Docker containers & the Future of Drupal testing Ricardo Amaro
 
Docker Seattle Meetup April 2015 - The Docker Orchestration Ecosystem on Azure
Docker Seattle Meetup April 2015 - The Docker Orchestration Ecosystem on AzureDocker Seattle Meetup April 2015 - The Docker Orchestration Ecosystem on Azure
Docker Seattle Meetup April 2015 - The Docker Orchestration Ecosystem on AzurePatrick Chanezon
 
Accelerate your development with Docker
Accelerate your development with DockerAccelerate your development with Docker
Accelerate your development with DockerAndrey Hristov
 
Accelerate your software development with Docker
Accelerate your software development with DockerAccelerate your software development with Docker
Accelerate your software development with DockerAndrey Hristov
 
Docker 1.11 Presentation
Docker 1.11 PresentationDocker 1.11 Presentation
Docker 1.11 PresentationSreenivas Makam
 
Introduction to Docker and Monitoring with InfluxData
Introduction to Docker and Monitoring with InfluxDataIntroduction to Docker and Monitoring with InfluxData
Introduction to Docker and Monitoring with InfluxDataInfluxData
 
Docker New York Meetup May 2015 - The Docker Orchestration Ecosystem on Azure
Docker New York Meetup May 2015 - The Docker Orchestration Ecosystem on Azure Docker New York Meetup May 2015 - The Docker Orchestration Ecosystem on Azure
Docker New York Meetup May 2015 - The Docker Orchestration Ecosystem on Azure Patrick Chanezon
 
Docker and kubernetes
Docker and kubernetesDocker and kubernetes
Docker and kubernetesDongwon Kim
 
Docker DANS workshop
Docker DANS workshopDocker DANS workshop
Docker DANS workshopvty
 
ExpoQA 2017 Using docker to build and test in your laptop and Jenkins
ExpoQA 2017 Using docker to build and test in your laptop and JenkinsExpoQA 2017 Using docker to build and test in your laptop and Jenkins
ExpoQA 2017 Using docker to build and test in your laptop and JenkinsElasTest Project
 
Using Docker to build and test in your laptop and Jenkins
Using Docker to build and test in your laptop and JenkinsUsing Docker to build and test in your laptop and Jenkins
Using Docker to build and test in your laptop and JenkinsMicael Gallego
 
Docker Azure Friday OSS March 2017 - Developing and deploying Java & Linux on...
Docker Azure Friday OSS March 2017 - Developing and deploying Java & Linux on...Docker Azure Friday OSS March 2017 - Developing and deploying Java & Linux on...
Docker Azure Friday OSS March 2017 - Developing and deploying Java & Linux on...Patrick Chanezon
 
Containers and Nutanix - Acropolis Container Services
Containers and Nutanix - Acropolis Container ServicesContainers and Nutanix - Acropolis Container Services
Containers and Nutanix - Acropolis Container ServicesNEXTtour
 

Similar to Practical guide to Oracle Virtual environments (20)

Oracle database on Docker Container
Oracle database on Docker ContainerOracle database on Docker Container
Oracle database on Docker Container
 
Docker-Hanoi @DKT , Presentation about Docker Ecosystem
Docker-Hanoi @DKT , Presentation about Docker EcosystemDocker-Hanoi @DKT , Presentation about Docker Ecosystem
Docker-Hanoi @DKT , Presentation about Docker Ecosystem
 
Docker
DockerDocker
Docker
 
Docker 101 - Nov 2016
Docker 101 - Nov 2016Docker 101 - Nov 2016
Docker 101 - Nov 2016
 
Docker for developers
Docker for developersDocker for developers
Docker for developers
 
Docker containers & the Future of Drupal testing
Docker containers & the Future of Drupal testing Docker containers & the Future of Drupal testing
Docker containers & the Future of Drupal testing
 
Docker Seattle Meetup April 2015 - The Docker Orchestration Ecosystem on Azure
Docker Seattle Meetup April 2015 - The Docker Orchestration Ecosystem on AzureDocker Seattle Meetup April 2015 - The Docker Orchestration Ecosystem on Azure
Docker Seattle Meetup April 2015 - The Docker Orchestration Ecosystem on Azure
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Accelerate your development with Docker
Accelerate your development with DockerAccelerate your development with Docker
Accelerate your development with Docker
 
Accelerate your software development with Docker
Accelerate your software development with DockerAccelerate your software development with Docker
Accelerate your software development with Docker
 
Docker 1.11 Presentation
Docker 1.11 PresentationDocker 1.11 Presentation
Docker 1.11 Presentation
 
Introduction to Docker and Monitoring with InfluxData
Introduction to Docker and Monitoring with InfluxDataIntroduction to Docker and Monitoring with InfluxData
Introduction to Docker and Monitoring with InfluxData
 
Docker Ecosystem on Azure
Docker Ecosystem on AzureDocker Ecosystem on Azure
Docker Ecosystem on Azure
 
Docker New York Meetup May 2015 - The Docker Orchestration Ecosystem on Azure
Docker New York Meetup May 2015 - The Docker Orchestration Ecosystem on Azure Docker New York Meetup May 2015 - The Docker Orchestration Ecosystem on Azure
Docker New York Meetup May 2015 - The Docker Orchestration Ecosystem on Azure
 
Docker and kubernetes
Docker and kubernetesDocker and kubernetes
Docker and kubernetes
 
Docker DANS workshop
Docker DANS workshopDocker DANS workshop
Docker DANS workshop
 
ExpoQA 2017 Using docker to build and test in your laptop and Jenkins
ExpoQA 2017 Using docker to build and test in your laptop and JenkinsExpoQA 2017 Using docker to build and test in your laptop and Jenkins
ExpoQA 2017 Using docker to build and test in your laptop and Jenkins
 
Using Docker to build and test in your laptop and Jenkins
Using Docker to build and test in your laptop and JenkinsUsing Docker to build and test in your laptop and Jenkins
Using Docker to build and test in your laptop and Jenkins
 
Docker Azure Friday OSS March 2017 - Developing and deploying Java & Linux on...
Docker Azure Friday OSS March 2017 - Developing and deploying Java & Linux on...Docker Azure Friday OSS March 2017 - Developing and deploying Java & Linux on...
Docker Azure Friday OSS March 2017 - Developing and deploying Java & Linux on...
 
Containers and Nutanix - Acropolis Container Services
Containers and Nutanix - Acropolis Container ServicesContainers and Nutanix - Acropolis Container Services
Containers and Nutanix - Acropolis Container Services
 

More from Nelson Calero

Database automation guide - Oracle Community Tour LATAM 2023
Database automation guide - Oracle Community Tour LATAM 2023Database automation guide - Oracle Community Tour LATAM 2023
Database automation guide - Oracle Community Tour LATAM 2023Nelson Calero
 
Terraform Tips and Tricks - LAOUC 2022
Terraform Tips and Tricks - LAOUC 2022Terraform Tips and Tricks - LAOUC 2022
Terraform Tips and Tricks - LAOUC 2022Nelson Calero
 
Oracle on kubernetes 101 - Dec/2021
Oracle on kubernetes 101 - Dec/2021Oracle on kubernetes 101 - Dec/2021
Oracle on kubernetes 101 - Dec/2021Nelson Calero
 
Redefining tables online without surprises
Redefining tables online without surprisesRedefining tables online without surprises
Redefining tables online without surprisesNelson Calero
 
Protect Sensitive Data: Implementing Fine-Grained Access Control in Oracle
Protect Sensitive Data: Implementing Fine-Grained Access Control in OracleProtect Sensitive Data: Implementing Fine-Grained Access Control in Oracle
Protect Sensitive Data: Implementing Fine-Grained Access Control in OracleNelson Calero
 
Evolution of Performance Management: Oracle 12c adaptive optimizations - ukou...
Evolution of Performance Management: Oracle 12c adaptive optimizations - ukou...Evolution of Performance Management: Oracle 12c adaptive optimizations - ukou...
Evolution of Performance Management: Oracle 12c adaptive optimizations - ukou...Nelson Calero
 
Oracle Exadata Maintenance tasks 101 - OTN Tour 2015
Oracle Exadata Maintenance tasks 101 - OTN Tour 2015Oracle Exadata Maintenance tasks 101 - OTN Tour 2015
Oracle Exadata Maintenance tasks 101 - OTN Tour 2015Nelson Calero
 
My Experience Using Oracle SQL Plan Baselines 11g/12c
My Experience Using Oracle SQL Plan Baselines 11g/12cMy Experience Using Oracle SQL Plan Baselines 11g/12c
My Experience Using Oracle SQL Plan Baselines 11g/12cNelson Calero
 
Oracle RAC sin sorpresas - v2014
Oracle RAC sin sorpresas - v2014Oracle RAC sin sorpresas - v2014
Oracle RAC sin sorpresas - v2014Nelson Calero
 
Alta disponibilidad con Pacemaker
Alta disponibilidad con PacemakerAlta disponibilidad con Pacemaker
Alta disponibilidad con PacemakerNelson Calero
 
AROUG BIDAY 2013 - Automatizar procesos de ETL con PL/SQL
AROUG BIDAY 2013 - Automatizar procesos de ETL con PL/SQLAROUG BIDAY 2013 - Automatizar procesos de ETL con PL/SQL
AROUG BIDAY 2013 - Automatizar procesos de ETL con PL/SQLNelson Calero
 
MariaDB y FOSS en infraestructura de salud y estándares
MariaDB y FOSS en infraestructura de salud y estándaresMariaDB y FOSS en infraestructura de salud y estándares
MariaDB y FOSS en infraestructura de salud y estándaresNelson Calero
 
UYOUG 2012 - Oracle RAC 11gR2 - New features
UYOUG 2012 - Oracle RAC 11gR2 - New featuresUYOUG 2012 - Oracle RAC 11gR2 - New features
UYOUG 2012 - Oracle RAC 11gR2 - New featuresNelson Calero
 
Collaborate 2012 - Administering MySQL for Oracle DBAs
Collaborate 2012 - Administering MySQL for Oracle DBAsCollaborate 2012 - Administering MySQL for Oracle DBAs
Collaborate 2012 - Administering MySQL for Oracle DBAsNelson Calero
 
Collaborate 2012 - RMAN Eliminate the mystery
Collaborate 2012 - RMAN Eliminate the mysteryCollaborate 2012 - RMAN Eliminate the mystery
Collaborate 2012 - RMAN Eliminate the mysteryNelson Calero
 
Collaborate 2012 - Administering MySQL for Oracle DBAs
Collaborate 2012 - Administering MySQL for Oracle DBAsCollaborate 2012 - Administering MySQL for Oracle DBAs
Collaborate 2012 - Administering MySQL for Oracle DBAsNelson Calero
 
Collaborate 2012 - RMAN eliminate the mystery
Collaborate 2012 - RMAN eliminate the mysteryCollaborate 2012 - RMAN eliminate the mystery
Collaborate 2012 - RMAN eliminate the mysteryNelson Calero
 
Alternativas de alta disponiblidad en MySQL - MySQL Meetup - Montevideo - Mar...
Alternativas de alta disponiblidad en MySQL - MySQL Meetup - Montevideo - Mar...Alternativas de alta disponiblidad en MySQL - MySQL Meetup - Montevideo - Mar...
Alternativas de alta disponiblidad en MySQL - MySQL Meetup - Montevideo - Mar...Nelson Calero
 
Difusión UYOUG 2012 - Oracle Developer Day - Montevideo
Difusión UYOUG 2012 - Oracle Developer Day - MontevideoDifusión UYOUG 2012 - Oracle Developer Day - Montevideo
Difusión UYOUG 2012 - Oracle Developer Day - MontevideoNelson Calero
 
OOW LatinAmerica 2011 - RMAN sin misterios
OOW LatinAmerica 2011 - RMAN sin misteriosOOW LatinAmerica 2011 - RMAN sin misterios
OOW LatinAmerica 2011 - RMAN sin misteriosNelson Calero
 

More from Nelson Calero (20)

Database automation guide - Oracle Community Tour LATAM 2023
Database automation guide - Oracle Community Tour LATAM 2023Database automation guide - Oracle Community Tour LATAM 2023
Database automation guide - Oracle Community Tour LATAM 2023
 
Terraform Tips and Tricks - LAOUC 2022
Terraform Tips and Tricks - LAOUC 2022Terraform Tips and Tricks - LAOUC 2022
Terraform Tips and Tricks - LAOUC 2022
 
Oracle on kubernetes 101 - Dec/2021
Oracle on kubernetes 101 - Dec/2021Oracle on kubernetes 101 - Dec/2021
Oracle on kubernetes 101 - Dec/2021
 
Redefining tables online without surprises
Redefining tables online without surprisesRedefining tables online without surprises
Redefining tables online without surprises
 
Protect Sensitive Data: Implementing Fine-Grained Access Control in Oracle
Protect Sensitive Data: Implementing Fine-Grained Access Control in OracleProtect Sensitive Data: Implementing Fine-Grained Access Control in Oracle
Protect Sensitive Data: Implementing Fine-Grained Access Control in Oracle
 
Evolution of Performance Management: Oracle 12c adaptive optimizations - ukou...
Evolution of Performance Management: Oracle 12c adaptive optimizations - ukou...Evolution of Performance Management: Oracle 12c adaptive optimizations - ukou...
Evolution of Performance Management: Oracle 12c adaptive optimizations - ukou...
 
Oracle Exadata Maintenance tasks 101 - OTN Tour 2015
Oracle Exadata Maintenance tasks 101 - OTN Tour 2015Oracle Exadata Maintenance tasks 101 - OTN Tour 2015
Oracle Exadata Maintenance tasks 101 - OTN Tour 2015
 
My Experience Using Oracle SQL Plan Baselines 11g/12c
My Experience Using Oracle SQL Plan Baselines 11g/12cMy Experience Using Oracle SQL Plan Baselines 11g/12c
My Experience Using Oracle SQL Plan Baselines 11g/12c
 
Oracle RAC sin sorpresas - v2014
Oracle RAC sin sorpresas - v2014Oracle RAC sin sorpresas - v2014
Oracle RAC sin sorpresas - v2014
 
Alta disponibilidad con Pacemaker
Alta disponibilidad con PacemakerAlta disponibilidad con Pacemaker
Alta disponibilidad con Pacemaker
 
AROUG BIDAY 2013 - Automatizar procesos de ETL con PL/SQL
AROUG BIDAY 2013 - Automatizar procesos de ETL con PL/SQLAROUG BIDAY 2013 - Automatizar procesos de ETL con PL/SQL
AROUG BIDAY 2013 - Automatizar procesos de ETL con PL/SQL
 
MariaDB y FOSS en infraestructura de salud y estándares
MariaDB y FOSS en infraestructura de salud y estándaresMariaDB y FOSS en infraestructura de salud y estándares
MariaDB y FOSS en infraestructura de salud y estándares
 
UYOUG 2012 - Oracle RAC 11gR2 - New features
UYOUG 2012 - Oracle RAC 11gR2 - New featuresUYOUG 2012 - Oracle RAC 11gR2 - New features
UYOUG 2012 - Oracle RAC 11gR2 - New features
 
Collaborate 2012 - Administering MySQL for Oracle DBAs
Collaborate 2012 - Administering MySQL for Oracle DBAsCollaborate 2012 - Administering MySQL for Oracle DBAs
Collaborate 2012 - Administering MySQL for Oracle DBAs
 
Collaborate 2012 - RMAN Eliminate the mystery
Collaborate 2012 - RMAN Eliminate the mysteryCollaborate 2012 - RMAN Eliminate the mystery
Collaborate 2012 - RMAN Eliminate the mystery
 
Collaborate 2012 - Administering MySQL for Oracle DBAs
Collaborate 2012 - Administering MySQL for Oracle DBAsCollaborate 2012 - Administering MySQL for Oracle DBAs
Collaborate 2012 - Administering MySQL for Oracle DBAs
 
Collaborate 2012 - RMAN eliminate the mystery
Collaborate 2012 - RMAN eliminate the mysteryCollaborate 2012 - RMAN eliminate the mystery
Collaborate 2012 - RMAN eliminate the mystery
 
Alternativas de alta disponiblidad en MySQL - MySQL Meetup - Montevideo - Mar...
Alternativas de alta disponiblidad en MySQL - MySQL Meetup - Montevideo - Mar...Alternativas de alta disponiblidad en MySQL - MySQL Meetup - Montevideo - Mar...
Alternativas de alta disponiblidad en MySQL - MySQL Meetup - Montevideo - Mar...
 
Difusión UYOUG 2012 - Oracle Developer Day - Montevideo
Difusión UYOUG 2012 - Oracle Developer Day - MontevideoDifusión UYOUG 2012 - Oracle Developer Day - Montevideo
Difusión UYOUG 2012 - Oracle Developer Day - Montevideo
 
OOW LatinAmerica 2011 - RMAN sin misterios
OOW LatinAmerica 2011 - RMAN sin misteriosOOW LatinAmerica 2011 - RMAN sin misterios
OOW LatinAmerica 2011 - RMAN sin misterios
 

Recently uploaded

Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 

Recently uploaded (20)

E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 

Practical guide to Oracle Virtual environments

  • 1. Practical guide to Oracle Virtual environments ODC Tour Latin America – August 2018 Nelson Calero
  • 2. Today’s topics • Virtual environments review – Docker – Oracle VirtualBox – Oracle VM – Oracle Cloud • Automation – Vagrant – Ansible – Terraform • Examples – VirtualBox VMs using Vagrant/Ansible – Docker on Windows – RAC using VirtualBox and Docker – Terraform for Oracle Cloud instances 2 © 2018 Pythian Motivation Explore alternatives to create database environments Intended audience DBAs and Developers
  • 3. • Database Consultant at Pythian since 2014 • Working with Oracle tools and Linux environments since 1996 • DBA Oracle (2001) & MySQL (2005) • Co-founder and President of the Oracle user Group of Uruguay (2009) • LAOUC Director of events (2013) • Computer Engineer (1998) • Oracle ACE (2014), Oracle ACE Director (2017) • Oracle Certified Professional 10g/11g/12c, OCE, Cloud DB & Infra • Amazon Solutions Architect – Associate (2016) • Google Cloud Architect (2017), Google Cloud Data Engineer (2017) • Oracle University Instructor (2011) • Blogger and speaker: Oracle Open World, Collaborate, OTN Tour, Regional conferences About me 3 © 2018 Pythian http://www.linkedin.com/in/ncalero @ncalerouy
  • 4. Pythian overview © 2015 Pythian Confidential4 • 22 Years of data infrastructure management consulting • 250+ Top brands • 11800+ Systems under management • 400+ employees in 35 countries • 10 Oracle ACEs, 4 ACED, 3 OakTable members, 2 OCM, 6 Microsoft MVPs, 1 Cloudera Champion of Big Data, AWS Certified Solutions Architect – 2 Professional, 12 Associate • Oracle, Microsoft, MySQL, Hadoop, Cassandra, MongoDB, and more • Infrastructure, Cloud, DevOps, and application expertise
  • 5. 5 © 2018 Pythian
  • 6. Introduction to Virtual environments 6 KVM, Oracle VM, VirtualBox, … LXC, WPAR, Docker, … Sharing server resources isolating processes https://docs.docker.com/get-started/
  • 7. Introduction to Virtual environments • Hypervisors (Server virtualization) – Type 1: run directly in host’s hardware • Xen, Oracle VM, Hyper-V, Vmware ESX, KVM, … – Type 2: run on a OS (host) • VMware Workstation, VirtualBox, QEMU, … • Containers (OS virtualization) – Share OS kernel and libraries – LXC, Docker – MOS 2216342.1 Oracle Support for Database Running on Docker  Supported SI on Oracle Linux 7 with UEK4 (and later) or RHEL7 7 © 2018 Pythian
  • 8. Not only server virtualization • Data virtualization – Delphix, … • Storage snapshots (vendor based) – SMO, NetAPP, Oracle ACFS, .. – gDBClone – clone databases based on ACFS snapshots http://www.oracle.com/technetwork/indexes/samplecode/gdbclone-download-2295388.html • Cloud provisioning – Compute instances – managed hypervisor – Bare Metal – bring your own hypervisor (only on new OCI, not classic) – Containers – as managed services or DIY in BM 8 © 2018 Pythian
  • 9. Today’s focus: VMs and containers 9 © 2018 Pythian
  • 10. Containers with Docker 10 • Creates process with access to same OS binaries and resources from the host, executing programs in isolation as if they were inside a VM • Runs on any OS - Download latest binary from https://www.docker.com - On Windows it creates a VirtualBox VM to execute containers inside it  VM needs CPU, disk and RAM adjustments to be useful • Commands: - docker-machine: manage machines running Docker (Windows/Mac before v1.12) - docker o build: Build an image from a Dockerfile o run: Run a command in a new container o exec: Run a command in a running container © 2018 Pythian
  • 11. Docker – command line Windows – control VM status 11 D:>docker-machine ls NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS default - virtualbox Running tcp://192.168.99.100:2376 v18.01.0-ce Management Commands: checkpoint Manage checkpoints config Manage Docker configs container Manage containers image Manage images network Manage networks node Manage Swarm nodes plugin Manage plugins secret Manage Docker secrets service Manage services stack Manage Docker stacks swarm Manage Swarm system Manage Docker volume Manage volumes D:>docker Commands: attach Attach local standard input, output, and error streams to a running contain build Build an image from a Dockerfile commit Create a new image from a container's changes cp Copy files/folders between a container and the local filesystem create Create a new container deploy Deploy a new stack or update an existing stack diff Inspect changes to files or directories on a container's filesystem events Get real time events from the server exec Run a command in a running container export Export a container's filesystem as a tar archive history Show the history of an image images List images import Import the contents from a tarball to create a filesystem image info Display system-wide information inspect Return low-level information on Docker objects kill Kill one or more running containers load Load an image from a tar archive or STDIN login Log in to a Docker registry logout Log out from a Docker registry logs Fetch the logs of a container pause Pause all processes within one or more containers port List port mappings or a specific mapping for the container ps List containers ...
  • 12. Docker – configuration 12 Dockerfile – instructions to execute when a container starts FROM oraclelinux:7-Slim # Pull base image … USER Oracle RUN $INSTALL_DIR/$INSTALL_DB_BINARIES_FILE EE … CMD exec $ORACLE_BASE/$RUN_FILE Base image usually are OS images, not including Oracle binaries (license restriction) Exception: Oracle provided images: - Docker Store: https://store.docker.com/images/oracle-database-enterprise-edition - Oracle Container Registry: https://container-registry.oracle.com Useful github repositories: – https://github.com/oracle/docker-images/OracleDatabase - RAC and Single instance – https://github.com/Seth-Miller/12c-rac-docker - pioneer RAC configuration © 2018 Pythian
  • 13. Docker – creating a container 13 Install github repository D:GitHub>git clone https://github.com/oracle/docker-images.git Cloning into 'docker-images'... remote: Counting objects: 7740, done. remote: Compressing objects: 100% (36/36), done. rRemote: Total 7740 (delta 18), reused 45 (delta 16), pack-reused 7688 Receiving objects: 100% (7740/7740), 9.70 MiB | 870.00 KiB/s, done. Resolving deltas: 100% (4286/4286), done. Checking connectivity... done. Checking out files: 100% (968/968), done. Create the container (11.2.0.2 XE, 12.1.0.2 or 12.2.0.1 EE or SE as of March 2018): D:GitHub12.1.0.2/…>docker build -t oracle/database:12.1.0.2-ee -f Dockerfile.ee . Download Oracle installation files from OTN: • http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html • Copy to directory D:GitHubdocker-imagesOracleDatabasedockerfiles12.1.0.2 © 2018 Pythian
  • 14. Docker – creating a container 14 Start the container (Windows example): D:>docker run --name ora121 -p 1521:1521 -p 5500:5500 -e ORACLE_SID=orcl -e ORACLE_PDB=pdb1 -e ORACLE_PWD=Oracle_123 -e ORACLE_CHARACTERSET=AL32UTF8 -v //c/users/calero/.docker/persistentdisk/ora121://opt/oracle/oradata oracle/database:12.1.0.2-ee Status of running containers D:>docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 2c1afcad6a50 oracle/database:12.1.0.2-ee "/bin/sh -c 'exec $O…" 11 hours ago Up 11 hours (healthy) 0.0.0.0:1521->1521/tcp, 0.0.0.0:5500->5500/tcp ora121 Status D:>docker image ls REPOSITORY TAG IMAGE ID CREATED SIZE oracle/database 12.1.0.2-ee c175ddb41772 4 minutes ago 10.6GB oraclelinux 7-slim 9870bebfb1d5 2 months ago 118MB © 2018 Pythian
  • 15. Docker – connecting to Oracle 15 Using sqlplus binary from container Connect to database running in container – using host Oracle client D:>docker-machine ip 192.168.99.100 C:Userscalero>sqlplus system/Oracle_123@"192.168.99.100:1521/orcl" SQL*Plus: Release 12.1.0.2.0 Production on Sun Feb 4 01:51:50 2018 ... Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options D:>docker exec -ti 2c1afcad6a50 sqlplus pdbadmin/Oracle_123@pdb1 SQL*Plus: Release 12.1.0.2.0 Production on Sun Feb 4 16:23:47 2018 ... Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options © 2018 Pythian
  • 16. Docker - images from container-registry Register in container-registry.oracle.com Start session Download image Step by step guide: 16 D:>docker login container-registry.oracle.com Username: nelson.calero@gmail.com Password: xxx Login Succeeded D:>docker pull container-registry.oracle.com/database/enterprise:12.2.0.1 12.2.0.1: Pulling from database/enterprise 9bd4d110366e: Downloading [> ] 2.668MB/143MB af8b29651e27: Download complete http://databaseindex.blogspot.com/2018/04/oracle-12c-docker-windows-ocr.html © 2018 Pythian
  • 17. Example – Oracle DB using Docker Image Check local images 17 D:>docker images REPOSITORY TAG IMAGE ID CREATED SIZE container-registry.oracle.com/database/enterprise 12.2.0.1 12a359cd0528 5 months ago 3.44GB Define image settings D:>echo DB_MEMORY=1Gb >ora.conf Start the container D:>docker run -d -it --name ora122 -P --env-file ora.conf container-registry.oracle.com/database/enterprise:12.2.0.1 5896d37c1cae083c9ab82ec52cf9900a3b22a012b5257c1cb065a6093d7d55c5 Check running containers D:>docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 5896d37c1cae container-registry.oracle.com/database/enterprise:12.2.0.1 "/bin/sh -c '/bin/ba…" 24 minutes ago Up 24 minutes (healthy) 0.0.0.0:32769->1521/tcp, 0.0.0.0:32768->5500/tcp ora122
  • 18. Summary – Oracle DB using Docker Using images with preinstalled Oracle binaries - Docker Store - Container registry Step-by-step: http://databaseindex.blogspot.com/2018/04/oracle-12c-docker-windows-ocr.html Using Oracle github repository, must download binaries from OTN - Step-by-step example on Windows 10: http://www.oracle.com/technetwork/es/articles/datawarehouse/oracle12c-docker-win10-4485487-esa.html More examples: - Standby: https://github.com/jamesattard/oracle-xe-docker - RAC: https://github.com/Seth-Miller/12c-rac-docker https://github.com/oracle/docker-images/tree/master/OracleDatabase/RAC 18 © 2018 Pythian
  • 19. Docker - creating a container 19 Demo © 2018 Pythian
  • 20. Hypervisors – Oracle VM (type 1) • Xen Kernel – UEK R4 as of July 2018 with OVM 3.4.4 • Server needs to boot with it (reinstall needed if other OS was used) • Minimal resources used by OVM server (1 CPU 2Gg RAM) • VMs uses free available server’s resources – can be created from OVS using CLI (xm) or using OVM manager web client – RAM/CPUs can be allocated dynamically without restarting VMs (up to max config) – Only supported method to reduce license costs (hard partitioning) – HA configuration allowed with clustered repositories (using SAN, not with local HDs) – Windows, Linux and Solaris guests • OVM Manager – Needs to be installed in a different server – Uses MySQL as metadata repository 20 © 2018 Pythian
  • 21. Oracle VM - examples 21 © 2018 Pythian [root@ovs ~]# xm list Name ID Mem VCPUs State Time(s) 0004fb00000600001000d7829bf5a105 4 30723 4 -b---- 2415636.4 0004fb0000060000cf08a173c50efdc1 2 13063 4 r----- 784876.4 Domain-0 0 1958 20 r----- 1211462.2 [root@ovs /OVS/Repositories]# ls -l */VirtualMachines/*/vm.cfg -rw------- 1 root root 1950 Apr 19 02:37 0004fb00000300005b800c75ea8932be/VirtualMachines/0004fb00000600001000d7829bf5a105/vm.cfg -rw-r--r-- 1 root root 1946 Apr 19 02:36 0004fb00000300005b800c75ea8932be/VirtualMachines/0004fb0000060000cf08a173c50efdc1/vm.cfg [root@ovs ~]# lscpu Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 20 Hypervisor vendor: Xen Virtualization type: none [root@ovs ~]# cd /OVS/Repositories/*/VirtualMachines [root@ovs VirtualMachines]# grep cpus 0004fb0000060000cf08a173c50efdc1/vm.cfg maxvcpus = 4 vcpus = 4 cpus = '0-3‘ # '2,3'
  • 22. Oracle VM Manager console 22 © 2018 Pythian
  • 23. VirtualBox VMs (type 2) • Run on any OS (Linux, Windows, Mac) • Download binaries for your platform • How to create your Oracle VM? – a) Download OS ISO+ Oracle binaries Create VM, boot from ISO, install OS + DB, create DB – b) Download VM template - all pre(installed/configured) http://www.oracle.com/technetwork/community/developer-vm/index.html – c) use tools to automate a) • Several github repos available (details later) • Allows to customize your VM and create your own template 23 © 2018 Pythian
  • 24. Example – Oracle DB using Vbox © 2015 Pythian Confidential24
  • 25. 25
  • 26. CLI tools • VBox: VBoxManage post creation steps? • Docker: dockerfile – ENTRYPOINT – commands to execute when container is run – CMD – provide default parameters for ENTRYPOINTS or executing an ad-hoc command 26 C:Program FilesOracleVirtualBox> ./VBoxManage list vms "Oracle DB Developer VM" {6f3d3706-a84d-4163-9bf7-14da26393179} "oracle-OEL69" {2b835d64-f868-44d8-88e9-9f214dd2fb7d} "oel68-asm2" {e4d7eb54-2159-4398-a49a-3c2ccfe3cc86} "oel68-asm1" {bc5e8bc7-3e15-47a1-b81c-2d7bca77b7dd} "ora12c-si-asm-oel682" {a7318e8a-5b6d-496f-992c-46f84108d345} "ora12c-si-asm-oel681" {19e74473-bb07-423d-914c-354dc94d6b61} "default" {fbe05e1e-3c50-4f8f-ba29-6a795a56bdc8} © 2018 Pythian
  • 27. Automation tools Vagrant (from HashiCorp) - Manage VMs with a standard workflow - Out of the box with support for VirtualBox, Hyper-V, and Docker - Uses CLI (Vbox, Vmware, Docker) to manage lifecycle - Handles CLI parameters accordingly with their different versions - Automatic ssh setup, etc - Configuration files, providers, plugins - Use case: few local VMs - Runs on any OS – Linux, Windows, Mac 27 Ansible (from RedHat) • Automation tool using a simple configuration language • Agentless, uses OpenSSH and WinRM • Provisioning, configuration management and workload orchestration • Available on Linux and Mac Terraform (from HashiCorp) • Build infrastructure, complex sets, local and remote using simple language • Runs on any OS © 2018 Pythian
  • 28. Vagrant 28 $ vagrant init hashicorp/precise64 $ vagrant up Bringing machine 'default' up with 'virtualbox' provider... ==> default: Importing base box 'hashicorp/precise64'... ==> default: Forwarding ports... default: 22 (guest) => 2222 (host) (adapter 1) ==> default: Waiting for machine to boot... $ vagrant ssh vagrant@precise64:~$ _ Install latest binaries: https://www.vagrantup.com/downloads.html OS Images - Called box: used to create your VM. - Public catalog: https://app.vagrantup.com/boxes/search - or create your own, or use from any URL Vagrantfile - Configuration and provisioning steps - Ruby syntax - Created with defaults using init Simple example: creating a VM based on precise64 image (Ubuntu 12.04 64- bit) from their public catalog © 2018 Pythian
  • 29. Vagrant Provisioning: execute steps after it is running - part of initial up process, or called manually - Built-in types: Shell, Ansible, Chef, Docker, Puppet, Salt, … Sample Vagrantfile using a shell provisioner Providers: virtual machine to manage - Out of the box for: VirtualBox (default), Docker, Hyper-V - More can be installed as plugins: Vmware, Custom 29 © 2018 Pythian Vagrant.configure("2") do |config| config.vm.provision "shell", inline: "echo Hello, World" end
  • 30. Vagrant - commands 30 D:GitHub>vagrant box list bento/oracle-6.9 (virtualbox, 201801.02.0) kikitux/oracle6-racattack (virtualbox, 16.01.01) oravirt/ol67 (virtualbox, 20170424) oravirt/ol68 (virtualbox, 20170418) oravirt/ol72 (virtualbox, 20170425) D:GitHub>vagrant Usage: vagrant [options] <command> [<args>] box manages boxes: installation, removal, etc. init initializes a new Vagrant environment by creating a Vagrantfile validate validates the Vagrantfile up starts and provisions the vagrant environment provision provisions the vagrant machine push deploys code in this environment to a configured destination port displays information about guest port mappings status outputs status of the vagrant machine connect connect to a remotely shared Vagrant environment suspend suspends the machine resume resume a suspended vagrant machine halt stops the vagrant machine destroy stops and deletes all traces of the vagrant machine reload restarts vagrant machine, loads new Vagrantfile configuration snapshot manages snapshots: saving, restoring, etc. ssh connects to machine via SSH powershell connects to machine via powershell remoting rdp connects to machine via RDP
  • 31. Ansible • Install binaries in a control machine (Windows not supported) • No agent – uses ssh to connect to remote machines • Inventory to define machines to use - /etc/ansible/hosts • Playbook: language used for configuration, deployment, and orchestration – YAML format – tags and actions to execute – conditional control: when, loop, until – this is the main code to keep under source control • Modules describing resources and desired state – Created by us or built-in modules: http://docs.ansible.com/modules_by_category.html – Can be executed directly or inside playbooks 31 © 2018 Pythian
  • 32. Ansible playbooks Sample playbook – playbook.yml To execute it: 32 - hosts: webservers remote_user: root tasks: - name: ensure apache is at the latest version yum: name: httpd state: latest - name: write the apache config file template: src: /srv/httpd.j2 dest: /etc/httpd.conf $ ansible-playbook playbook.yml © 2018 Pythian
  • 33. Oracle VBox VMs using Vagrant/Ansible (1) Repository with several configurations: https://github.com/oravirt/ Example for single instance: vagrant-vbox-si-asm  Customization explained: ${INST_DIR}/README.md  Code to change: o vagrant-vbox-si-asmhosts.yml: o vagrant-vbox-si-asmextra-provisionansible-oraclegroup_vars  Copy binary files from OTN - ${INST_DIR}vagrant-vbox-si-asmswrepo 33 basename_vm: ora12c-si-asm-oel68 num_vm: 2 base_priv_ip: 172.16.56.30 # (your chosen IP) oracle_install_version_gi: 12.1.0.2 oracle_version_db: 12.1.0.2 © 2018 Pythian
  • 34. Oracle VBox VMs using Vagrant/Ansible (2) To create the VM without installing Oracle: To install Oracle after the VM is created: All together: 34 D:GitHubvboxsi2vagrant-vbox-si-asm>vagrant provision ==> oel68-asm1: Running provisioner: ansible_local... Vagrant has automatically selected the compatibility mode '2.0' according to the Ansible version installed (2.2.1.0). … PLAY [all] ********************************************************************* TASK [setup] ******************************************************************* ok: [oel68-asm1] TASK [init : Install packages] ************************************************* ok: [oel68-asm1] => (item=[u'ntp', u'dnsmasq']) … $ vagrant up $ setup=true ; vagrant up © 2018 Pythian
  • 35. Oracle VBox VMs using Vagrant/Ansible DEMO time More step-by-step examples: - Oracle Standby 12c using vagrant-vbox-si-asm: http://databaseindex.blogspot.com/2018/02/crear-oracle-standby-12c-usando.html - Oracle 12c VM on Windows 10 using ubuntu shell (WLS) and ansible: http://databaseindex.blogspot.com/2018/03/oracle-12c-vagrant-windows-wls-ubuntu.html 35 © 2018 Pythian
  • 36. Oracle RAC VBox VMs • Similar approach: https://github.com/racattack/racattack-ansible-oracle • Implements configuration described in RAC Attack handbook: https://en.wikibooks.org/wiki/RAC_Attack_-_Oracle_Cluster_Database_at_Home/RAC_Attack_12c • Customization explained in project readme (README.md) on Vagrantfile: step-by-step example on Windows: http://databaseindex.blogspot.com/2017/04/automatizar-instalacion-de-oracle-rac.html 36 © 2018 Pythian ############################# ##### BEGIN CUSTOMIZATION ##### ############################# #define number of nodes num_APPLICATION = 0 num_LEAF_INSTANCES = 0 num_DB_INSTANCES = 1 #define number of cores for guest num_CORE = 1 #define memory for each type of node in MBytes memory_APPLICATION = 1500 memory_LEAF_INSTANCES = 2300 memory_DB_INSTANCES = 3072
  • 37. Oracle RAC with Docker As pointed earlier: https://github.com/oracle/docker-images/tree/master/OracleDatabase/RAC Several containers needs to be created: - OracleConnectionManager: bind single port to host and serve containers on different ports - OracleRACStorageServer: Oracle ASM on NFS Server for RAC testing - OracleRealApplicationClusters: RAC instance, minimum two Several steps for each container. 37 © 2018 Pythian
  • 38. VMs in Oracle Cloud • Infrastructure services – Database Cloud Service (DBCS): all managed, pre-built configurations – Compute (OCI or OCI-C): install DB manually as in VirtualBox – Bare Metal and BYOH (OCI): entire server, can install OVM or use as Compute • Container services • Automation – Terraform for OCI and OCI-C – Orchestration for OCI-C – REST API Upcoming example – already in my other session about that topic 38 © 2018 Pythian
  • 39. Example: OCI Instance using Terraform • Download Terraform binary (my example uses v0.11.3) – https://www.terraform.io/downloads.html • Download Terraform OCI-provider (using v2.1.0) – https://github.com/oracle/terraform-provider-oci/releases • Create .tf HCL Project (based on examples): – https://github.com/oracle/terraform-provider-oci/tree/master/docs/examples • Configure your account Access (env-vars.ps1) – Tenancy and user OCIDs, fingerprint, private key, region • Terraform Plan • Terraform Apply • Step by step guide: https://community.oracle.com/docs/DOC-1019936 39 © 2018 Pythian
  • 40. ncalero@H6RMYZ1:/mnt/d/GitHub/terraform-OCI/$ ls block.tf compute.tf env-vars.ps1 outputs.tf userdata datasources.tf network.tf provider.tf remote-exec.tf variables.tf ncalero@H6RMYZ1:/mnt/d/GitHub/terraform-OCI$ cat /mnt/c/users/calero/AppData/Roaming/terraform.rc providers { oci = "d:softterraform-provider-oci_v2.1.0.exe" } 40 © 2018 Pythian PS D:GitHubterraform-OCI> cat ./env-vars.ps1 $env:TF_VAR_tenancy_ocid="ocid1.tenancy.oc1..aaaaaaaaw5hodl4pajmymyo62bwkj4kokziowmjkvj7fvmgt4lqia3yg7km" $env:TF_VAR_user_ocid="ocid1.user.oc1..aaaaaaaaiyhrscq7rhfiyhrscql4tb3ojto2ysw72l656yknkyqau2lxotqf" $env:TF_VAR_compartment_ocid="ocid1.compartment.oc1.. aaaaaaaakdevdha7q7yjdheridcy63sgv2syefv7x46u67jk4hj" $env:TF_VAR_region="us-ashburn-1“ $env:TF_VAR_fingerprint="db:a3:b8:59:ce:05:ff:78:c0:fb:aa:ca:d7:09:77:ad" $env:TF_VAR_private_key_path="C:Userscalero.ocioci_api_key.pem" ### Public/private keys used on the instances $env:TF_VAR_ssh_public_key = Get-Content C:Userscalero.sshid_rsa.pub -Raw $env:TF_VAR_ssh_private_key = Get-Content C:Userscalero.sshid_rsa -Raw PS D:GitHubterraform-OCI> ./env-vars.ps1
  • 41. ncalero@H6RMYZ1:/mnt/d/GitHub/terraform-OCI$ cat compute.tf resource "oci_core_instance" "DemoInstance" { availability_domain = "${lookup(data.oci_identity_availability_domains.ADs.availability_domains[0],"name")}" compartment_id = "${var.compartment_ocid}" display_name = "Demo-Instance" image = "${lookup(data.oci_core_images.OLImageOCID.images[0], "id")}" shape = "${var.InstanceShape}" subnet_id = "${oci_core_subnet.SN-DemoSubnetAD1.id}" metadata { ssh_authorized_keys = "${var.ssh_public_key}" user_data = "${base64encode(file(var.InstanceBootStrap))}" } } ncalero@H6RMYZ1:/mnt/d/GitHub/terraform-OCI/demo$ cat provider.tf provider "oci" { tenancy_ocid = "${var.tenancy_ocid}" user_ocid = "${var.user_ocid}" fingerprint = "${var.fingerprint}" private_key_path = "${var.private_key_path}“ region = "${var.region}" } 41 © 2018 Pythian
  • 42. 42 © 2018 Pythian
  • 43. 43 © 2018 Pythian
  • 44. © 2015 Pythian Confidential44 PS D:GitHubterraform-OCI> d:softterraform graph | dot -Tpng -o demo-graph.png
  • 45. Terraform apply © 2015 Pythian Confidential45
  • 46. Summary Comparing options to create an Oracle instance using dataguard (2 VMs) Notes: * host CPU can be shared among VMs but performance will be impacted. Use 1 CPU per VM for prod ** only as described in MOS 2216342.1 - SI on OEL7 with UEK4 or RHEL7 as of July 2018 *** once familiar with the tool and concepts 46 Solution Host OS Disk space CPU min. License Creation effort Production support OVM OVM 2xVM+ 1 (*) VM CPUs Medium yes VirtualBox any 2xVM 1 (*) Entire host Easy (***) no Docker any 1xVM+ 1 (*) Entire host Easy (***) yes (**) Cloud any 2xVM 1 (*) VM shape Easiest yes © 2018 Pythian
  • 47. References - documentation • Virtualization concepts: https://en.wikipedia.org/wiki/X86_virtualization • Docker documentation: https://docs.docker.com/ • Oracle database on Docker – github project: https://github.com/oracle/docker-images • VirtualBox user guide: https://www.virtualbox.org/manual/ch01.html • Oracle VM documentation: https://www.oracle.com/technetwork/documentation/vm-096300.html • Vagrant documentation: https://www.vagrantup.com/intro/index.html • Ansible user guide: https://docs.ansible.com/ansible/latest/user_guide/index.html • Terraform documentation: https://www.terraform.io/intro/index.html 47 © 2018 Pythian