SlideShare a Scribd company logo
1 of 29
APEX and EBR
© SYNTEGRIS INFORMATION SOLUTIONS GMBH
Zero Downtime (Apex) Application Upgrades
APEX and EBR
Author
Sven Weller
www.syntegris.de
EDITION BASED REDEFINITION
Edition based redefinition
unique feature of the Oracle DB since 11.2
no additional license costs
available in EE, SE1, SE2, XE
store and run different versions of PLSQL based objects AT THE SAME TIME
© SYNTEGRIS INFORMATION SOLUTIONS GMBH
EBR Basics
editionable objects non editionable objects
Packages, Functions, Procedures Tables, Columns, Data
Trigger Sequences
Types, Type Bodies Indexes
Views, Editioning Views Materialized Views
Libraries Database Links
Synonyms Public Synonyms
Virtual Columns Function Based Indexes
USAGE
child can “inherit” objects from the parent edition
“inherit” will break, the first time the child compiles an
object
a database session is attached to a specific edition
users work in one session/edition
a new application release is deployed in a second
edition
after some grace period (testing time), default edition is
switched
next time user logs in, he/she works in the new edition
EBR Basics
ORA$
BASE
ED1
ED2
© SYNTEGRIS INFORMATION SOLUTIONS GMBH
EDITION SETUP
make schema editionable
create editions
switch editions
code something
Demo 1
DBA_setup_editions.sql
© SYNTEGRIS INFORMATION SOLUTIONS GMBH
Edition as a Service
CONNECT TO EDITION
DB services are different
names for a database
Can set the edition!
Used in the connection string
© SYNTEGRIS INFORMATION SOLUTIONS GMBH
Demo 2
DB SERVICES
create DB services
setup sql developer
check listener
persist services
DBA_setup_editions.sql
© SYNTEGRIS INFORMATION SOLUTIONS GMBH
TIPPS AND TRAPS
Do not enable editions for other schemas likeAPEX_LISTENER
just grant USE ON EDITION
Test Services after Database Restart
Good database design helps to minimize table changes later
Avoid to delete columns
© SYNTEGRIS INFORMATION SOLUTIONS GMBH
EBR Database Setup
BRIDGING THE GAP
setup different
connection pools
map url to pool
rewrite url based
upon edition
EBR and APEX
Databas
e
Editions
ORA$
BAS
E
DEV$
BETA
DEV$
ALPHA
ORDS
Apex App 120 App 110 App 100
Workspace
REST rewrites
© SYNTEGRIS INFORMATION SOLUTIONS GMBH
EBR and APEX
APEXAPPLICATION
Edition = application release
but only on data base level
Apex applications are mostly data inside the apex
repository
Duplicating Apex Code = Copying theApplication
© SYNTEGRIS INFORMATION SOLUTIONS GMBH
APEX TODOS
make application “edition aware”
show current edition
copy application
apex db connection setup
setup ords database pools for each edition
map url to db pool
resource template to combine url with application
© SYNTEGRIS INFORMATION SOLUTIONS GMBH
EBR and APEX
SHOW CURRENT EDITION
create application itemA_CURRENT_EDITION
set it with an application process
show the item, either in page template or in navigation
bar
“edition aware” app
© SYNTEGRIS INFORMATION SOLUTIONS GMBH
COPY APEXAPPLICATION
App ID 100 = BASE
App ID 110 = BETA
App ID 120 =ALPHA
change pages
“edition aware” app
© SYNTEGRIS INFORMATION SOLUTIONS GMBH
XMLFILES
defaults.xml
setup —databases
add service name
copy&paste
© SYNTEGRIS INFORMATION SOLUTIONS GMBH
configure ORDS pools
configuration file purpose
defaults.xml common settings, defaults for all
connection pools
conf/apex.xml APEX_PUBLIC_USER
configuration for APEX
conf/apex_al.xml APEX_LISTENER
read repository/rest configuration
conf/apex_rt.xml APEX_REST_PUBLIC_USER
apex REST services
conf/apex_pu.xml ORDS_PUBLIC_USER
Plsql and SQL developer REST services
role-mapping.xml map web server roles to RESTful roles
url-mapping.xml maps url to connection pools
configure ORDS connection pools
COMMANDS
java -jar ords.war setup --database apexalpha
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<comment>Saved on Fri Jan 22 17:12:18 EST2016</comment>
<entrykey="db.password">@05F6F3ABB32550C3BD33C3358A775868E1</entry>
<entrykey="db.username">APEX_PUBLIC_USER</entry>
<entrykey="db.servicename">DEV_ALPHA</entry>
<entrykey="debug.debugger">true</entry>
<entry key="debug.printDebugToScreen">true</entry>
<entrykey="jdbc.InitialLimit">2</entry>
</properties>
© SYNTEGRIS INFORMATION SOLUTIONS GMBH
map URL to database pool
<?xml version="1.0" encoding="UTF-8"?>
<pool-config xmlns="http://xmlns.oracle.com/apex/pool-config">
<pool name="apexalpha" base-path="alpha" updated="2016-04-22T06:17:08.423Z"/>
<pool name="apexbeta" base-path="beta" updated="2016-04-22T06:17:08.423Z"/>
<pool name="apexbase" base-path="base" updated="2016-04-22T06:17:08.423Z"/>
</pool-config>
COMMANDS
java -jar ords.war map-url —type base-path alpha apexalpha
© SYNTEGRIS INFORMATION SOLUTIONS GMBH
ENABLE REST IN WORKSPACE
set workspace preferences
choose path prefix
Ressource Templates
© SYNTEGRIS INFORMATION SOLUTIONS GMBH
CREATE RESTFUL SERVICE
SQL Workshop / RESTful services
create service module
GET plsql handler
no secure access
out parameter binding
url as location
html redirect code 301
Test
check network
Ressource Templates
© SYNTEGRIS INFORMATION SOLUTIONS GMBH
CREATE RESTFUL SERVICE
create service module
no URI prefix = general handler
Ressource Templates
© SYNTEGRIS INFORMATION SOLUTIONS GMBH
CREATE RESTFUL SERVICE
create URI Template
sample/
Ressource Templates
© SYNTEGRIS INFORMATION SOLUTIONS GMBH
CREATE RESTFUL SERVICE
create URI Template
ressource handler
GET
PLSQL
no secure access
Ressource Templates
© SYNTEGRIS INFORMATION SOLUTIONS GMBH
CREATE RESTFUL SERVICE
create URI Template
ressource handler
set plsql source
create OUT parameter
LOCATION
X-APEX-STATUS-CODE
Ressource Templates
declare
urlvarchar2(4000);
dbeditionvarchar2(100);
begin
-- check context based upon current connection
dbedition := sys_context('userenv','current_edition_name');
if dbedition = 'ORA$BASE' then
url :='../f?p=100';
elsif dbedition = 'DEV$BETA' then
url := '../f?p=110';
elsif dbedition = 'DEV$ALPHA' then
url :='../../f?p=120';
else -- use defaultapplication
url := '../f?p=110';
endif;
© SYNTEGRIS INFORMATION SOLUTIONS GMBH
:URL :=url;
:STATUS := 301; --redirect
end;
CREATE RESTFUL SERVICE
TEST
Ressource Templates
© SYNTEGRIS INFORMATION SOLUTIONS GMBH
TRY THEAPPLICATION
Final Result
© SYNTEGRIS INFORMATION SOLUTIONS GMBH
Architecture
use EBR
to save a test database
© SYNTEGRIS INFORMATION SOLUTIONS GMBH
EDITION ARCHITECTURE
DB and SVN setup
DEV TST PRD
DEV$ALPHA
ORA$BASE
PRD$TMP1
PRD$RELEASE1
PRD$RELEASE2
ORA$BASE
Editions
nightly
automated
SVN backup
nightly
BETAbuilds
PRD$TMP2
PRD$TMP3
Integrations and
Deployment Test
Subversion
repository for artefacts
manual release build
release creation
and acceptance test
reviews and
automated unit
testing
© SYNTEGRIS INFORMATION SOLUTIONS GMBH
development
on demand
deployment
DEV$BETA
RECOMMENDATIONS
Negative downtime is better than zero downtime!
Install and run different application version in parallel
Use it during development and save up on test databases
choose url pathname different from schema name
© SYNTEGRIS INFORMATION SOLUTIONS GMBH
Fazit
LINKS
Oracle Documentation
https://docs.oracle.com/database/121/ADFNS/adfns_editions.htm#ADFNS020
Bryn Llewellyn
http://www.oracle.com/technetwork/database/features/availability/edition-based-
redefinition-1-133045.pdf
Tom Kyte: “A closer look at the New Edition”
http://www.oracle.com/technetwork/issue-archive/2010/10-jan/o10asktom-172777.html
Chris Saxon
https://www.doag.org/formes/pubfiles/7321069/docs/Konferenz/2015/vortraege/Development/
2015-K-DEV-Chris_Saxon-Edition_Based_Redefinition_for_Zero_Downtime_PL_SQL_Changes-
Manuskript.pdf
Lucas Jellema
http://www.slideshare.net/lucasjellema/edition-based-redefinition-continuous-database-
application-evolution-with-oracle-database-11g-release-2
Kris Rice
http://krisrice.blogspot.de/2013/07/nicer-urls-for-apex-yet-another-option.html
http://de.slideshare.net/KrisRice/oracle-rest-data-services-best-practices-overview
Sven Weller: “Working with Editions”
https://svenweller.wordpress.com/2015/03/25/working-with-editions-part-1/
https://svenweller.wordpress.com/2015/06/16/working-with-editions-part-2/
Soon to come: The Edition based “not only” Redefinition Manifesto
© SYNTEGRIS INFORMATION SOLUTIONS GMBH
Want to know more?
Danke
SYNTEGRIS INFORMATION SOLUTIONS GMBH
HERMANNSTRASSE 54-56
63263NEU-ISENBURG
FON (06102) 29 86 68
FAX (06102) 55 88 06
INFO@SYNTEGRIS.DE
SYNTEGRIS.DE

