SlideShare a Scribd company logo
Release 2Release 3Base ReleaseContinuous Database Application Evolution with Oracle Database 11g Release 2 Lucas Jellema AMIS, The Netherlands
Introducing Oracle 11gR2 Edition Based Redefinitionthe story of the Parallel Application UniversesRelease 2Release 3Base ReleaseLucas Jellema AMIS, The Netherlands
AvailabilityAvailability = Performance * (Up or Down)Up = !DownDown = Unplanned Down + Planned DownPlanned Down???System MaintenancePower-supply, Hardware & Network, O/S upgradeDatabase patching & UpgradeApplication Upgrades
Maximum Availability Architecture
Application UpgradeCreation of new objectsChanging existing objects (alter and create or replace)Add, Modify or Drop columns or constraintsChange packages and stored proceduresRecompileDrop redundant objectsConvert or migrate dataResume normal operationsApplication is DOWN
Compare with road maintenance
Restructuring A12Build new road next to current one (A12-B)Same “functionality” as the old roadAt the cut-over momentOpen new A12-B: Newly arriving traffic travels on temporary roadClose A12 (original)Cars already on old road keep going
11gR2 Editioning is similarApplication Upgrade:Prepare new releaseConstruct the release in parallel to the existingOperations in existing application ‘edition’ continue normallyFrom the cut-over point:Have new sessions operate on new releaseExisting sessions can continue to run on existing release
11gR2 Editions introduces a new dimension in the databaseRelease 3Release 2Base Release
Editions introduce or inherit versions of objectsRelease 2Release 3Base Release
Editions are parallel universesDatabase Objects are identified byObject TypeSchemaObject Name…. Edition!(release, application version, stripe, parallel universe id)Database Sessions run in the context of a specific edition Using a specific collection of versions of objects
Database sessions run in a specific edition –one version of each objectRelease 2Release 3Base ReleaseThe database as seen by a sessionrunning in the context of Release 3323B22332
Demo of Application UpgradeExisting base application, in base editionCreate new editon – release_2Create and Alter database objectsBase application continues runningCut-over pointNew sessions run in release_2 editionCurrent sessions continue in base
Some Rules for EBR (Edition Based Redefinition)Editioning acts on packages, functions, triggers, procedures, views, types and synonymsEditioning does not apply to tablesData is not versionend, cloned, migratedDifferent incarnations of a table are suggested through editionable views – there is only one tableApplications should never access tables directly!
But wait, there is moreAfter the release of a new edition – there is no reason why you cannot keep the previous one going for some timeAnd multiple previous ones!That means – END OF THE BIG BANG upgrade!Multiple versions of the application can continue running to suport various user groups (e.g. SaaS)Without data migration and additional downtime upon later move over of user groups
Parallel Application VersionsApplication XVERSION 1Application XVERSION 2Release 2Release 3Base Release
Version 1 on Base Edition
Version 1 on Edition Release 2
Upgrade Base to Release 2AuthorsNew columns COUNTRY and BIOGRAPHYBooksDrop column NUM_OF_PAGESModified column ISBN (10 to 20 characters)New columns LANGUAGE and PUBLICATION_YEAR
Version 2 (on Edition Release 2)
Version 2 on Base Edition
Editions and TablesTables cannot be versioned: there is only one definition of a table across all EditionsData is not versioned: a record exists once and only onceThe solution for managing changes to Tables: Editioning Views and Cross Edition TriggersEditioning Views are defined on base table (no joins)Editioning Views can have DML triggers defined (just like base table)Using an editioning view in a query or DML statement does not impact the performance of the query or DML
Editions and TablesApplication AApplication BTable EMPSALMGRJOBENAMEHIREDATECOMM
Editions and TablesApplication AApplication BEditioning View EMP Table EMP_BASESALMGRJOBENAMEHIREDATECOMM
Oracle guarantees:The Execution Plan for a SQL query that uses an Editioning View is identical to that for the same query based directly on the table
Migrate to Editioning ViewsRename Table (for example to <old table name>_BASE)Constraints continue to refer to the tableCreate the Editioning View with the old table nameUsing the ‘CREATE OR REPLACE EDITIONING VIEW <view name>’ statementReroute privileges – grant on view rather than tableRecompile the triggers on the tableThese now become triggers on the Editioning ViewRecompile all invalid PL/SQL program units and ViewsThey now refer to the Editioning View instead of the tableVPD policies are reassigned to the ViewRegular auditing and FGA is on the table
DemoALTER TABLE EMP RENAME TO EMP_BASE;CREATE OR REPLACE EDITIONING VIEW EMPASSELECT ...FROM   EMP_BASE/DROP TRIGGER EMP_BRI/Rem recreate trigger on Editioning View@<EMP_BRI>.trgRem recompile invalid Views and PL/SQL units
Multiple versions of Editioning View Application AApplication BEdition R2Edition R1Editioning View EMP Editioning View EMP Table EMP_BASESALMGRJOBENAMEHIREDATECOMM
Multiple versions of Editioning View Application AApplication BEdition R2Edition R1View EMP (1.1)…* Language View EMP (1.0)Table EMP_BASESALMGRJOBENAMELANGUAGEHIREDATECOMMForward CrosseditionTrigger
DemoCREATE EDITION R2 AS CHILD OF R1;ALTER SESSION SET EDITION R2;SELECT SYS_CONTEXT('Userenv', 'Current_Edition_Name') "Current_Edition" FROM DUAL;ALTER TABLE EMP_BASEADD (LANGUAGE VARCHAR2(2) NULL);Rem function for deriving value for languageCREATE OR REPLACE FUNCTION GET_LANGUAGE( p_job in varchar2) return varchar2isbegin  return case p_job when 'MANAGER' then 'fr'                     else 'en' end;end;
DemoRem Create Forward Crossedition TriggerRem Applies to DML operations on EMP_BASE from Rem Earlier EditionsCREATE OR REPLACE TRIGGER EMP_1_1_Fwd_XedBEFORE INSERT OR UPDATE ON EMP_BASEFOR EACH ROWFORWARD CROSSEDITIONDISABLEBEGIN   :new.language = get_language(:new.job);END EMP_1_1_Fwd_Xed; Rem Enable the Forward Crossedition TriggerALTER TRIGGEREMP_1_1_Fwd_Xed ENABLE;
DemoRem Use Forward Crossedition trigger toRem upgrade existing table records according to new tableRem version (for large # records use dbms_parallel_execute)DECLARE   c NUMBER := DBMS_SQL.OPEN_CURSOR();   x NUMBER; BEGIN   DBMS_SQL.PARSE  ( c => c  , Language_Flag => DBMS_SQL.NATIVE  , Statement => 'UPDATE EMP_BASE               SET EMPNO = EMPNO', Apply_Crossedition_Trigger => 'EMP_1_1_Fwd_Xed'  );  x := DBMS_SQL.EXECUTE(c);   DBMS_SQL.CLOSE_CURSOR(c); COMMIT; END;
Upgrade Table Definition(Create Edition,) Set target Edition for sessionMake desired changes to the tableAdd columns, modify Columns, … (online redefinition)Modify the Editioning View in the Edition	To reflect the table as its latest version should lookPerhaps hiding columns you eventually want to drop(optional) Create Forward Crossedition Trigger on base table to have DML on previous Editions made valid(optional) Create Reverse Crossedition Trigger on base table to have DML on current Edition synch back
Cross Edition TriggersIf you remove a (mandatory) column from the current Editioning View…a Reverse Crossedition Trigger ensures that new records get some value in that (invisible) columnIf you add a (mandatory) column to the table (and the current Editioning View)…a Forward Crossedition Trigger ensures that records DMLed through previous Editioning View versions are made valid(optionally) Apply Forward Crossedition Trigger for all existing records (created in old edition of the table)Use DBMS_SQL.parse (with parameter Apply_Crossedition_Trigger set to name of trigger)Use DBMS_PARALLEL_EXECUTE
Multiple versions of Editioning View Application AApplication BEdition R3View EMP (1.1)… (minus ENAME)* Languageo FIRST_NAME* LAST_NAMEEdition R1Edition R2View EMP (1.1)…* Language View EMP (1.0)Table EMP_BASEReverse Crossedition TriggerSALMGRJOBENAMELANGUAGEFIRSTNAMELASTNAMEHIREDATECOMMForward CrosseditionTrigger
“Suggested (best) Practices”Every application (release) sets the Edition it requires when it connects to a sessionAt the same time it calls dbms_application_infoAnd sets other Context detailsApplications should never access tables – all access should be through viewsOnly through views can the data structure itself be EditionedEven triggers should be on the Editioning View
Interesting EBR Tid-BitsDrop Object in an Edition stops the inheritance from previous Edition. Object no longer is carried forwardEdition can have only one child – no branches (yet)DBMS_SQL.PARSE can be executed in a specific EditionUse parameter edition to specify other than current editionIf no explicit edition is set for a session, the default edition is usedALTER DATABASE DEFAULT EDITION = edition_name; Hints in queries against Editionable Views are understood in terms of the underlying tableLogical EV column references are correctly mapped
Interesting EBR Tid-BitsDB Links & Materialized Views currently not editionableObjects of an editionable type are not editionable when used by a non-editional objectPL/SQL Function used in Function Based Index or the definition of a Materialized ViewADT used as the base type for a column in a tableEBR (online upgrade) benefits from Online Table Redefinition and Fine Grained Dependency trackingData Dictionary ViewsDBA_/ALL_EDITIONS – editions in the databaseDBA_/ALL_OBJECTS – objects (inherited) in current editionDBA_/ALL_OBJECTS_AE – actual objects across all editions
Summary11gR2 Editions are parallel, co-existing universes with incarnations of database objectsThe new release can be constructed, tested and run in a new editionThe old edition can be switched off at cut-over Editions also allow long time co-existence of multiple releases of an applicationApplication Upgrade no longer needs to disrupt the operation through planned downtimeBy the way: EBR is available in all DB editions
ConclusionSee our blog for Oracle Database 11gR2 articles (other topics as well)http://technology.amis.nl/blogThis presentation and the demo scripts are on the blog tooContact me: lucas.jellema@amis.nl

More Related Content

What's hot (20)

PPTX
PostgreSQL- An Introduction
Smita Prasad
 
PDF
eBPF - Rethinking the Linux Kernel
Thomas Graf
 
PDF
What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...
ScaleGrid.io
 
PDF
RocksDB Performance and Reliability Practices
Yoshinori Matsunobu
 
PPTX
Postgresql Database Administration Basic - Day1
PoguttuezhiniVP
 
PPTX
ceph optimization on ssd ilsoo byun-short
NAVER D2
 
PDF
BPF & Cilium - Turning Linux into a Microservices-aware Operating System
Thomas Graf
 
PDF
PostgreSQL Replication High Availability Methods
Mydbops
 
PDF
MariaDB Performance Tuning and Optimization
MariaDB plc
 
PDF
Administración de Tablespace en PostgreSQL
Eddie Malca
 
PPTX
YugaByte DB Internals - Storage Engine and Transactions
Yugabyte
 
PDF
Clickhouse Capacity Planning for OLAP Workloads, Mik Kocikowski of CloudFlare
Altinity Ltd
 
PDF
HandsOn ProxySQL Tutorial - PLSC18
Derek Downey
 
PDF
Optimizing MariaDB for maximum performance
MariaDB plc
 
PDF
MariaDB Server Performance Tuning & Optimization
MariaDB plc
 
PDF
Developing for Node.JS with MySQL and NoSQL
John David Duncan
 
PDF
Linux Profiling at Netflix
Brendan Gregg
 
KEY
PostgreSQL
Reuven Lerner
 
PDF
Redis 101
Geoff Hoffman
 
PDF
Introduction to MongoDB
Mike Dirolf
 
PostgreSQL- An Introduction
Smita Prasad
 
eBPF - Rethinking the Linux Kernel
Thomas Graf
 
What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...
ScaleGrid.io
 
RocksDB Performance and Reliability Practices
Yoshinori Matsunobu
 
Postgresql Database Administration Basic - Day1
PoguttuezhiniVP
 
ceph optimization on ssd ilsoo byun-short
NAVER D2
 
BPF & Cilium - Turning Linux into a Microservices-aware Operating System
Thomas Graf
 
PostgreSQL Replication High Availability Methods
Mydbops
 
MariaDB Performance Tuning and Optimization
MariaDB plc
 
Administración de Tablespace en PostgreSQL
Eddie Malca
 
YugaByte DB Internals - Storage Engine and Transactions
Yugabyte
 
Clickhouse Capacity Planning for OLAP Workloads, Mik Kocikowski of CloudFlare
Altinity Ltd
 
HandsOn ProxySQL Tutorial - PLSC18
Derek Downey
 
Optimizing MariaDB for maximum performance
MariaDB plc
 
MariaDB Server Performance Tuning & Optimization
MariaDB plc
 
Developing for Node.JS with MySQL and NoSQL
John David Duncan
 
Linux Profiling at Netflix
Brendan Gregg
 
PostgreSQL
Reuven Lerner
 
Redis 101
Geoff Hoffman
 
Introduction to MongoDB
Mike Dirolf
 

Viewers also liked (20)

PDF
Gitora, Version Control for PL/SQL
Gerger
 
PDF
Gitora, Version Control for PL/SQL
Gerger
 
PDF
Version control for PL/SQL
Gerger
 
PPSX
Continuous Integration - Oracle Database Objects
Prabhu Ramasamy
 
PDF
Introducing Gitora,the version control tool for PL/SQL
Gerger
 
PDF
Continuous Delivery at Oracle Database Insights
Michael Medin
 
PDF
Using puppet to leverage DevOps in Large Enterprise Oracle Environments
Bert Hajee
 
PDF
Building an Automated Database Deployment Pipeline
Grant Fritchey
 
PDF
Continuous Integration for Oracle Database Development
Vladimir Bakhov
 
PPTX
DevOps in your Oracle Stack
Timothy Krupinski
 
PDF
CopyofAResume
William Jones
 
PDF
Context Based Learning for GIS: an Interdisciplinary Approach
Patrick Rickles
 
PPTX
Pre Production (Planning)
Rahul Karavadra
 
PPT
портфолио голубович
golubovicholga
 
PPTX
Creep Coursework Presentation
kess1a
 
PPT
Psicopedagoga rj.com.br Cadastro
PsicopedagogaRJ
 
PDF
Copia de resumen qué son los mapas conceptuales.doc%0 a
noeliavillar
 
PDF
Portfolio Draft
Victoria Esser
 
PPTX
Nature and animal conservation by art
ART Raviteja akarapu
 
PDF
ckitterman resume
craig kitterman
 
Gitora, Version Control for PL/SQL
Gerger
 
Gitora, Version Control for PL/SQL
Gerger
 
Version control for PL/SQL
Gerger
 
Continuous Integration - Oracle Database Objects
Prabhu Ramasamy
 
Introducing Gitora,the version control tool for PL/SQL
Gerger
 
Continuous Delivery at Oracle Database Insights
Michael Medin
 
Using puppet to leverage DevOps in Large Enterprise Oracle Environments
Bert Hajee
 
Building an Automated Database Deployment Pipeline
Grant Fritchey
 
Continuous Integration for Oracle Database Development
Vladimir Bakhov
 
DevOps in your Oracle Stack
Timothy Krupinski
 
CopyofAResume
William Jones
 
Context Based Learning for GIS: an Interdisciplinary Approach
Patrick Rickles
 
Pre Production (Planning)
Rahul Karavadra
 
портфолио голубович
golubovicholga
 
Creep Coursework Presentation
kess1a
 
Psicopedagoga rj.com.br Cadastro
PsicopedagogaRJ
 
Copia de resumen qué son los mapas conceptuales.doc%0 a
noeliavillar
 
Portfolio Draft
Victoria Esser
 
Nature and animal conservation by art
ART Raviteja akarapu
 
ckitterman resume
craig kitterman
 
Ad

Similar to Edition Based Redefinition - Continuous Database Application Evolution with Oracle Database 11g Release 2 (20)

PPTX
Introducing and Demonstrating Oracle Database 11gR2's Killer Feature – Editio...
Lucas Jellema
 
PPTX
Edition Based Redefinition
Alex Nuijten
 
PPTX
Tales from a Parallel Universe: Using Oracle 11gR2's Edition Based Redefiniti...
Roel Hartman
 
PPTX
Oracle11g R2 - Edition Based Redefinition for On Line Application Upgrade
Lucas Jellema
 
PPTX
Edition based redefinition joords
Jos van den Oord [Oracle DBA,OCM,OCP,RAC,CLOUD]
 
PDF
EDITION & TARGET EDITION & Edition-Based Redefinition (EBR) in Oracle
Alireza Kamrani
 
PPTX
Edition based redefinition joords
Jos van den Oord [Oracle DBA,OCM,OCP,RAC,CLOUD]
 
PDF
Basic - Oracle Edition Based Redefinition Presentation
N/A
 
PDF
Editioning use in ebs
aioughydchapter
 
PDF
Editioning use in ebs
pasalapudi123
 
PDF
King_EditionBasedRedefinition_oracle12c.pdf
nassrmansoor
 
PDF
Presentation online application upgrade of oracle's bug db with edition-ba...
xKinAnx
 
PDF
How to upgrade your application with no downtime (using edition-based redefin...
Oren Nakdimon
 
PPTX
Developer's Approach to Code Management
Michael Rosenblum
 
PPTX
Beyond EBR, Quantum Columns, Spook Joins and Virtual Integrity for ZDT Data V...
Jeff Jacobs
 
PPT
11g R2
afa reg
 
DOCX
Java full stack1
pravash sahoo
 
TXT
Oracle 9i notes([email protected])
Kamal Raj
 
PPTX
Clare Somerville Trish O’Kane Data in Databases
Future Perfect 2012
 
PPT
Modern Database Development Oow2008 Lucas Jellema
Lucas Jellema
 
Introducing and Demonstrating Oracle Database 11gR2's Killer Feature – Editio...
Lucas Jellema
 
Edition Based Redefinition
Alex Nuijten
 
Tales from a Parallel Universe: Using Oracle 11gR2's Edition Based Redefiniti...
Roel Hartman
 
Oracle11g R2 - Edition Based Redefinition for On Line Application Upgrade
Lucas Jellema
 
Edition based redefinition joords
Jos van den Oord [Oracle DBA,OCM,OCP,RAC,CLOUD]
 
EDITION & TARGET EDITION & Edition-Based Redefinition (EBR) in Oracle
Alireza Kamrani
 
Edition based redefinition joords
Jos van den Oord [Oracle DBA,OCM,OCP,RAC,CLOUD]
 
Basic - Oracle Edition Based Redefinition Presentation
N/A
 
Editioning use in ebs
aioughydchapter
 
Editioning use in ebs
pasalapudi123
 
King_EditionBasedRedefinition_oracle12c.pdf
nassrmansoor
 
Presentation online application upgrade of oracle's bug db with edition-ba...
xKinAnx
 
How to upgrade your application with no downtime (using edition-based redefin...
Oren Nakdimon
 
Developer's Approach to Code Management
Michael Rosenblum
 
Beyond EBR, Quantum Columns, Spook Joins and Virtual Integrity for ZDT Data V...
Jeff Jacobs
 
11g R2
afa reg
 
Java full stack1
pravash sahoo
 
Oracle 9i notes([email protected])
Kamal Raj
 
Clare Somerville Trish O’Kane Data in Databases
Future Perfect 2012
 
Modern Database Development Oow2008 Lucas Jellema
Lucas Jellema
 
Ad

More from Lucas Jellema (20)

PPTX
Introduction to web application development with Vue (for absolute beginners)...
Lucas Jellema
 
PPTX
Making the Shift Left - Bringing Ops to Dev before bringing applications to p...
Lucas Jellema
 
PPTX
Lightweight coding in powerful Cloud Development Environments (DigitalXchange...
Lucas Jellema
 
PPTX
Apache Superset - open source data exploration and visualization (Conclusion ...
Lucas Jellema
 
PPTX
CONNECTING THE REAL WORLD TO ENTERPRISE IT – HOW IoT DRIVES OUR ENERGY TRANSI...
Lucas Jellema
 
PPTX
Help me move away from Oracle - or not?! (Oracle Community Tour EMEA - LVOUG...
Lucas Jellema
 
PPTX
Op je vingers tellen... tot 1000!
Lucas Jellema
 
PPTX
IoT - from prototype to enterprise platform (DigitalXchange 2022)
Lucas Jellema
 
PPTX
Who Wants to Become an IT Architect-A Look at the Bigger Picture - DigitalXch...
Lucas Jellema
 
PPTX
Steampipe - use SQL to retrieve data from cloud, platforms and files (Code Ca...
Lucas Jellema
 
PPTX
Automation of Software Engineering with OCI DevOps Build and Deployment Pipel...
Lucas Jellema
 
PPTX
Introducing Dapr.io - the open source personal assistant to microservices and...
Lucas Jellema
 
PPTX
How and Why you can and should Participate in Open Source Projects (AMIS, Sof...
Lucas Jellema
 
PPTX
Microservices, Apache Kafka, Node, Dapr and more - Part Two (Fontys Hogeschoo...
Lucas Jellema
 
PPTX
Microservices, Node, Dapr and more - Part One (Fontys Hogeschool, Spring 2022)
Lucas Jellema
 
PPTX
6Reinventing Oracle Systems in a Cloudy World (RMOUG Trainingdays, February 2...
Lucas Jellema
 
PPTX
Help me move away from Oracle! (RMOUG Training Days 2022, February 2022)
Lucas Jellema
 
PPTX
Tech Talks 101 - DevOps (jan 2022)
Lucas Jellema
 
PPTX
Conclusion Code Cafe - Microcks for Mocking and Testing Async APIs (January 2...
Lucas Jellema
 
PPTX
Cloud Native Application Development - build fast, low TCO, scalable & agile ...
Lucas Jellema
 
Introduction to web application development with Vue (for absolute beginners)...
Lucas Jellema
 
Making the Shift Left - Bringing Ops to Dev before bringing applications to p...
Lucas Jellema
 
Lightweight coding in powerful Cloud Development Environments (DigitalXchange...
Lucas Jellema
 
Apache Superset - open source data exploration and visualization (Conclusion ...
Lucas Jellema
 
CONNECTING THE REAL WORLD TO ENTERPRISE IT – HOW IoT DRIVES OUR ENERGY TRANSI...
Lucas Jellema
 
Help me move away from Oracle - or not?! (Oracle Community Tour EMEA - LVOUG...
Lucas Jellema
 
Op je vingers tellen... tot 1000!
Lucas Jellema
 
IoT - from prototype to enterprise platform (DigitalXchange 2022)
Lucas Jellema
 
Who Wants to Become an IT Architect-A Look at the Bigger Picture - DigitalXch...
Lucas Jellema
 
Steampipe - use SQL to retrieve data from cloud, platforms and files (Code Ca...
Lucas Jellema
 
Automation of Software Engineering with OCI DevOps Build and Deployment Pipel...
Lucas Jellema
 
Introducing Dapr.io - the open source personal assistant to microservices and...
Lucas Jellema
 
How and Why you can and should Participate in Open Source Projects (AMIS, Sof...
Lucas Jellema
 
Microservices, Apache Kafka, Node, Dapr and more - Part Two (Fontys Hogeschoo...
Lucas Jellema
 
Microservices, Node, Dapr and more - Part One (Fontys Hogeschool, Spring 2022)
Lucas Jellema
 
6Reinventing Oracle Systems in a Cloudy World (RMOUG Trainingdays, February 2...
Lucas Jellema
 
Help me move away from Oracle! (RMOUG Training Days 2022, February 2022)
Lucas Jellema
 
Tech Talks 101 - DevOps (jan 2022)
Lucas Jellema
 
Conclusion Code Cafe - Microcks for Mocking and Testing Async APIs (January 2...
Lucas Jellema
 
Cloud Native Application Development - build fast, low TCO, scalable & agile ...
Lucas Jellema
 

Recently uploaded (20)

PDF
Redefining Work in the Age of AI - What to expect? How to prepare? Why it mat...
Malinda Kapuruge
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
 
PDF
Kubernetes - Architecture & Components.pdf
geethak285
 
PPTX
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Pitch ...
Michele Kryston
 
PPSX
Usergroup - OutSystems Architecture.ppsx
Kurt Vandevelde
 
PDF
The Future of Product Management in AI ERA.pdf
Alyona Owens
 
PDF
“MPU+: A Transformative Solution for Next-Gen AI at the Edge,” a Presentation...
Edge AI and Vision Alliance
 
PPTX
Simplifica la seguridad en la nube y la detección de amenazas con FortiCNAPP
Cristian Garcia G.
 
PDF
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
 
PDF
ArcGIS Utility Network Migration - The Hunter Water Story
Safe Software
 
PPTX
Paycifi - Programmable Trust_Breakfast_PPTXT
FinTech Belgium
 
PDF
How to Visualize the ​Spatio-Temporal Data Using CesiumJS​
SANGHEE SHIN
 
PDF
Enhancing Environmental Monitoring with Real-Time Data Integration: Leveragin...
Safe Software
 
PDF
Database Benchmarking for Performance Masterclass: Session 1 - Benchmarking F...
ScyllaDB
 
PDF
Hello I'm "AI" Your New _________________
Dr. Tathagat Varma
 
PDF
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Ravi Tamada
 
PPTX
01_Approach Cyber- DORA Incident Management.pptx
FinTech Belgium
 
PDF
5 Things to Consider When Deploying AI in Your Enterprise
Safe Software
 
PDF
My Journey from CAD to BIM: A True Underdog Story
Safe Software
 
Redefining Work in the Age of AI - What to expect? How to prepare? Why it mat...
Malinda Kapuruge
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
 
Kubernetes - Architecture & Components.pdf
geethak285
 
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Pitch ...
Michele Kryston
 
Usergroup - OutSystems Architecture.ppsx
Kurt Vandevelde
 
The Future of Product Management in AI ERA.pdf
Alyona Owens
 
“MPU+: A Transformative Solution for Next-Gen AI at the Edge,” a Presentation...
Edge AI and Vision Alliance
 
Simplifica la seguridad en la nube y la detección de amenazas con FortiCNAPP
Cristian Garcia G.
 
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
 
ArcGIS Utility Network Migration - The Hunter Water Story
Safe Software
 
Paycifi - Programmable Trust_Breakfast_PPTXT
FinTech Belgium
 
How to Visualize the ​Spatio-Temporal Data Using CesiumJS​
SANGHEE SHIN
 
Enhancing Environmental Monitoring with Real-Time Data Integration: Leveragin...
Safe Software
 
Database Benchmarking for Performance Masterclass: Session 1 - Benchmarking F...
ScyllaDB
 
Hello I'm "AI" Your New _________________
Dr. Tathagat Varma
 
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Ravi Tamada
 
01_Approach Cyber- DORA Incident Management.pptx
FinTech Belgium
 
5 Things to Consider When Deploying AI in Your Enterprise
Safe Software
 
My Journey from CAD to BIM: A True Underdog Story
Safe Software
 

Edition Based Redefinition - Continuous Database Application Evolution with Oracle Database 11g Release 2

  • 1. Release 2Release 3Base ReleaseContinuous Database Application Evolution with Oracle Database 11g Release 2 Lucas Jellema AMIS, The Netherlands
  • 2. Introducing Oracle 11gR2 Edition Based Redefinitionthe story of the Parallel Application UniversesRelease 2Release 3Base ReleaseLucas Jellema AMIS, The Netherlands
  • 3. AvailabilityAvailability = Performance * (Up or Down)Up = !DownDown = Unplanned Down + Planned DownPlanned Down???System MaintenancePower-supply, Hardware & Network, O/S upgradeDatabase patching & UpgradeApplication Upgrades
  • 5. Application UpgradeCreation of new objectsChanging existing objects (alter and create or replace)Add, Modify or Drop columns or constraintsChange packages and stored proceduresRecompileDrop redundant objectsConvert or migrate dataResume normal operationsApplication is DOWN
  • 6. Compare with road maintenance
  • 7. Restructuring A12Build new road next to current one (A12-B)Same “functionality” as the old roadAt the cut-over momentOpen new A12-B: Newly arriving traffic travels on temporary roadClose A12 (original)Cars already on old road keep going
  • 8. 11gR2 Editioning is similarApplication Upgrade:Prepare new releaseConstruct the release in parallel to the existingOperations in existing application ‘edition’ continue normallyFrom the cut-over point:Have new sessions operate on new releaseExisting sessions can continue to run on existing release
  • 9. 11gR2 Editions introduces a new dimension in the databaseRelease 3Release 2Base Release
  • 10. Editions introduce or inherit versions of objectsRelease 2Release 3Base Release
  • 11. Editions are parallel universesDatabase Objects are identified byObject TypeSchemaObject Name…. Edition!(release, application version, stripe, parallel universe id)Database Sessions run in the context of a specific edition Using a specific collection of versions of objects
  • 12. Database sessions run in a specific edition –one version of each objectRelease 2Release 3Base ReleaseThe database as seen by a sessionrunning in the context of Release 3323B22332
  • 13. Demo of Application UpgradeExisting base application, in base editionCreate new editon – release_2Create and Alter database objectsBase application continues runningCut-over pointNew sessions run in release_2 editionCurrent sessions continue in base
  • 14. Some Rules for EBR (Edition Based Redefinition)Editioning acts on packages, functions, triggers, procedures, views, types and synonymsEditioning does not apply to tablesData is not versionend, cloned, migratedDifferent incarnations of a table are suggested through editionable views – there is only one tableApplications should never access tables directly!
  • 15. But wait, there is moreAfter the release of a new edition – there is no reason why you cannot keep the previous one going for some timeAnd multiple previous ones!That means – END OF THE BIG BANG upgrade!Multiple versions of the application can continue running to suport various user groups (e.g. SaaS)Without data migration and additional downtime upon later move over of user groups
  • 16. Parallel Application VersionsApplication XVERSION 1Application XVERSION 2Release 2Release 3Base Release
  • 17. Version 1 on Base Edition
  • 18. Version 1 on Edition Release 2
  • 19. Upgrade Base to Release 2AuthorsNew columns COUNTRY and BIOGRAPHYBooksDrop column NUM_OF_PAGESModified column ISBN (10 to 20 characters)New columns LANGUAGE and PUBLICATION_YEAR
  • 20. Version 2 (on Edition Release 2)
  • 21. Version 2 on Base Edition
  • 22. Editions and TablesTables cannot be versioned: there is only one definition of a table across all EditionsData is not versioned: a record exists once and only onceThe solution for managing changes to Tables: Editioning Views and Cross Edition TriggersEditioning Views are defined on base table (no joins)Editioning Views can have DML triggers defined (just like base table)Using an editioning view in a query or DML statement does not impact the performance of the query or DML
  • 23. Editions and TablesApplication AApplication BTable EMPSALMGRJOBENAMEHIREDATECOMM
  • 24. Editions and TablesApplication AApplication BEditioning View EMP Table EMP_BASESALMGRJOBENAMEHIREDATECOMM
  • 25. Oracle guarantees:The Execution Plan for a SQL query that uses an Editioning View is identical to that for the same query based directly on the table
  • 26. Migrate to Editioning ViewsRename Table (for example to <old table name>_BASE)Constraints continue to refer to the tableCreate the Editioning View with the old table nameUsing the ‘CREATE OR REPLACE EDITIONING VIEW <view name>’ statementReroute privileges – grant on view rather than tableRecompile the triggers on the tableThese now become triggers on the Editioning ViewRecompile all invalid PL/SQL program units and ViewsThey now refer to the Editioning View instead of the tableVPD policies are reassigned to the ViewRegular auditing and FGA is on the table
  • 27. DemoALTER TABLE EMP RENAME TO EMP_BASE;CREATE OR REPLACE EDITIONING VIEW EMPASSELECT ...FROM EMP_BASE/DROP TRIGGER EMP_BRI/Rem recreate trigger on Editioning View@<EMP_BRI>.trgRem recompile invalid Views and PL/SQL units
  • 28. Multiple versions of Editioning View Application AApplication BEdition R2Edition R1Editioning View EMP Editioning View EMP Table EMP_BASESALMGRJOBENAMEHIREDATECOMM
  • 29. Multiple versions of Editioning View Application AApplication BEdition R2Edition R1View EMP (1.1)…* Language View EMP (1.0)Table EMP_BASESALMGRJOBENAMELANGUAGEHIREDATECOMMForward CrosseditionTrigger
  • 30. DemoCREATE EDITION R2 AS CHILD OF R1;ALTER SESSION SET EDITION R2;SELECT SYS_CONTEXT('Userenv', 'Current_Edition_Name') "Current_Edition" FROM DUAL;ALTER TABLE EMP_BASEADD (LANGUAGE VARCHAR2(2) NULL);Rem function for deriving value for languageCREATE OR REPLACE FUNCTION GET_LANGUAGE( p_job in varchar2) return varchar2isbegin return case p_job when 'MANAGER' then 'fr' else 'en' end;end;
  • 31. DemoRem Create Forward Crossedition TriggerRem Applies to DML operations on EMP_BASE from Rem Earlier EditionsCREATE OR REPLACE TRIGGER EMP_1_1_Fwd_XedBEFORE INSERT OR UPDATE ON EMP_BASEFOR EACH ROWFORWARD CROSSEDITIONDISABLEBEGIN :new.language = get_language(:new.job);END EMP_1_1_Fwd_Xed; Rem Enable the Forward Crossedition TriggerALTER TRIGGEREMP_1_1_Fwd_Xed ENABLE;
  • 32. DemoRem Use Forward Crossedition trigger toRem upgrade existing table records according to new tableRem version (for large # records use dbms_parallel_execute)DECLARE c NUMBER := DBMS_SQL.OPEN_CURSOR(); x NUMBER; BEGIN DBMS_SQL.PARSE ( c => c , Language_Flag => DBMS_SQL.NATIVE , Statement => 'UPDATE EMP_BASE SET EMPNO = EMPNO', Apply_Crossedition_Trigger => 'EMP_1_1_Fwd_Xed' ); x := DBMS_SQL.EXECUTE(c); DBMS_SQL.CLOSE_CURSOR(c); COMMIT; END;
  • 33. Upgrade Table Definition(Create Edition,) Set target Edition for sessionMake desired changes to the tableAdd columns, modify Columns, … (online redefinition)Modify the Editioning View in the Edition To reflect the table as its latest version should lookPerhaps hiding columns you eventually want to drop(optional) Create Forward Crossedition Trigger on base table to have DML on previous Editions made valid(optional) Create Reverse Crossedition Trigger on base table to have DML on current Edition synch back
  • 34. Cross Edition TriggersIf you remove a (mandatory) column from the current Editioning View…a Reverse Crossedition Trigger ensures that new records get some value in that (invisible) columnIf you add a (mandatory) column to the table (and the current Editioning View)…a Forward Crossedition Trigger ensures that records DMLed through previous Editioning View versions are made valid(optionally) Apply Forward Crossedition Trigger for all existing records (created in old edition of the table)Use DBMS_SQL.parse (with parameter Apply_Crossedition_Trigger set to name of trigger)Use DBMS_PARALLEL_EXECUTE
  • 35. Multiple versions of Editioning View Application AApplication BEdition R3View EMP (1.1)… (minus ENAME)* Languageo FIRST_NAME* LAST_NAMEEdition R1Edition R2View EMP (1.1)…* Language View EMP (1.0)Table EMP_BASEReverse Crossedition TriggerSALMGRJOBENAMELANGUAGEFIRSTNAMELASTNAMEHIREDATECOMMForward CrosseditionTrigger
  • 36. “Suggested (best) Practices”Every application (release) sets the Edition it requires when it connects to a sessionAt the same time it calls dbms_application_infoAnd sets other Context detailsApplications should never access tables – all access should be through viewsOnly through views can the data structure itself be EditionedEven triggers should be on the Editioning View
  • 37. Interesting EBR Tid-BitsDrop Object in an Edition stops the inheritance from previous Edition. Object no longer is carried forwardEdition can have only one child – no branches (yet)DBMS_SQL.PARSE can be executed in a specific EditionUse parameter edition to specify other than current editionIf no explicit edition is set for a session, the default edition is usedALTER DATABASE DEFAULT EDITION = edition_name; Hints in queries against Editionable Views are understood in terms of the underlying tableLogical EV column references are correctly mapped
  • 38. Interesting EBR Tid-BitsDB Links & Materialized Views currently not editionableObjects of an editionable type are not editionable when used by a non-editional objectPL/SQL Function used in Function Based Index or the definition of a Materialized ViewADT used as the base type for a column in a tableEBR (online upgrade) benefits from Online Table Redefinition and Fine Grained Dependency trackingData Dictionary ViewsDBA_/ALL_EDITIONS – editions in the databaseDBA_/ALL_OBJECTS – objects (inherited) in current editionDBA_/ALL_OBJECTS_AE – actual objects across all editions
  • 39. Summary11gR2 Editions are parallel, co-existing universes with incarnations of database objectsThe new release can be constructed, tested and run in a new editionThe old edition can be switched off at cut-over Editions also allow long time co-existence of multiple releases of an applicationApplication Upgrade no longer needs to disrupt the operation through planned downtimeBy the way: EBR is available in all DB editions
  • 40. ConclusionSee our blog for Oracle Database 11gR2 articles (other topics as well)http://technology.amis.nl/blogThis presentation and the demo scripts are on the blog tooContact me: [email protected]

Editor's Notes

  • #37: Synonyms are editionableADT are not – though ADTs not used in (Editionable) Table may beAfter a drop you can recreate an object –the ancestry is based on name alone so the end result is the same as the starting pointEditions really is an extension of the Name Resolution mechanismIn addition to name and schema, the edition is taken into accountSQL Execution plans are the same for queries against the table and against the Editioning ViewWhen View 1 depends on View 2 – which version of View 2 is the one picked for view 1?The selection is made like this: whichever version of View 2 that is actual in the Edition where View 1 is createdFixed in 11g – DDL in parallel with running transactions against the same objects (?)Also/part of that: fine grained dependency trackingTools for comparing Editions?List of actual in Edition 2 and Edition 1Compare object levelDIYVPD and FGA work fine with Editionable Views