SlideShare une entreprise Scribd logo
1  sur  27
Reduce resource consumption and clone in 
seconds your oracle virtual environment on 
your laptop using linux containers and 
btrfs 
Bertrand Drouvot
About Me 
Oracle DBA since 1999 
OCP 9i,10g,11g 
Rac certified Expert 
Exadata certified implementation specialist 
Blogger since 2012 
@bertranddrouvot 
BasketBall fan
Will present 
Linux containers (LXC) 
btfrs FileSystem 
Use case to minimise resource consumption on your laptop 
From an oracle DBA point of view 
Use case 1: Clone a database software home to apply cpu 
october on it 
Use case 2: Clone a database to apply cpu october on it 
Use cases 1 and 2: Without and With LXC 
Use case 3: Clone a PDB 
Disable COW on a subvolume (Performance reason) and Snap it
Will not present 
In depth Linux containers (LXC) 
In depth btfrs FileSystem
LXC 
1. Linux Containers (LXC) allow running multiple isolated 
Linux instances (containers) on the same host. 
2. A way to isolate a group of processes from the others 
on a running Linux system. 
3. Resource management and resource isolation features 
(Cgroups and name spaces). 
4. Processes can have their own private view of the 
operating system with its own process ID (PID) space, 
file system structure and network interfaces.
LXC (http://www.oracle.com/technetwork/server-storage/ 
linux/technologies/oracle-linux-containers- 
1898044.html)
btrfs 
1. Supports large files and file systems. 
2. Offers integrated volume management. 
3. Has built-in RAID functionality. 
4. Keeps data secure using copy-on-write (COW) and 
checksumming techniques. 
5. Provides writable snapshots. 
6.COW comes with some advantages, but can negatively 
affect performance with large files that have small random 
writes. It is recommended to disable COW for database 
files and virtual machine images.
Copy on write (COW) snapshot
How does it help? 
We can clone in seconds (and using few disk 
space): 
Linux containers 
Oracle software 
Oracle databases (Non CDB, CDB and PDB) 
Only on playground environment! (btrfs not 
officially supported by oracle see 236826.1& 
1601759.1)
Let’s setup the VM, LXC and btrfs (1/7) 
Let’s create a OEL 6.5 virtual machine (named lxc) using 
virtualbox. This virtual machine will host our Linux containers, 
oracle software and databases 
Install lxc and btrfs into the virtual machine created previously
Let’s setup the VM, LXC and btrfs (2/7) 
Install a btrfs file system into the virtual machine (this file 
system will receive the oracle software and databases). To do 
so, add a disk to your virtualbox machine, start the machine 
and launch the fs creation:
Let’s setup the VM, LXC and btrfs (3/7) 
Add a btrfs file system into the virtual machine (this file system 
will receive the linux containers). To do so, add a disk to your 
virtualbox machine, start the machine and launch the fs 
creation:
Let’s setup the VM, LXC and btrfs (4/7) 
Create 2 btrfs subvolumes for the database software and 
databases:
Let’s setup the VM, LXC and btrfs (5/7) 
Add into /etc/hosts the machine (VM) name (LXC in our case):
Let’s setup the VM, LXC and btrfs (6/7) 
Install the 12cR1 database software with: 
Create a simple database with datafiles, redologs and 
controlfile located into the /btrfs/databases folder:
Let’s setup the VM, LXC and btrfs (7/7) 
Create a linux container (using oracle template) that will be the 
source of all our new containers: 
lxc-create --name cont_source -B btrfs --template oracle -- -- 
url http://public-yum.oracle.com -R 6.latest -r "perl sudo 
oracle-rdbms-server-12cR1-preinstall" 
Look at the “-B btrfs” argument to specify that the linux 
container is created on a BTRFS file system (and then would be 
able to use the snapshot capability during LXC clone creation).
Use case 1: clone db software + install CPU October 
Check FS size: btrfs filesystem df /btrfs 
Create a snapshot of the /btrfs/u01 subvolume: btrfs su 
snapshot /btrfs/u01 /btrfs/u01_patch 
Check FS size: btrfs filesystem df /btrfs 
Install CPU October 2014 
Check FS size: btrfs filesystem df /btrfs
Use case 2: clone database + install CPU October 
Check FS size: btrfs filesystem df /btrfs 
Clone the database directory: btrfs su snapshot 
/btrfs/databases /btrfs/databases_patch 
Check FS size: btrfs filesystem df /btrfs 
Apply the CPU on the cloned database BDTDB_CPU: 
Check FS size: btrfs filesystem df /btrfs
Use cases 1 and 2: with LXC (1/4) 
Clone the cont_source linux container machine: lxc-clone -s 
-t btrfs -o cont_source -n cpu_oct 
Clone the database software: btrfs su snapshot 
/btrfs/u01 /btrfs/u01_cpu_oct 
Clone the database directory: btrfs su snapshot 
/btrfs/databases /btrfs/databases_cpu_oct 
Link the cloned subvolumes to the cloned linux container FS 
(so that everything match the source environment)
Use cases 1 and 2: with LXC (2/4) 
Copy oratab, oraenv, dbhome + create mount point directory 
into the linux container: 
cp -p /usr/local/bin/coraenv /usr/local/bin/dbhome 
/usr/local/bin/oraenv 
/container/cpu_oct/rootfs/usr/local/bin 
cp -p /etc/oratab /container/cpu_oct/rootfs/etc/ 
mkdir -p /container/cpu_oct/rootfs/btrfs/u01 
mkdir -p /container/cpu_oct/rootfs/btrfs/databases 
mkdir -p 
/container/cpu_oct/rootfs/home/oracle/19121550 
Start the cloned linux container: lxc-start -n cpu_oct
Use cases 1 and 2: with LXC (3/4) 
Patch de database software:
Use cases 1 and 2: with LXC (4/4) 
Patch the database:
With / without LXC comparison 
Software cloning: 
No need to create a new oratab entry with LXC (simply copy the oratab to 
the LXC directory). 
No need to update the cloned inventory. 
Database cloning: 
No need to create a new oratab entry with LXC (simply copy the oratab to 
the LXC directory). 
No need to recreate the control file of the duplicated database with LXC. 
The config file of the cloned LXC machine just need to ensure that the cloned 
subvolumes are mounted at the right location.
Use case 3: Duplicate a PDB 
Put PDB1 in read only mode 
alter pluggable database PDB1 open read only; 
Generate the PDB1 xml file 
alter session set container=PDB1; 
exec 
dbms_pdb.describe(pdb_descr_file=>’/home/oracle/pdb1.xml'); 
Create the btrfs clone 
btrfs su snapshot /btrfs/databases/oradata/BDTPDB/PDB1 
/btrfs/databases/oradata/BDTPDB/PDB2 
Create and open the PDB2 PDB 
create pluggable database PDB2 AS CLONE using 
'/home/oracle/pdb1.xml' 
source_file_name_convert=('/btrfs/databases/oradata/BDTPDB/PD 
B1','/btrfs/databases/oradata/BDTPDB/PDB2') nocopy tempfile 
reuse; 
alter pluggable database PDB2 open;
Disable COW on a subvolume (Performance reason) and Snap it (1/2) 
Create a new subvolume 
btrfs subvolume create /btrfs/databases_cowoff 
Disable COW and chown oracle:dba 
chattr +C /btrfs/databases_cowoff 
chown oracle:dba /btrfs/databases_cowoff 
Create a new database (not cloned) 
Check new database is not COW 
lsattr /btrfs/databases_cowoff/oradata/COWOFF/datafile/*
Disable COW on a subvolume (Performance reason) and Snap it (2/2) 
Create a snap 
btrfs su snapshot /btrfs/databases_cowoff 
/btrfs/databases_cowoff_snap 
Create a cloned database 
Check cloned database is not COW 
lsattr /btrfs/databases_cowoff_snap/oradata/COWOFF/datafile/*
Questions?

Contenu connexe

Tendances

Advanced Apache Cassandra Operations with JMX
Advanced Apache Cassandra Operations with JMXAdvanced Apache Cassandra Operations with JMX
Advanced Apache Cassandra Operations with JMXzznate
 
All types of backups and restore
All types of backups and restoreAll types of backups and restore
All types of backups and restoreVasudeva Rao
 
PostgreSQL Administration for System Administrators
PostgreSQL Administration for System AdministratorsPostgreSQL Administration for System Administrators
PostgreSQL Administration for System AdministratorsCommand Prompt., Inc
 
MySQL database replication
MySQL database replicationMySQL database replication
MySQL database replicationPoguttuezhiniVP
 
Xtrabackup工具使用简介 - 20110427
Xtrabackup工具使用简介 - 20110427Xtrabackup工具使用简介 - 20110427
Xtrabackup工具使用简介 - 20110427Jinrong Ye
 
Mastering PostgreSQL Administration
Mastering PostgreSQL AdministrationMastering PostgreSQL Administration
Mastering PostgreSQL AdministrationEDB
 
DataStax: Backup and Restore in Cassandra and OpsCenter
DataStax: Backup and Restore in Cassandra and OpsCenterDataStax: Backup and Restore in Cassandra and OpsCenter
DataStax: Backup and Restore in Cassandra and OpsCenterDataStax Academy
 
Mysql database basic user guide
Mysql database basic user guideMysql database basic user guide
Mysql database basic user guidePoguttuezhiniVP
 
The Best and Worst of Cassandra-stress Tool (Christopher Batey, The Last Pick...
The Best and Worst of Cassandra-stress Tool (Christopher Batey, The Last Pick...The Best and Worst of Cassandra-stress Tool (Christopher Batey, The Last Pick...
The Best and Worst of Cassandra-stress Tool (Christopher Batey, The Last Pick...DataStax
 
Pgbr 2013 postgres on aws
Pgbr 2013   postgres on awsPgbr 2013   postgres on aws
Pgbr 2013 postgres on awsEmanuel Calvo
 
PostgreSQL Performance Tables Partitioning vs. Aggregated Data Tables
PostgreSQL Performance Tables Partitioning vs. Aggregated Data TablesPostgreSQL Performance Tables Partitioning vs. Aggregated Data Tables
PostgreSQL Performance Tables Partitioning vs. Aggregated Data TablesSperasoft
 
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)Altinity Ltd
 
(DAT402) Amazon RDS PostgreSQL:Lessons Learned & New Features
(DAT402) Amazon RDS PostgreSQL:Lessons Learned & New Features(DAT402) Amazon RDS PostgreSQL:Lessons Learned & New Features
(DAT402) Amazon RDS PostgreSQL:Lessons Learned & New FeaturesAmazon Web Services
 
Column store indexes and batch processing mode (nx power lite)
Column store indexes and batch processing mode (nx power lite)Column store indexes and batch processing mode (nx power lite)
Column store indexes and batch processing mode (nx power lite)Chris Adkin
 
PostgreSQL Performance Tuning
PostgreSQL Performance TuningPostgreSQL Performance Tuning
PostgreSQL Performance Tuningelliando dias
 
Dbvisit replicate: logical replication made easy
Dbvisit replicate: logical replication made easyDbvisit replicate: logical replication made easy
Dbvisit replicate: logical replication made easyFranck Pachot
 
Cassandra at Instagram (August 2013)
Cassandra at Instagram (August 2013)Cassandra at Instagram (August 2013)
Cassandra at Instagram (August 2013)Rick Branson
 
Postgresql Database Administration Basic - Day2
Postgresql  Database Administration Basic  - Day2Postgresql  Database Administration Basic  - Day2
Postgresql Database Administration Basic - Day2PoguttuezhiniVP
 

Tendances (20)

Advanced Apache Cassandra Operations with JMX
Advanced Apache Cassandra Operations with JMXAdvanced Apache Cassandra Operations with JMX
Advanced Apache Cassandra Operations with JMX
 
All types of backups and restore
All types of backups and restoreAll types of backups and restore
All types of backups and restore
 
PostgreSQL Administration for System Administrators
PostgreSQL Administration for System AdministratorsPostgreSQL Administration for System Administrators
PostgreSQL Administration for System Administrators
 
MySQL database replication
MySQL database replicationMySQL database replication
MySQL database replication
 
Xtrabackup工具使用简介 - 20110427
Xtrabackup工具使用简介 - 20110427Xtrabackup工具使用简介 - 20110427
Xtrabackup工具使用简介 - 20110427
 
Mastering PostgreSQL Administration
Mastering PostgreSQL AdministrationMastering PostgreSQL Administration
Mastering PostgreSQL Administration
 
DataStax: Backup and Restore in Cassandra and OpsCenter
DataStax: Backup and Restore in Cassandra and OpsCenterDataStax: Backup and Restore in Cassandra and OpsCenter
DataStax: Backup and Restore in Cassandra and OpsCenter
 
Mysql database basic user guide
Mysql database basic user guideMysql database basic user guide
Mysql database basic user guide
 
The Best and Worst of Cassandra-stress Tool (Christopher Batey, The Last Pick...
The Best and Worst of Cassandra-stress Tool (Christopher Batey, The Last Pick...The Best and Worst of Cassandra-stress Tool (Christopher Batey, The Last Pick...
The Best and Worst of Cassandra-stress Tool (Christopher Batey, The Last Pick...
 
Pgbr 2013 postgres on aws
Pgbr 2013   postgres on awsPgbr 2013   postgres on aws
Pgbr 2013 postgres on aws
 
PostgreSQL Performance Tables Partitioning vs. Aggregated Data Tables
PostgreSQL Performance Tables Partitioning vs. Aggregated Data TablesPostgreSQL Performance Tables Partitioning vs. Aggregated Data Tables
PostgreSQL Performance Tables Partitioning vs. Aggregated Data Tables
 
PostgreSQL and RAM usage
PostgreSQL and RAM usagePostgreSQL and RAM usage
PostgreSQL and RAM usage
 
Mongodb replication
Mongodb replicationMongodb replication
Mongodb replication
 
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
 
(DAT402) Amazon RDS PostgreSQL:Lessons Learned & New Features
(DAT402) Amazon RDS PostgreSQL:Lessons Learned & New Features(DAT402) Amazon RDS PostgreSQL:Lessons Learned & New Features
(DAT402) Amazon RDS PostgreSQL:Lessons Learned & New Features
 
Column store indexes and batch processing mode (nx power lite)
Column store indexes and batch processing mode (nx power lite)Column store indexes and batch processing mode (nx power lite)
Column store indexes and batch processing mode (nx power lite)
 
PostgreSQL Performance Tuning
PostgreSQL Performance TuningPostgreSQL Performance Tuning
PostgreSQL Performance Tuning
 
Dbvisit replicate: logical replication made easy
Dbvisit replicate: logical replication made easyDbvisit replicate: logical replication made easy
Dbvisit replicate: logical replication made easy
 
Cassandra at Instagram (August 2013)
Cassandra at Instagram (August 2013)Cassandra at Instagram (August 2013)
Cassandra at Instagram (August 2013)
 
Postgresql Database Administration Basic - Day2
Postgresql  Database Administration Basic  - Day2Postgresql  Database Administration Basic  - Day2
Postgresql Database Administration Basic - Day2
 

En vedette

Oracle Linux and Oracle Database - A Trusted Combination
Oracle Linux and Oracle Database - A Trusted Combination Oracle Linux and Oracle Database - A Trusted Combination
Oracle Linux and Oracle Database - A Trusted Combination Guatemala User Group
 
RAID, Replication, and You
RAID, Replication, and YouRAID, Replication, and You
RAID, Replication, and YouGreat Wide Open
 
I can\'t believe this is butter - A Tour of btrfs
I can\'t believe this is butter - A Tour of btrfsI can\'t believe this is butter - A Tour of btrfs
I can\'t believe this is butter - A Tour of btrfsAvi Miller
 
Cities social issues
Cities social issuesCities social issues
Cities social issuesdwessler
 
Btrfs by Chris Mason
Btrfs by Chris MasonBtrfs by Chris Mason
Btrfs by Chris MasonTerry Wang
 
Sheepdog- Google Webinar
Sheepdog- Google Webinar Sheepdog- Google Webinar
Sheepdog- Google Webinar Sheepdog
 
LUG-BG 2017 - Rangel Ivanov - Spread some butter - BTRFS
LUG-BG 2017 - Rangel Ivanov - Spread some butter - BTRFSLUG-BG 2017 - Rangel Ivanov - Spread some butter - BTRFS
LUG-BG 2017 - Rangel Ivanov - Spread some butter - BTRFSMarian Marinov
 
Btrfs: Design, Implementation and the Current Status
Btrfs: Design, Implementation and the Current StatusBtrfs: Design, Implementation and the Current Status
Btrfs: Design, Implementation and the Current StatusLukáš Czerner
 
Sheepdog: yet another all in-one storage for openstack
Sheepdog: yet another all in-one storage for openstackSheepdog: yet another all in-one storage for openstack
Sheepdog: yet another all in-one storage for openstackLiu Yuan
 
Introduction to BTRFS and ZFS
Introduction to BTRFS and ZFSIntroduction to BTRFS and ZFS
Introduction to BTRFS and ZFSTsung-en Hsiao
 
Case study of BtrFS: A fault tolerant File system
Case study of BtrFS: A fault tolerant File systemCase study of BtrFS: A fault tolerant File system
Case study of BtrFS: A fault tolerant File systemKumar Amit Mehta
 
B tree file system
B tree file systemB tree file system
B tree file systemDinesh Gupta
 
File System Comparison on Linux Ubuntu
File System Comparison on Linux UbuntuFile System Comparison on Linux Ubuntu
File System Comparison on Linux UbuntuJayesh Tambe
 
Btrfs current status and_future_prospects
Btrfs current status and_future_prospectsBtrfs current status and_future_prospects
Btrfs current status and_future_prospectsfj_staoru_takeuchi
 
Feature rich BTRFS is Getting Richer with Encryption
Feature rich BTRFS is Getting Richer with EncryptionFeature rich BTRFS is Getting Richer with Encryption
Feature rich BTRFS is Getting Richer with EncryptionLF Events
 
Container Storage Best Practices in 2017
Container Storage Best Practices in 2017Container Storage Best Practices in 2017
Container Storage Best Practices in 2017Keith Resar
 

En vedette (16)

Oracle Linux and Oracle Database - A Trusted Combination
Oracle Linux and Oracle Database - A Trusted Combination Oracle Linux and Oracle Database - A Trusted Combination
Oracle Linux and Oracle Database - A Trusted Combination
 
RAID, Replication, and You
RAID, Replication, and YouRAID, Replication, and You
RAID, Replication, and You
 
I can\'t believe this is butter - A Tour of btrfs
I can\'t believe this is butter - A Tour of btrfsI can\'t believe this is butter - A Tour of btrfs
I can\'t believe this is butter - A Tour of btrfs
 
Cities social issues
Cities social issuesCities social issues
Cities social issues
 
Btrfs by Chris Mason
Btrfs by Chris MasonBtrfs by Chris Mason
Btrfs by Chris Mason
 
Sheepdog- Google Webinar
Sheepdog- Google Webinar Sheepdog- Google Webinar
Sheepdog- Google Webinar
 
LUG-BG 2017 - Rangel Ivanov - Spread some butter - BTRFS
LUG-BG 2017 - Rangel Ivanov - Spread some butter - BTRFSLUG-BG 2017 - Rangel Ivanov - Spread some butter - BTRFS
LUG-BG 2017 - Rangel Ivanov - Spread some butter - BTRFS
 
Btrfs: Design, Implementation and the Current Status
Btrfs: Design, Implementation and the Current StatusBtrfs: Design, Implementation and the Current Status
Btrfs: Design, Implementation and the Current Status
 
Sheepdog: yet another all in-one storage for openstack
Sheepdog: yet another all in-one storage for openstackSheepdog: yet another all in-one storage for openstack
Sheepdog: yet another all in-one storage for openstack
 
Introduction to BTRFS and ZFS
Introduction to BTRFS and ZFSIntroduction to BTRFS and ZFS
Introduction to BTRFS and ZFS
 
Case study of BtrFS: A fault tolerant File system
Case study of BtrFS: A fault tolerant File systemCase study of BtrFS: A fault tolerant File system
Case study of BtrFS: A fault tolerant File system
 
B tree file system
B tree file systemB tree file system
B tree file system
 
File System Comparison on Linux Ubuntu
File System Comparison on Linux UbuntuFile System Comparison on Linux Ubuntu
File System Comparison on Linux Ubuntu
 
Btrfs current status and_future_prospects
Btrfs current status and_future_prospectsBtrfs current status and_future_prospects
Btrfs current status and_future_prospects
 
Feature rich BTRFS is Getting Richer with Encryption
Feature rich BTRFS is Getting Richer with EncryptionFeature rich BTRFS is Getting Richer with Encryption
Feature rich BTRFS is Getting Richer with Encryption
 
Container Storage Best Practices in 2017
Container Storage Best Practices in 2017Container Storage Best Practices in 2017
Container Storage Best Practices in 2017
 

Similaire à Reduce Resource Consumption & Clone in Seconds your Oracle Virtual Environment on your Laptop using Linux Containers and BTRFS

Container & kubernetes
Container & kubernetesContainer & kubernetes
Container & kubernetesTed Jung
 
Inside Docker for Fedora20/RHEL7
Inside Docker for Fedora20/RHEL7Inside Docker for Fedora20/RHEL7
Inside Docker for Fedora20/RHEL7Etsuji Nakai
 
CM_SME revised bc635_637PCI_V2_Linux_SDK
CM_SME revised bc635_637PCI_V2_Linux_SDKCM_SME revised bc635_637PCI_V2_Linux_SDK
CM_SME revised bc635_637PCI_V2_Linux_SDKChris Muntzer
 
New Features for Multitenant in Oracle Database 21c
New Features for Multitenant in Oracle Database 21cNew Features for Multitenant in Oracle Database 21c
New Features for Multitenant in Oracle Database 21cMarkus Flechtner
 
Linux Survival Kit for Proof of Concept & Proof of Technology
Linux Survival Kit for Proof of Concept & Proof of TechnologyLinux Survival Kit for Proof of Concept & Proof of Technology
Linux Survival Kit for Proof of Concept & Proof of TechnologyNugroho Gito
 
Asterisk (IP-PBX) CDR Log Rotation
Asterisk (IP-PBX) CDR Log RotationAsterisk (IP-PBX) CDR Log Rotation
Asterisk (IP-PBX) CDR Log RotationWilliam Lee
 
Evolution of containers to kubernetes
Evolution of containers to kubernetesEvolution of containers to kubernetes
Evolution of containers to kubernetesKrishna-Kumar
 
GlusterFS Update and OpenStack Integration
GlusterFS Update and OpenStack IntegrationGlusterFS Update and OpenStack Integration
GlusterFS Update and OpenStack IntegrationEtsuji Nakai
 
Kernel Recipes 2019 - Kernel documentation: past, present, and future
Kernel Recipes 2019 - Kernel documentation: past, present, and futureKernel Recipes 2019 - Kernel documentation: past, present, and future
Kernel Recipes 2019 - Kernel documentation: past, present, and futureAnne Nicolas
 
Docker London: Container Security
Docker London: Container SecurityDocker London: Container Security
Docker London: Container SecurityPhil Estes
 
Root file system for embedded systems
Root file system for embedded systemsRoot file system for embedded systems
Root file system for embedded systemsalok pal
 
How Secure Is Your Container? ContainerCon Berlin 2016
How Secure Is Your Container? ContainerCon Berlin 2016How Secure Is Your Container? ContainerCon Berlin 2016
How Secure Is Your Container? ContainerCon Berlin 2016Phil Estes
 

Similaire à Reduce Resource Consumption & Clone in Seconds your Oracle Virtual Environment on your Laptop using Linux Containers and BTRFS (20)

Container & kubernetes
Container & kubernetesContainer & kubernetes
Container & kubernetes
 
Inside Docker for Fedora20/RHEL7
Inside Docker for Fedora20/RHEL7Inside Docker for Fedora20/RHEL7
Inside Docker for Fedora20/RHEL7
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
CM_SME revised bc635_637PCI_V2_Linux_SDK
CM_SME revised bc635_637PCI_V2_Linux_SDKCM_SME revised bc635_637PCI_V2_Linux_SDK
CM_SME revised bc635_637PCI_V2_Linux_SDK
 
New Features for Multitenant in Oracle Database 21c
New Features for Multitenant in Oracle Database 21cNew Features for Multitenant in Oracle Database 21c
New Features for Multitenant in Oracle Database 21c
 
Linux Survival Kit for Proof of Concept & Proof of Technology
Linux Survival Kit for Proof of Concept & Proof of TechnologyLinux Survival Kit for Proof of Concept & Proof of Technology
Linux Survival Kit for Proof of Concept & Proof of Technology
 
Rac on NFS
Rac on NFSRac on NFS
Rac on NFS
 
Asterisk (IP-PBX) CDR Log Rotation
Asterisk (IP-PBX) CDR Log RotationAsterisk (IP-PBX) CDR Log Rotation
Asterisk (IP-PBX) CDR Log Rotation
 
Evolution of containers to kubernetes
Evolution of containers to kubernetesEvolution of containers to kubernetes
Evolution of containers to kubernetes
 
GlusterFS Update and OpenStack Integration
GlusterFS Update and OpenStack IntegrationGlusterFS Update and OpenStack Integration
GlusterFS Update and OpenStack Integration
 
First steps on CentOs7
First steps on CentOs7First steps on CentOs7
First steps on CentOs7
 
Bluestore
BluestoreBluestore
Bluestore
 
Bluestore
BluestoreBluestore
Bluestore
 
Kernel Recipes 2019 - Kernel documentation: past, present, and future
Kernel Recipes 2019 - Kernel documentation: past, present, and futureKernel Recipes 2019 - Kernel documentation: past, present, and future
Kernel Recipes 2019 - Kernel documentation: past, present, and future
 
Docker London: Container Security
Docker London: Container SecurityDocker London: Container Security
Docker London: Container Security
 
Root file system for embedded systems
Root file system for embedded systemsRoot file system for embedded systems
Root file system for embedded systems
 
How Secure Is Your Container? ContainerCon Berlin 2016
How Secure Is Your Container? ContainerCon Berlin 2016How Secure Is Your Container? ContainerCon Berlin 2016
How Secure Is Your Container? ContainerCon Berlin 2016
 
linux installation.pdf
linux installation.pdflinux installation.pdf
linux installation.pdf
 
9i hp relnotes
9i hp relnotes9i hp relnotes
9i hp relnotes
 
Fossetcon14
Fossetcon14Fossetcon14
Fossetcon14
 

Dernier

WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 

Dernier (20)

WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 

Reduce Resource Consumption & Clone in Seconds your Oracle Virtual Environment on your Laptop using Linux Containers and BTRFS

  • 1. Reduce resource consumption and clone in seconds your oracle virtual environment on your laptop using linux containers and btrfs Bertrand Drouvot
  • 2. About Me Oracle DBA since 1999 OCP 9i,10g,11g Rac certified Expert Exadata certified implementation specialist Blogger since 2012 @bertranddrouvot BasketBall fan
  • 3. Will present Linux containers (LXC) btfrs FileSystem Use case to minimise resource consumption on your laptop From an oracle DBA point of view Use case 1: Clone a database software home to apply cpu october on it Use case 2: Clone a database to apply cpu october on it Use cases 1 and 2: Without and With LXC Use case 3: Clone a PDB Disable COW on a subvolume (Performance reason) and Snap it
  • 4. Will not present In depth Linux containers (LXC) In depth btfrs FileSystem
  • 5. LXC 1. Linux Containers (LXC) allow running multiple isolated Linux instances (containers) on the same host. 2. A way to isolate a group of processes from the others on a running Linux system. 3. Resource management and resource isolation features (Cgroups and name spaces). 4. Processes can have their own private view of the operating system with its own process ID (PID) space, file system structure and network interfaces.
  • 7. btrfs 1. Supports large files and file systems. 2. Offers integrated volume management. 3. Has built-in RAID functionality. 4. Keeps data secure using copy-on-write (COW) and checksumming techniques. 5. Provides writable snapshots. 6.COW comes with some advantages, but can negatively affect performance with large files that have small random writes. It is recommended to disable COW for database files and virtual machine images.
  • 8. Copy on write (COW) snapshot
  • 9. How does it help? We can clone in seconds (and using few disk space): Linux containers Oracle software Oracle databases (Non CDB, CDB and PDB) Only on playground environment! (btrfs not officially supported by oracle see 236826.1& 1601759.1)
  • 10. Let’s setup the VM, LXC and btrfs (1/7) Let’s create a OEL 6.5 virtual machine (named lxc) using virtualbox. This virtual machine will host our Linux containers, oracle software and databases Install lxc and btrfs into the virtual machine created previously
  • 11. Let’s setup the VM, LXC and btrfs (2/7) Install a btrfs file system into the virtual machine (this file system will receive the oracle software and databases). To do so, add a disk to your virtualbox machine, start the machine and launch the fs creation:
  • 12. Let’s setup the VM, LXC and btrfs (3/7) Add a btrfs file system into the virtual machine (this file system will receive the linux containers). To do so, add a disk to your virtualbox machine, start the machine and launch the fs creation:
  • 13. Let’s setup the VM, LXC and btrfs (4/7) Create 2 btrfs subvolumes for the database software and databases:
  • 14. Let’s setup the VM, LXC and btrfs (5/7) Add into /etc/hosts the machine (VM) name (LXC in our case):
  • 15. Let’s setup the VM, LXC and btrfs (6/7) Install the 12cR1 database software with: Create a simple database with datafiles, redologs and controlfile located into the /btrfs/databases folder:
  • 16. Let’s setup the VM, LXC and btrfs (7/7) Create a linux container (using oracle template) that will be the source of all our new containers: lxc-create --name cont_source -B btrfs --template oracle -- -- url http://public-yum.oracle.com -R 6.latest -r "perl sudo oracle-rdbms-server-12cR1-preinstall" Look at the “-B btrfs” argument to specify that the linux container is created on a BTRFS file system (and then would be able to use the snapshot capability during LXC clone creation).
  • 17. Use case 1: clone db software + install CPU October Check FS size: btrfs filesystem df /btrfs Create a snapshot of the /btrfs/u01 subvolume: btrfs su snapshot /btrfs/u01 /btrfs/u01_patch Check FS size: btrfs filesystem df /btrfs Install CPU October 2014 Check FS size: btrfs filesystem df /btrfs
  • 18. Use case 2: clone database + install CPU October Check FS size: btrfs filesystem df /btrfs Clone the database directory: btrfs su snapshot /btrfs/databases /btrfs/databases_patch Check FS size: btrfs filesystem df /btrfs Apply the CPU on the cloned database BDTDB_CPU: Check FS size: btrfs filesystem df /btrfs
  • 19. Use cases 1 and 2: with LXC (1/4) Clone the cont_source linux container machine: lxc-clone -s -t btrfs -o cont_source -n cpu_oct Clone the database software: btrfs su snapshot /btrfs/u01 /btrfs/u01_cpu_oct Clone the database directory: btrfs su snapshot /btrfs/databases /btrfs/databases_cpu_oct Link the cloned subvolumes to the cloned linux container FS (so that everything match the source environment)
  • 20. Use cases 1 and 2: with LXC (2/4) Copy oratab, oraenv, dbhome + create mount point directory into the linux container: cp -p /usr/local/bin/coraenv /usr/local/bin/dbhome /usr/local/bin/oraenv /container/cpu_oct/rootfs/usr/local/bin cp -p /etc/oratab /container/cpu_oct/rootfs/etc/ mkdir -p /container/cpu_oct/rootfs/btrfs/u01 mkdir -p /container/cpu_oct/rootfs/btrfs/databases mkdir -p /container/cpu_oct/rootfs/home/oracle/19121550 Start the cloned linux container: lxc-start -n cpu_oct
  • 21. Use cases 1 and 2: with LXC (3/4) Patch de database software:
  • 22. Use cases 1 and 2: with LXC (4/4) Patch the database:
  • 23. With / without LXC comparison Software cloning: No need to create a new oratab entry with LXC (simply copy the oratab to the LXC directory). No need to update the cloned inventory. Database cloning: No need to create a new oratab entry with LXC (simply copy the oratab to the LXC directory). No need to recreate the control file of the duplicated database with LXC. The config file of the cloned LXC machine just need to ensure that the cloned subvolumes are mounted at the right location.
  • 24. Use case 3: Duplicate a PDB Put PDB1 in read only mode alter pluggable database PDB1 open read only; Generate the PDB1 xml file alter session set container=PDB1; exec dbms_pdb.describe(pdb_descr_file=>’/home/oracle/pdb1.xml'); Create the btrfs clone btrfs su snapshot /btrfs/databases/oradata/BDTPDB/PDB1 /btrfs/databases/oradata/BDTPDB/PDB2 Create and open the PDB2 PDB create pluggable database PDB2 AS CLONE using '/home/oracle/pdb1.xml' source_file_name_convert=('/btrfs/databases/oradata/BDTPDB/PD B1','/btrfs/databases/oradata/BDTPDB/PDB2') nocopy tempfile reuse; alter pluggable database PDB2 open;
  • 25. Disable COW on a subvolume (Performance reason) and Snap it (1/2) Create a new subvolume btrfs subvolume create /btrfs/databases_cowoff Disable COW and chown oracle:dba chattr +C /btrfs/databases_cowoff chown oracle:dba /btrfs/databases_cowoff Create a new database (not cloned) Check new database is not COW lsattr /btrfs/databases_cowoff/oradata/COWOFF/datafile/*
  • 26. Disable COW on a subvolume (Performance reason) and Snap it (2/2) Create a snap btrfs su snapshot /btrfs/databases_cowoff /btrfs/databases_cowoff_snap Create a cloned database Check cloned database is not COW lsattr /btrfs/databases_cowoff_snap/oradata/COWOFF/datafile/*