More Related Content

What's hot

Velmurugan_AnnamalaiSrademantrasdb
Velmurugan_AnnamalaiSrademantrasdbVelmurugan_AnnamalaiSrademantrasdb
Velmurugan_AnnamalaiSrademantrasdb
Annamalai Velmurugan
 
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with PowershellBrian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
SharePoint Saturday NY
 
AUSPC 2013 - Understanding the Five Layers of SharePoint Security
AUSPC 2013 - Understanding the Five Layers of SharePoint SecurityAUSPC 2013 - Understanding the Five Layers of SharePoint Security
AUSPC 2013 - Understanding the Five Layers of SharePoint Security
Michael Noel
 
Toms introtospring mvc
Toms introtospring mvcToms introtospring mvc
Toms introtospring mvc
Guo Albert
 
Jasper Soft%20 Ap Is
Jasper Soft%20 Ap IsJasper Soft%20 Ap Is
Jasper Soft%20 Ap Is
naveenkumarhp
 

What's hot (19)

2011 august-gdd-mexico-city-rest-json-oauth
2011 august-gdd-mexico-city-rest-json-oauth2011 august-gdd-mexico-city-rest-json-oauth
2011 august-gdd-mexico-city-rest-json-oauth
 
RESTful Services for your Oracle Autonomous Database
RESTful Services for your Oracle Autonomous DatabaseRESTful Services for your Oracle Autonomous Database
RESTful Services for your Oracle Autonomous Database
 
