SlideShare a Scribd company logo
1 of 34
Download to read offline
Howdy, I’m Blaine CarterHowdy, I’m Blaine Carter
Oracle Corporation
Developer Advocate for Open Source
Email: blaine.carter@oracle.com
Blog: learncodeshare.net
Twi er: @OraBlaineOS
YouTube: www.youtube.com/blainecarter
Team: community.oracle.com/docs/DOC-
917690
Database Develoment EnvironmentDatabase Develoment Environment
In DockerIn Docker
Docker
Oracle Xe 18c
Node.js
Oracle REST Data Services (ORDS)
Examples
What is DockerWhat is Docker
Virtual Machine
Power
Water
Gas
Sewer
Docker
DockerDocker
<- Docker Network ->
->
learncodeshare.netlearncodeshare.net
bit.ly/LCS-Xe-ORDS
bit.ly/node-docker-db
Clone the RepoClone the Repo
OracleDatabase/SingleInstance/dockerfiles/buildDockerImage.sh
OracleRestDataServices/dockerfiles/buildDockerImage.sh
h ps://github.com/oracle/docker-images
Download the Install FilesDownload the Install Files
Oracle Xe 18c - oracle.com/xe
ORDS - oracle.com/rest
Java (Server JRE) - oracle.com/technetwork/java/javase/downloads/index.html
Move Install FilesMove Install Files
Java - docker-images/OracleJava/java-8
Oracle Xe - docker-images/OracleDatabase/SingleInstance/dockerfiles/18.4.0
ORDS - docker-images/OracleRestDataServices/dockerfiles
Docker stepsDocker steps
(Network and Database)(Network and Database)
Create the Docker Network
docker network create XeOrdsNodeNet
Build the Oracle Database Xe Docker Image
cd docker-images/OracleDatabase/SingleInstance/dockerfiles/18.4.0
docker build --force-rm=true 
--no-cache=true 
--shm-size=1G 
--build-arg DB_EDITION=xe 
-t oracle/database:18.4.0-xe 
-f Dockerfile.xe .
Create and run the container
docker run -d 
--name oracleXe 
--network=XeOrdsNodeNet 
-p 1521:1521 
-p 5500:5500 
-e ORACLE_PWD="Password1_good" 
oracle/database:18.4.0-xe
Check the container status
Check the logs
docker ps
CONTAINER ID IMAGE STATUS Names
aaa4cee2f6d9 oracle/database:18.4.0-xe Up 32 seconds (health: starting) oracleXe
STATUS
Up 5 minutes (healthy)
docker logs oracleXe
Simple Node AppSimple Node App
dbConfig.js
module.exports = {
user : process.env.NODE_ORACLEDB_USER,
password : process.env.NODE_ORACLEDB_PASSWORD,
connectString : process.env.NODE_ORACLEDB_CONNECTIONSTRING,
poolMax: 2,
poolMin: 2,
poolIncrement: 0
};
server.js
const oracledb = require('oracledb');
const config = require('./dbConfig.js');
async function runTest() {
let conn;
try {
conn = await oracledb.getConnection(config);
const result = await conn.execute(
'select id, name, minutes from cool_data_t'
);
console.log(result);
} catch (err) {
console.error(err);
} finally {
if (conn) {
try {
await conn close();
Install Dependencies
Create Environment Variables
Test
npm install oracledb -s
export NODE_ORACLEDB_USER=NotMyRealUser
export NODE_ORACLEDB_PASSWORD=NotMyRealPassword
export NODE_ORACLEDB_CONNECTIONSTRING=localhost:1521/xepdb1
node server.js
{ metaData: [ { name: 'ID' }, { name: 'NAME' }, { name: 'MINUTES' } ],
rows:
[ [ 1, 'first', 24 ],
[ 2, 'second', 23 ],
[ 3, 'third', 52 ],
[ 4, 'fourth', 235 ],
[ 5, 'fifth', 874 ] ] }
Shutting Down
Create a Dockerfile
FROM oraclelinux:7-slim
# Create app directory
WORKDIR /usr/src/app
# Copy the .js files from your host machine into the new app directory
ADD *.js ./
# Update Oracle Linux
# Install Node.js
# Install the Oracle Instant Client
# Check that Node.js and NPM installed correctly
# Install the OracleDB driver
RUN yum install -y oracle-release-el7 && 
yum install -y oracle-nodejs-release-el7 && 
yum install -y --disablerepo=ol7_developer_EPEL nodejs && 
yum install -y oracle-instantclient19.3-basic.x86_64 && 
yum clean all && 
node --version && 
npm version &&
Build the Node.js App Docker Image
docker build --force-rm=true 
--no-cache=true 
-t oracle/nodeapp:1.0.0 
-f Dockerfile .
Create and Run the Container
docker run 
--name NodeApp 
--network=XeOrdsNodeNet 
-e NODE_ORACLEDB_USER=rest_demo 
-e NODE_ORACLEDB_PASSWORD=Tester1_test 
-e NODE_ORACLEDB_CONNECTIONSTRING=oracleXe:1521/xepdb1 
-p 3000:3000 
oracle/nodeapp:1.0.0
docker start -i NodeApp
Check the container status
docker ps
CONTAINER ID IMAGE STATUS Names
aaa4cee2f6d9 oracle/database:18.4.0-xe Up 15 minutes (healthy) oracleXe
Check the container status
Check the logs
docker ps -a
CONTAINER ID IMAGE STATUS Names
2674cdde34f1 oracle/nodeapp:1.0.0 Exited (0) 30 seconds ago NodeApp
aaa4cee2f6d9 oracle/database:18.4.0-xe Up 15 minutes (healthy) oracleXe
docker logs NodeApp --timestamps
Docker stepsDocker steps
(Java and ORDS)(Java and ORDS)
Java container
cd docker-images/OracleJava/java-8
docker build -t oracle/serverjre:8 .
Build the Oracle REST Data Services Docker Image
cd docker-images/OracleRestDataServices/dockerfiles
docker build --force-rm=true 
--no-cache=true 
-t oracle/restdataservices:19.2.0 
-f Dockerfile .
Create and Run the Container
docker run -d 
--name ORDS 
--network=XeOrdsNodeNet 
-e ORACLE_HOST=oracleXe 
-e ORACLE_SERVICE=xepdb1 
-e ORACLE_PWD="Password1_good" 
-e ORDS_PWD="Tester1_test" 
-p 8080:8888 
oracle/restdataservices:19.2.0
Check the container status
Check the logs
docker ps
CONTAINER ID IMAGE STATUS Names
193204a1dcdc oracle/restdataservices:19.2.0 Up 5 seconds ORDS
aaa4cee2f6d9 oracle/database:18.4.0-xe Up 20 minutes (healthy) oracleXe
docker logs ORDS --follow --timestamps
OOracleracle RRESTEST DDataata SServiceservices
h ps://oracle.com/rest
Auto RESTAuto REST
Auto REST Table
un-REST Table
Auto REST View
Generate a PL/SQL API for the table
Auto REST PL/SQL API
Modify PL/SQL
REST enable your databaseREST enable your database
SQL DeveloperSQL Developer
SecureSecure
Create Role
Define Privilege
Privilege Mapping
OAuth 2 Client
Generate token using client credentials
Access the service
REST enable your databaseREST enable your database
SQL DeveloperSQL Developer
REST WIZARDREST WIZARD
Create a REST Service
POST (Upload) Image
View an Image
If I've done everything correctlyIf I've done everything correctly
ResourcesResources
ORDS Documentation -
Twi er
Blaine Carter - @OraBlaineOS
Jeff Smith - @thatjeffsmith
Kris Rice - @krisrice
Image Upload Tutorial -
h p://bit.ly/ORDS-Docs
h ps://www.thatjeffsmith.com/oracle-rest-data-services-ords/
h ps://LearnCodeShare.net
h p://bit.ly/ORDS-Image-Tutorial
Howdy, I’m Blaine CarterHowdy, I’m Blaine Carter
Oracle Corporation
Developer Advocate for Open Source
Email: blaine.carter@oracle.com
Blog: learncodeshare.net
Twi er: @OraBlaineOS
YouTube: www.youtube.com/blainecarter
Team: community.oracle.com/docs/DOC-
917690

More Related Content

What's hot

Pluggable Databases: What they will break and why you should use them anyway!
Pluggable Databases: What they will break and why you should use them anyway!Pluggable Databases: What they will break and why you should use them anyway!
Pluggable Databases: What they will break and why you should use them anyway!Guatemala User Group
 
Oracle Unified Directory. Lessons learnt. Is it ready for a move from OID? (O...
Oracle Unified Directory. Lessons learnt. Is it ready for a move from OID? (O...Oracle Unified Directory. Lessons learnt. Is it ready for a move from OID? (O...
Oracle Unified Directory. Lessons learnt. Is it ready for a move from OID? (O...Andrejs Prokopjevs
 
Oracle 12.2 sharded database management
Oracle 12.2 sharded database managementOracle 12.2 sharded database management
Oracle 12.2 sharded database managementLeyi (Kamus) Zhang
 
Oracle 12c Multi Tenant
Oracle 12c Multi TenantOracle 12c Multi Tenant
Oracle 12c Multi TenantRed Stack Tech
 
RESTful Web services using JAX-RS
RESTful Web services using JAX-RSRESTful Web services using JAX-RS
RESTful Web services using JAX-RSArun Gupta
 
Oracle 12cR2 RAC Database Software Installation and Create Database
Oracle 12cR2 RAC Database Software Installation and Create DatabaseOracle 12cR2 RAC Database Software Installation and Create Database
Oracle 12cR2 RAC Database Software Installation and Create DatabaseMonowar Mukul
 
Oracle 12c Multitenant architecture
Oracle 12c Multitenant architectureOracle 12c Multitenant architecture
Oracle 12c Multitenant architecturenaderattia
 
RESTful Web Services with Jersey
RESTful Web Services with JerseyRESTful Web Services with Jersey
RESTful Web Services with JerseyScott Leberknight
 
Clogeny Hadoop ecosystem - an overview
Clogeny Hadoop ecosystem - an overviewClogeny Hadoop ecosystem - an overview
Clogeny Hadoop ecosystem - an overviewMadhur Nawandar
 
Exploring Oracle Database 12c Multitenant best practices for your Cloud
Exploring Oracle Database 12c Multitenant best practices for your CloudExploring Oracle Database 12c Multitenant best practices for your Cloud
Exploring Oracle Database 12c Multitenant best practices for your Clouddyahalom
 
Oracle 12c PDB insights
Oracle 12c PDB insightsOracle 12c PDB insights
Oracle 12c PDB insightsKirill Loifman
 
Oracle 21c: New Features and Enhancements of Data Pump & TTS
Oracle 21c: New Features and Enhancements of Data Pump & TTSOracle 21c: New Features and Enhancements of Data Pump & TTS
Oracle 21c: New Features and Enhancements of Data Pump & TTSChristian Gohmann
 
Database 12c is ready for you... Are you ready for 12c?
Database 12c is ready for you... Are you ready for 12c?Database 12c is ready for you... Are you ready for 12c?
Database 12c is ready for you... Are you ready for 12c?Performance Tuning Corporation
 
Oracle database - Get external data via HTTP, FTP and Web Services
Oracle database - Get external data via HTTP, FTP and Web ServicesOracle database - Get external data via HTTP, FTP and Web Services
Oracle database - Get external data via HTTP, FTP and Web ServicesKim Berg Hansen
 

What's hot (20)

Best Features of Multitenant 12c
Best Features of Multitenant 12cBest Features of Multitenant 12c
Best Features of Multitenant 12c
 
Pluggable Databases: What they will break and why you should use them anyway!
Pluggable Databases: What they will break and why you should use them anyway!Pluggable Databases: What they will break and why you should use them anyway!
Pluggable Databases: What they will break and why you should use them anyway!
 
Oracle Unified Directory. Lessons learnt. Is it ready for a move from OID? (O...
Oracle Unified Directory. Lessons learnt. Is it ready for a move from OID? (O...Oracle Unified Directory. Lessons learnt. Is it ready for a move from OID? (O...
Oracle Unified Directory. Lessons learnt. Is it ready for a move from OID? (O...
 
Oracle 12.2 sharded database management
Oracle 12.2 sharded database managementOracle 12.2 sharded database management
Oracle 12.2 sharded database management
 
Oracle 12c Multi Tenant
Oracle 12c Multi TenantOracle 12c Multi Tenant
Oracle 12c Multi Tenant
 
RESTful Web services using JAX-RS
RESTful Web services using JAX-RSRESTful Web services using JAX-RS
RESTful Web services using JAX-RS
 
Oracle 12cR2 RAC Database Software Installation and Create Database
Oracle 12cR2 RAC Database Software Installation and Create DatabaseOracle 12cR2 RAC Database Software Installation and Create Database
Oracle 12cR2 RAC Database Software Installation and Create Database
 
Oracle 12c Multitenant architecture
Oracle 12c Multitenant architectureOracle 12c Multitenant architecture
Oracle 12c Multitenant architecture
 
RESTful Web Services with Jersey
RESTful Web Services with JerseyRESTful Web Services with Jersey
RESTful Web Services with Jersey
 
OrientDB
OrientDBOrientDB
OrientDB
 
Clogeny Hadoop ecosystem - an overview
Clogeny Hadoop ecosystem - an overviewClogeny Hadoop ecosystem - an overview
Clogeny Hadoop ecosystem - an overview
 
Presentation day5 oracle12c
Presentation day5 oracle12cPresentation day5 oracle12c
Presentation day5 oracle12c
 
Presentation day4 oracle12c
Presentation day4 oracle12cPresentation day4 oracle12c
Presentation day4 oracle12c
 
Exploring Oracle Database 12c Multitenant best practices for your Cloud
Exploring Oracle Database 12c Multitenant best practices for your CloudExploring Oracle Database 12c Multitenant best practices for your Cloud
Exploring Oracle Database 12c Multitenant best practices for your Cloud
 
Oracle 12c PDB insights
Oracle 12c PDB insightsOracle 12c PDB insights
Oracle 12c PDB insights
 
Presentation day1oracle 12c
Presentation day1oracle 12cPresentation day1oracle 12c
Presentation day1oracle 12c
 
Oracle 21c: New Features and Enhancements of Data Pump & TTS
Oracle 21c: New Features and Enhancements of Data Pump & TTSOracle 21c: New Features and Enhancements of Data Pump & TTS
Oracle 21c: New Features and Enhancements of Data Pump & TTS
 
Hadoop HDFS
Hadoop HDFS Hadoop HDFS
Hadoop HDFS
 
Database 12c is ready for you... Are you ready for 12c?
Database 12c is ready for you... Are you ready for 12c?Database 12c is ready for you... Are you ready for 12c?
Database 12c is ready for you... Are you ready for 12c?
 
Oracle database - Get external data via HTTP, FTP and Web Services
Oracle database - Get external data via HTTP, FTP and Web ServicesOracle database - Get external data via HTTP, FTP and Web Services
Oracle database - Get external data via HTTP, FTP and Web Services
 

Similar to Create a Database Application Development Environment with Docker

Real World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and ProductionReal World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and ProductionBen Hall
 
Docker for Web Developers: A Sneak Peek
Docker for Web Developers: A Sneak PeekDocker for Web Developers: A Sneak Peek
Docker for Web Developers: A Sneak Peekmsyukor
 
Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)Ben Hall
 
Practical guide to Oracle Virtual environments
Practical guide to Oracle Virtual environmentsPractical guide to Oracle Virtual environments
Practical guide to Oracle Virtual environmentsNelson Calero
 
Docker Security workshop slides
Docker Security workshop slidesDocker Security workshop slides
Docker Security workshop slidesDocker, Inc.
 
DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline  DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline Docker, Inc.
 
Docker 進階實務班
Docker 進階實務班Docker 進階實務班
Docker 進階實務班Philip Zheng
 
廣宣學堂: 容器進階實務 - Docker進深研究班
廣宣學堂: 容器進階實務 - Docker進深研究班廣宣學堂: 容器進階實務 - Docker進深研究班
廣宣學堂: 容器進階實務 - Docker進深研究班Paul Chao
 
Deploying Windows Containers on Windows Server 2016
Deploying Windows Containers on Windows Server 2016Deploying Windows Containers on Windows Server 2016
Deploying Windows Containers on Windows Server 2016Ben Hall
 
Docker Introductory workshop
Docker Introductory workshopDocker Introductory workshop
Docker Introductory workshopRuncy Oommen
 
Running .NET on Docker
Running .NET on DockerRunning .NET on Docker
Running .NET on DockerBen Hall
 
The age of orchestration: from Docker basics to cluster management
The age of orchestration: from Docker basics to cluster managementThe age of orchestration: from Docker basics to cluster management
The age of orchestration: from Docker basics to cluster managementNicola Paolucci
 
Introduction to Docker & CoreOS - Symfony User Group Cologne
Introduction to Docker & CoreOS - Symfony User Group CologneIntroduction to Docker & CoreOS - Symfony User Group Cologne
Introduction to Docker & CoreOS - Symfony User Group CologneD
 
Troubleshooting Tips from a Docker Support Engineer
Troubleshooting Tips from a Docker Support EngineerTroubleshooting Tips from a Docker Support Engineer
Troubleshooting Tips from a Docker Support EngineerJeff Anderson
 
Troubleshooting Tips from a Docker Support Engineer - Jeff Anderson, Docker
Troubleshooting Tips from a Docker Support Engineer - Jeff Anderson, DockerTroubleshooting Tips from a Docker Support Engineer - Jeff Anderson, Docker
Troubleshooting Tips from a Docker Support Engineer - Jeff Anderson, DockerDocker, Inc.
 
Docker 1.11 Presentation
Docker 1.11 PresentationDocker 1.11 Presentation
Docker 1.11 PresentationSreenivas Makam
 
桃園市教育局Docker技術入門與實作
桃園市教育局Docker技術入門與實作桃園市教育局Docker技術入門與實作
桃園市教育局Docker技術入門與實作Philip Zheng
 
Architecting .NET Applications for Docker and Container Based Deployments
Architecting .NET Applications for Docker and Container Based DeploymentsArchitecting .NET Applications for Docker and Container Based Deployments
Architecting .NET Applications for Docker and Container Based DeploymentsBen Hall
 
Weblogic 12c on docker
Weblogic 12c on dockerWeblogic 12c on docker
Weblogic 12c on dockerCK Rai
 

Similar to Create a Database Application Development Environment with Docker (20)

Real World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and ProductionReal World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and Production
 
Docker for Web Developers: A Sneak Peek
Docker for Web Developers: A Sneak PeekDocker for Web Developers: A Sneak Peek
Docker for Web Developers: A Sneak Peek
 
Geode on Docker
Geode on DockerGeode on Docker
Geode on Docker
 
Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)
 
Practical guide to Oracle Virtual environments
Practical guide to Oracle Virtual environmentsPractical guide to Oracle Virtual environments
Practical guide to Oracle Virtual environments
 
Docker Security workshop slides
Docker Security workshop slidesDocker Security workshop slides
Docker Security workshop slides
 
DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline  DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline
 
Docker 進階實務班
Docker 進階實務班Docker 進階實務班
Docker 進階實務班
 
廣宣學堂: 容器進階實務 - Docker進深研究班
廣宣學堂: 容器進階實務 - Docker進深研究班廣宣學堂: 容器進階實務 - Docker進深研究班
廣宣學堂: 容器進階實務 - Docker進深研究班
 
Deploying Windows Containers on Windows Server 2016
Deploying Windows Containers on Windows Server 2016Deploying Windows Containers on Windows Server 2016
Deploying Windows Containers on Windows Server 2016
 
Docker Introductory workshop
Docker Introductory workshopDocker Introductory workshop
Docker Introductory workshop
 
Running .NET on Docker
Running .NET on DockerRunning .NET on Docker
Running .NET on Docker
 
The age of orchestration: from Docker basics to cluster management
The age of orchestration: from Docker basics to cluster managementThe age of orchestration: from Docker basics to cluster management
The age of orchestration: from Docker basics to cluster management
 
Introduction to Docker & CoreOS - Symfony User Group Cologne
Introduction to Docker & CoreOS - Symfony User Group CologneIntroduction to Docker & CoreOS - Symfony User Group Cologne
Introduction to Docker & CoreOS - Symfony User Group Cologne
 
Troubleshooting Tips from a Docker Support Engineer
Troubleshooting Tips from a Docker Support EngineerTroubleshooting Tips from a Docker Support Engineer
Troubleshooting Tips from a Docker Support Engineer
 
Troubleshooting Tips from a Docker Support Engineer - Jeff Anderson, Docker
Troubleshooting Tips from a Docker Support Engineer - Jeff Anderson, DockerTroubleshooting Tips from a Docker Support Engineer - Jeff Anderson, Docker
Troubleshooting Tips from a Docker Support Engineer - Jeff Anderson, Docker
 
Docker 1.11 Presentation
Docker 1.11 PresentationDocker 1.11 Presentation
Docker 1.11 Presentation
 
桃園市教育局Docker技術入門與實作
桃園市教育局Docker技術入門與實作桃園市教育局Docker技術入門與實作
桃園市教育局Docker技術入門與實作
 
Architecting .NET Applications for Docker and Container Based Deployments
Architecting .NET Applications for Docker and Container Based DeploymentsArchitecting .NET Applications for Docker and Container Based Deployments
Architecting .NET Applications for Docker and Container Based Deployments
 
Weblogic 12c on docker
Weblogic 12c on dockerWeblogic 12c on docker
Weblogic 12c on docker
 

Recently uploaded

Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 

Recently uploaded (20)

Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 

Create a Database Application Development Environment with Docker

  • 1.
  • 2. Howdy, I’m Blaine CarterHowdy, I’m Blaine Carter Oracle Corporation Developer Advocate for Open Source Email: blaine.carter@oracle.com Blog: learncodeshare.net Twi er: @OraBlaineOS YouTube: www.youtube.com/blainecarter Team: community.oracle.com/docs/DOC- 917690
  • 3. Database Develoment EnvironmentDatabase Develoment Environment In DockerIn Docker Docker Oracle Xe 18c Node.js Oracle REST Data Services (ORDS) Examples
  • 4. What is DockerWhat is Docker Virtual Machine Power Water Gas Sewer Docker
  • 7. Clone the RepoClone the Repo OracleDatabase/SingleInstance/dockerfiles/buildDockerImage.sh OracleRestDataServices/dockerfiles/buildDockerImage.sh h ps://github.com/oracle/docker-images
  • 8. Download the Install FilesDownload the Install Files Oracle Xe 18c - oracle.com/xe ORDS - oracle.com/rest Java (Server JRE) - oracle.com/technetwork/java/javase/downloads/index.html
  • 9. Move Install FilesMove Install Files Java - docker-images/OracleJava/java-8 Oracle Xe - docker-images/OracleDatabase/SingleInstance/dockerfiles/18.4.0 ORDS - docker-images/OracleRestDataServices/dockerfiles
  • 10. Docker stepsDocker steps (Network and Database)(Network and Database) Create the Docker Network docker network create XeOrdsNodeNet
  • 11.
  • 12. Build the Oracle Database Xe Docker Image cd docker-images/OracleDatabase/SingleInstance/dockerfiles/18.4.0 docker build --force-rm=true --no-cache=true --shm-size=1G --build-arg DB_EDITION=xe -t oracle/database:18.4.0-xe -f Dockerfile.xe .
  • 13. Create and run the container docker run -d --name oracleXe --network=XeOrdsNodeNet -p 1521:1521 -p 5500:5500 -e ORACLE_PWD="Password1_good" oracle/database:18.4.0-xe
  • 14. Check the container status Check the logs docker ps CONTAINER ID IMAGE STATUS Names aaa4cee2f6d9 oracle/database:18.4.0-xe Up 32 seconds (health: starting) oracleXe STATUS Up 5 minutes (healthy) docker logs oracleXe
  • 15. Simple Node AppSimple Node App dbConfig.js module.exports = { user : process.env.NODE_ORACLEDB_USER, password : process.env.NODE_ORACLEDB_PASSWORD, connectString : process.env.NODE_ORACLEDB_CONNECTIONSTRING, poolMax: 2, poolMin: 2, poolIncrement: 0 };
  • 16. server.js const oracledb = require('oracledb'); const config = require('./dbConfig.js'); async function runTest() { let conn; try { conn = await oracledb.getConnection(config); const result = await conn.execute( 'select id, name, minutes from cool_data_t' ); console.log(result); } catch (err) { console.error(err); } finally { if (conn) { try { await conn close();
  • 17. Install Dependencies Create Environment Variables Test npm install oracledb -s export NODE_ORACLEDB_USER=NotMyRealUser export NODE_ORACLEDB_PASSWORD=NotMyRealPassword export NODE_ORACLEDB_CONNECTIONSTRING=localhost:1521/xepdb1 node server.js { metaData: [ { name: 'ID' }, { name: 'NAME' }, { name: 'MINUTES' } ], rows: [ [ 1, 'first', 24 ], [ 2, 'second', 23 ], [ 3, 'third', 52 ], [ 4, 'fourth', 235 ], [ 5, 'fifth', 874 ] ] } Shutting Down
  • 18. Create a Dockerfile FROM oraclelinux:7-slim # Create app directory WORKDIR /usr/src/app # Copy the .js files from your host machine into the new app directory ADD *.js ./ # Update Oracle Linux # Install Node.js # Install the Oracle Instant Client # Check that Node.js and NPM installed correctly # Install the OracleDB driver RUN yum install -y oracle-release-el7 && yum install -y oracle-nodejs-release-el7 && yum install -y --disablerepo=ol7_developer_EPEL nodejs && yum install -y oracle-instantclient19.3-basic.x86_64 && yum clean all && node --version && npm version &&
  • 19. Build the Node.js App Docker Image docker build --force-rm=true --no-cache=true -t oracle/nodeapp:1.0.0 -f Dockerfile .
  • 20. Create and Run the Container docker run --name NodeApp --network=XeOrdsNodeNet -e NODE_ORACLEDB_USER=rest_demo -e NODE_ORACLEDB_PASSWORD=Tester1_test -e NODE_ORACLEDB_CONNECTIONSTRING=oracleXe:1521/xepdb1 -p 3000:3000 oracle/nodeapp:1.0.0 docker start -i NodeApp
  • 21. Check the container status docker ps CONTAINER ID IMAGE STATUS Names aaa4cee2f6d9 oracle/database:18.4.0-xe Up 15 minutes (healthy) oracleXe
  • 22. Check the container status Check the logs docker ps -a CONTAINER ID IMAGE STATUS Names 2674cdde34f1 oracle/nodeapp:1.0.0 Exited (0) 30 seconds ago NodeApp aaa4cee2f6d9 oracle/database:18.4.0-xe Up 15 minutes (healthy) oracleXe docker logs NodeApp --timestamps
  • 23. Docker stepsDocker steps (Java and ORDS)(Java and ORDS) Java container cd docker-images/OracleJava/java-8 docker build -t oracle/serverjre:8 .
  • 24.
  • 25. Build the Oracle REST Data Services Docker Image cd docker-images/OracleRestDataServices/dockerfiles docker build --force-rm=true --no-cache=true -t oracle/restdataservices:19.2.0 -f Dockerfile .
  • 26. Create and Run the Container docker run -d --name ORDS --network=XeOrdsNodeNet -e ORACLE_HOST=oracleXe -e ORACLE_SERVICE=xepdb1 -e ORACLE_PWD="Password1_good" -e ORDS_PWD="Tester1_test" -p 8080:8888 oracle/restdataservices:19.2.0
  • 27. Check the container status Check the logs docker ps CONTAINER ID IMAGE STATUS Names 193204a1dcdc oracle/restdataservices:19.2.0 Up 5 seconds ORDS aaa4cee2f6d9 oracle/database:18.4.0-xe Up 20 minutes (healthy) oracleXe docker logs ORDS --follow --timestamps
  • 28. OOracleracle RRESTEST DDataata SServiceservices h ps://oracle.com/rest
  • 29. Auto RESTAuto REST Auto REST Table un-REST Table Auto REST View Generate a PL/SQL API for the table Auto REST PL/SQL API Modify PL/SQL
  • 30. REST enable your databaseREST enable your database SQL DeveloperSQL Developer SecureSecure Create Role Define Privilege Privilege Mapping OAuth 2 Client Generate token using client credentials Access the service
  • 31. REST enable your databaseREST enable your database SQL DeveloperSQL Developer REST WIZARDREST WIZARD Create a REST Service POST (Upload) Image View an Image
  • 32. If I've done everything correctlyIf I've done everything correctly
  • 33. ResourcesResources ORDS Documentation - Twi er Blaine Carter - @OraBlaineOS Jeff Smith - @thatjeffsmith Kris Rice - @krisrice Image Upload Tutorial - h p://bit.ly/ORDS-Docs h ps://www.thatjeffsmith.com/oracle-rest-data-services-ords/ h ps://LearnCodeShare.net h p://bit.ly/ORDS-Image-Tutorial
  • 34. Howdy, I’m Blaine CarterHowdy, I’m Blaine Carter Oracle Corporation Developer Advocate for Open Source Email: blaine.carter@oracle.com Blog: learncodeshare.net Twi er: @OraBlaineOS YouTube: www.youtube.com/blainecarter Team: community.oracle.com/docs/DOC- 917690