Azure Websites
Azure WebsitesAzure Websites
Azure Websites
 
Velmurugan_AnnamalaiSrademantrasdb
Velmurugan_AnnamalaiSrademantrasdbVelmurugan_AnnamalaiSrademantrasdb
Velmurugan_AnnamalaiSrademantrasdb
 
JSON and the Oracle Database
JSON and the Oracle DatabaseJSON and the Oracle Database
JSON and the Oracle Database
 
Online patching ebs122_aioug_appsdba_nov2017
Online patching ebs122_aioug_appsdba_nov2017Online patching ebs122_aioug_appsdba_nov2017
Online patching ebs122_aioug_appsdba_nov2017
 
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with PowershellBrian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
 
AUSPC 2013 - Understanding the Five Layers of SharePoint Security
AUSPC 2013 - Understanding the Five Layers of SharePoint SecurityAUSPC 2013 - Understanding the Five Layers of SharePoint Security
AUSPC 2013 - Understanding the Five Layers of SharePoint Security
 
Developing with oracle enterprise scheduler service for fusion applications
Developing with oracle enterprise scheduler service for fusion applicationsDeveloping with oracle enterprise scheduler service for fusion applications
Developing with oracle enterprise scheduler service for fusion applications
 
Oracle Enterprise Manager 12c - OEM12c Presentation
Oracle Enterprise Manager 12c - OEM12c PresentationOracle Enterprise Manager 12c - OEM12c Presentation
Oracle Enterprise Manager 12c - OEM12c Presentation
 
Salesforce ANT migration
Salesforce ANT migration Salesforce ANT migration
Salesforce ANT migration
 
Toms introtospring mvc
Toms introtospring mvcToms introtospring mvc
Toms introtospring mvc
 
Jasper Soft%20 Ap Is
Jasper Soft%20 Ap IsJasper Soft%20 Ap Is
Jasper Soft%20 Ap Is
 
How To Avoid Database Migration Hell
How To Avoid Database Migration HellHow To Avoid Database Migration Hell
How To Avoid Database Migration Hell
 
Become a RESTful Iron Man with ARC (the Application, Not the Reactor)
Become a RESTful Iron Man with ARC (the Application, Not the Reactor)Become a RESTful Iron Man with ARC (the Application, Not the Reactor)
Become a RESTful Iron Man with ARC (the Application, Not the Reactor)
 
LAJUG Napster REST API
LAJUG Napster REST APILAJUG Napster REST API
LAJUG Napster REST API
 
AWR and ASH Advanced Usage with DB12c
AWR and ASH Advanced Usage with DB12cAWR and ASH Advanced Usage with DB12c
AWR and ASH Advanced Usage with DB12c
 
The Top 10 Things Oracle UCM Users Need To Know About WebLogic
The Top 10 Things Oracle UCM Users Need To Know About WebLogicThe Top 10 Things Oracle UCM Users Need To Know About WebLogic
The Top 10 Things Oracle UCM Users Need To Know About WebLogic
 
A RESTful Interface for Erlang Code using Webmachine
A RESTful Interface for Erlang Code using WebmachineA RESTful Interface for Erlang Code using Webmachine
A RESTful Interface for Erlang Code using Webmachine
 

Similar to Apex und EBR

OpenERP Technical Memento V0.7.3
OpenERP Technical Memento V0.7.3OpenERP Technical Memento V0.7.3
OpenERP Technical Memento V0.7.3
Borni DHIFI
 
Open Source RAD with OpenERP 7.0
Open Source RAD with OpenERP 7.0Open Source RAD with OpenERP 7.0
Open Source RAD with OpenERP 7.0
Quang Ngoc
 
ebs-adapter-webcast12345678900000000.pdf
ebs-adapter-webcast12345678900000000.pdfebs-adapter-webcast12345678900000000.pdf
ebs-adapter-webcast12345678900000000.pdf
Brighton26
 

Similar to Apex und EBR (20)

TechnoramaNL Azure Key Vault, Azure Dev Ops and Azure Data Factor
TechnoramaNL Azure Key Vault, Azure Dev Ops and Azure Data FactorTechnoramaNL Azure Key Vault, Azure Dev Ops and Azure Data Factor
TechnoramaNL Azure Key Vault, Azure Dev Ops and Azure Data Factor
 
DataSaturdayNL 2019 Azure Key Vault, Azure Dev Ops and Azure Data Factory h...
DataSaturdayNL 2019  Azure Key Vault, Azure Dev Ops and Azure Data Factory  h...DataSaturdayNL 2019  Azure Key Vault, Azure Dev Ops and Azure Data Factory  h...
DataSaturdayNL 2019 Azure Key Vault, Azure Dev Ops and Azure Data Factory h...
 
DatamindsConnect2019 Azure Key Vault, Azure Dev Ops and Azure Data Factory ho...
DatamindsConnect2019 Azure Key Vault, Azure Dev Ops and Azure Data Factory ho...DatamindsConnect2019 Azure Key Vault, Azure Dev Ops and Azure Data Factory ho...
DatamindsConnect2019 Azure Key Vault, Azure Dev Ops and Azure Data Factory ho...
 
SQL KONFERENZ 2020 Azure Key Vault, Azure Dev Ops and Azure Data Factory how...
SQL KONFERENZ 2020  Azure Key Vault, Azure Dev Ops and Azure Data Factory how...SQL KONFERENZ 2020  Azure Key Vault, Azure Dev Ops and Azure Data Factory how...
SQL KONFERENZ 2020 Azure Key Vault, Azure Dev Ops and Azure Data Factory how...
 
Aioug2017 deploying-ebs-on-prem-and-on-oracle-cloud v2
Aioug2017 deploying-ebs-on-prem-and-on-oracle-cloud v2Aioug2017 deploying-ebs-on-prem-and-on-oracle-cloud v2
Aioug2017 deploying-ebs-on-prem-and-on-oracle-cloud v2
 
OpenERP Technical Memento V0.7.3
OpenERP Technical Memento V0.7.3OpenERP Technical Memento V0.7.3
OpenERP Technical Memento V0.7.3
 
Step-by-Step: APEX Installation on Tomcat (Windows Server 2016)
Step-by-Step: APEX Installation on Tomcat (Windows Server 2016)Step-by-Step: APEX Installation on Tomcat (Windows Server 2016)
Step-by-Step: APEX Installation on Tomcat (Windows Server 2016)
 
E business suite r12.2 changes for database administrators
E business suite r12.2 changes for database administratorsE business suite r12.2 changes for database administrators
E business suite r12.2 changes for database administrators
 
E business suite r12.2 changes for database administrators
E business suite r12.2 changes for database administratorsE business suite r12.2 changes for database administrators
E business suite r12.2 changes for database administrators
 
AWS ElasticBeanstalk Advanced configuration
AWS ElasticBeanstalk Advanced configurationAWS ElasticBeanstalk Advanced configuration
AWS ElasticBeanstalk Advanced configuration
 
Open Source RAD with OpenERP 7.0
Open Source RAD with OpenERP 7.0Open Source RAD with OpenERP 7.0
Open Source RAD with OpenERP 7.0
 
Oracle REST Data Services Best Practices/ Overview
Oracle REST Data Services Best Practices/ OverviewOracle REST Data Services Best Practices/ Overview
Oracle REST Data Services Best Practices/ Overview
 
Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12
Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12
Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12
 
Serve Meals, Not Ingredients (ChefConf 2015)
Serve Meals, Not Ingredients (ChefConf 2015)Serve Meals, Not Ingredients (ChefConf 2015)
Serve Meals, Not Ingredients (ChefConf 2015)
 
Serve Meals, Not Ingredients - ChefConf 2015
Serve Meals, Not Ingredients - ChefConf 2015Serve Meals, Not Ingredients - ChefConf 2015
Serve Meals, Not Ingredients - ChefConf 2015
 
Running Microservices and Docker on AWS Elastic Beanstalk - August 2016 Month...
Running Microservices and Docker on AWS Elastic Beanstalk - August 2016 Month...Running Microservices and Docker on AWS Elastic Beanstalk - August 2016 Month...
Running Microservices and Docker on AWS Elastic Beanstalk - August 2016 Month...
 
ebs-adapter-webcast12345678900000000.pdf
ebs-adapter-webcast12345678900000000.pdfebs-adapter-webcast12345678900000000.pdf
ebs-adapter-webcast12345678900000000.pdf
 
Oracle Applications R12 architecture
Oracle Applications R12 architectureOracle Applications R12 architecture
Oracle Applications R12 architecture
 
Extending Oracle E-Business Suite with Ruby on Rails
Extending Oracle E-Business Suite with Ruby on RailsExtending Oracle E-Business Suite with Ruby on Rails
Extending Oracle E-Business Suite with Ruby on Rails
 
GeekAustin DevOps
GeekAustin DevOpsGeekAustin DevOps
GeekAustin DevOps
 

Recently uploaded

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
giselly40
 

Recently uploaded (20)

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
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
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
 
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
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 

Apex und EBR

  • 1. APEX and EBR © SYNTEGRIS INFORMATION SOLUTIONS GMBH Zero Downtime (Apex) Application Upgrades
  • 2. APEX and EBR Author Sven Weller www.syntegris.de
  • 3. EDITION BASED REDEFINITION Edition based redefinition unique feature of the Oracle DB since 11.2 no additional license costs available in EE, SE1, SE2, XE store and run different versions of PLSQL based objects AT THE SAME TIME © SYNTEGRIS INFORMATION SOLUTIONS GMBH EBR Basics editionable objects non editionable objects Packages, Functions, Procedures Tables, Columns, Data Trigger Sequences Types, Type Bodies Indexes Views, Editioning Views Materialized Views Libraries Database Links Synonyms Public Synonyms Virtual Columns Function Based Indexes
  • 4. USAGE child can “inherit” objects from the parent edition “inherit” will break, the first time the child compiles an object a database session is attached to a specific edition users work in one session/edition a new application release is deployed in a second edition after some grace period (testing time), default edition is switched next time user logs in, he/she works in the new edition EBR Basics ORA$ BASE ED1 ED2 © SYNTEGRIS INFORMATION SOLUTIONS GMBH
  • 5. EDITION SETUP make schema editionable create editions switch editions code something Demo 1 DBA_setup_editions.sql © SYNTEGRIS INFORMATION SOLUTIONS GMBH
  • 6. Edition as a Service CONNECT TO EDITION DB services are different names for a database Can set the edition! Used in the connection string © SYNTEGRIS INFORMATION SOLUTIONS GMBH
  • 7. Demo 2 DB SERVICES create DB services setup sql developer check listener persist services DBA_setup_editions.sql © SYNTEGRIS INFORMATION SOLUTIONS GMBH
  • 8. TIPPS AND TRAPS Do not enable editions for other schemas likeAPEX_LISTENER just grant USE ON EDITION Test Services after Database Restart Good database design helps to minimize table changes later Avoid to delete columns © SYNTEGRIS INFORMATION SOLUTIONS GMBH EBR Database Setup
  • 9. BRIDGING THE GAP setup different connection pools map url to pool rewrite url based upon edition EBR and APEX Databas e Editions ORA$ BAS E DEV$ BETA DEV$ ALPHA ORDS Apex App 120 App 110 App 100 Workspace REST rewrites © SYNTEGRIS INFORMATION SOLUTIONS GMBH
  • 10. EBR and APEX APEXAPPLICATION Edition = application release but only on data base level Apex applications are mostly data inside the apex repository Duplicating Apex Code = Copying theApplication © SYNTEGRIS INFORMATION SOLUTIONS GMBH
  • 11. APEX TODOS make application “edition aware” show current edition copy application apex db connection setup setup ords database pools for each edition map url to db pool resource template to combine url with application © SYNTEGRIS INFORMATION SOLUTIONS GMBH EBR and APEX
  • 12. SHOW CURRENT EDITION create application itemA_CURRENT_EDITION set it with an application process show the item, either in page template or in navigation bar “edition aware” app © SYNTEGRIS INFORMATION SOLUTIONS GMBH
  • 13. COPY APEXAPPLICATION App ID 100 = BASE App ID 110 = BETA App ID 120 =ALPHA change pages “edition aware” app © SYNTEGRIS INFORMATION SOLUTIONS GMBH
  • 14. XMLFILES defaults.xml setup —databases add service name copy&paste © SYNTEGRIS INFORMATION SOLUTIONS GMBH configure ORDS pools configuration file purpose defaults.xml common settings, defaults for all connection pools conf/apex.xml APEX_PUBLIC_USER configuration for APEX conf/apex_al.xml APEX_LISTENER read repository/rest configuration conf/apex_rt.xml APEX_REST_PUBLIC_USER apex REST services conf/apex_pu.xml ORDS_PUBLIC_USER Plsql and SQL developer REST services role-mapping.xml map web server roles to RESTful roles url-mapping.xml maps url to connection pools
  • 15. configure ORDS connection pools COMMANDS java -jar ords.war setup --database apexalpha <?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> <properties> <comment>Saved on Fri Jan 22 17:12:18 EST2016</comment> <entrykey="db.password">@05F6F3ABB32550C3BD33C3358A775868E1</entry> <entrykey="db.username">APEX_PUBLIC_USER</entry> <entrykey="db.servicename">DEV_ALPHA</entry> <entrykey="debug.debugger">true</entry> <entry key="debug.printDebugToScreen">true</entry> <entrykey="jdbc.InitialLimit">2</entry> </properties> © SYNTEGRIS INFORMATION SOLUTIONS GMBH
  • 16. map URL to database pool <?xml version="1.0" encoding="UTF-8"?> <pool-config xmlns="http://xmlns.oracle.com/apex/pool-config"> <pool name="apexalpha" base-path="alpha" updated="2016-04-22T06:17:08.423Z"/> <pool name="apexbeta" base-path="beta" updated="2016-04-22T06:17:08.423Z"/> <pool name="apexbase" base-path="base" updated="2016-04-22T06:17:08.423Z"/> </pool-config> COMMANDS java -jar ords.war map-url —type base-path alpha apexalpha © SYNTEGRIS INFORMATION SOLUTIONS GMBH
  • 17. ENABLE REST IN WORKSPACE set workspace preferences choose path prefix Ressource Templates © SYNTEGRIS INFORMATION SOLUTIONS GMBH
  • 18. CREATE RESTFUL SERVICE SQL Workshop / RESTful services create service module GET plsql handler no secure access out parameter binding url as location html redirect code 301 Test check network Ressource Templates © SYNTEGRIS INFORMATION SOLUTIONS GMBH
  • 19. CREATE RESTFUL SERVICE create service module no URI prefix = general handler Ressource Templates © SYNTEGRIS INFORMATION SOLUTIONS GMBH
  • 20. CREATE RESTFUL SERVICE create URI Template sample/ Ressource Templates © SYNTEGRIS INFORMATION SOLUTIONS GMBH
  • 21. CREATE RESTFUL SERVICE create URI Template ressource handler GET PLSQL no secure access Ressource Templates © SYNTEGRIS INFORMATION SOLUTIONS GMBH
  • 22. CREATE RESTFUL SERVICE create URI Template ressource handler set plsql source create OUT parameter LOCATION X-APEX-STATUS-CODE Ressource Templates declare urlvarchar2(4000); dbeditionvarchar2(100); begin -- check context based upon current connection dbedition := sys_context('userenv','current_edition_name'); if dbedition = 'ORA$BASE' then url :='../f?p=100'; elsif dbedition = 'DEV$BETA' then url := '../f?p=110'; elsif dbedition = 'DEV$ALPHA' then url :='../../f?p=120'; else -- use defaultapplication url := '../f?p=110'; endif; © SYNTEGRIS INFORMATION SOLUTIONS GMBH :URL :=url; :STATUS := 301; --redirect end;
  • 23. CREATE RESTFUL SERVICE TEST Ressource Templates © SYNTEGRIS INFORMATION SOLUTIONS GMBH
  • 24. TRY THEAPPLICATION Final Result © SYNTEGRIS INFORMATION SOLUTIONS GMBH
  • 25. Architecture use EBR to save a test database © SYNTEGRIS INFORMATION SOLUTIONS GMBH
  • 26. EDITION ARCHITECTURE DB and SVN setup DEV TST PRD DEV$ALPHA ORA$BASE PRD$TMP1 PRD$RELEASE1 PRD$RELEASE2 ORA$BASE Editions nightly automated SVN backup nightly BETAbuilds PRD$TMP2 PRD$TMP3 Integrations and Deployment Test Subversion repository for artefacts manual release build release creation and acceptance test reviews and automated unit testing © SYNTEGRIS INFORMATION SOLUTIONS GMBH development on demand deployment DEV$BETA
  • 27. RECOMMENDATIONS Negative downtime is better than zero downtime! Install and run different application version in parallel Use it during development and save up on test databases choose url pathname different from schema name © SYNTEGRIS INFORMATION SOLUTIONS GMBH Fazit
  • 28. LINKS Oracle Documentation https://docs.oracle.com/database/121/ADFNS/adfns_editions.htm#ADFNS020 Bryn Llewellyn http://www.oracle.com/technetwork/database/features/availability/edition-based- redefinition-1-133045.pdf Tom Kyte: “A closer look at the New Edition” http://www.oracle.com/technetwork/issue-archive/2010/10-jan/o10asktom-172777.html Chris Saxon https://www.doag.org/formes/pubfiles/7321069/docs/Konferenz/2015/vortraege/Development/ 2015-K-DEV-Chris_Saxon-Edition_Based_Redefinition_for_Zero_Downtime_PL_SQL_Changes- Manuskript.pdf Lucas Jellema http://www.slideshare.net/lucasjellema/edition-based-redefinition-continuous-database- application-evolution-with-oracle-database-11g-release-2 Kris Rice http://krisrice.blogspot.de/2013/07/nicer-urls-for-apex-yet-another-option.html http://de.slideshare.net/KrisRice/oracle-rest-data-services-best-practices-overview Sven Weller: “Working with Editions” https://svenweller.wordpress.com/2015/03/25/working-with-editions-part-1/ https://svenweller.wordpress.com/2015/06/16/working-with-editions-part-2/ Soon to come: The Edition based “not only” Redefinition Manifesto © SYNTEGRIS INFORMATION SOLUTIONS GMBH Want to know more?
  • 29. Danke SYNTEGRIS INFORMATION SOLUTIONS GMBH HERMANNSTRASSE 54-56 63263NEU-ISENBURG FON (06102) 29 86 68 FAX (06102) 55 88 06 INFO@SYNTEGRIS.DE SYNTEGRIS.DE