SlideShare a Scribd company logo
1 of 27
Beyond EBR (Draft)
Quantum Columns, Spooky Joins and Virtual Integrity for ZDT Data Versioning
Jeff Jacobs, Consulting Data Architect
Jeffrey Jacobs & Associates
About Me
The Problem
• Complex Application
• 1,000s of Tables and Views
• Referential integrity constraints require enforcement
• Application code in PL/SQL, Java, etc.
• New releases/upgrades/patches require significant downtime
Partial Solution - Edition Based Redefinition
(EBR)
• Migrate to Edition Based Redefinition EBR for Zero Down Time (ZDT)
release
• Stage and test new release in same infrastructure independent of current
release
EBR Features
• EBR manages editions of an application for:
• PL/SQL changes
• DDL changes
• EBR’s edition triggers provide the ability to synch data between
editions for changes to DDL
• Edition to be used by code governed by SYS_CONTEXT variable
• Very transparent to existing code
• Each edition has an EDITION_NAME
What is Seed Data?
• Seed Data tables are (usually) reference only tables
• May be parent to multiple Non-Seed Data tables
• “Seed Data” tables contain data that is added/updated for a new release
• Data needs to be “versioned” for each release
• Data is not synched across releases
• Data changes not due to changes in DDL
• New, coordinated version of data for multiple tables for new edition
• Examples
• Field labels for application screen
• Text
• Font
• Color
• Size
• Demo/sample data
• Etc.
Solution Goals
• EBR does not provide support for managing Seed Data
• But we want independent Seed Data for each edition
• Minimal or no changes to existing DML
• Minimal or no changes to existing code
• Minimal or no affect on performance
• Avoid creation of new DB objects, i.e. VIEWS, synonyms, etc.
• Minimize rework
• Preserve referential integrity enforcement
Sample Schema
SYS_CONTEXT Variables
• What are they?
• How to create?
• <code sample>
• How to use?
• <code sample>
Quantum Column Physics POP Quiz!
(Schrodinger’s Cat + Quantum Superposition)
• Can a given row’s virtual column have multiple values at the same
instant in time with no in-flight transactions?
• Yes
• Call this a “Quantum Column” (QC)
• How?
• Virtual column is based on a SYS_CONTEXT variable
• Value of QC is determined by value of SYS_CONTEXT variables
• Can this be used to solve our Seed Data problem?
• TBD!
Never Include a Quantum Column in an Index
• QCs are inherently non-deterministic
• Value is based on session’s value of SYS_CONTEXT variable at time of query
• Virtual column value is determined at runtime
• Indexes are deterministic:
• A virtual column’s value is persisted in the index with the value at the time of
INSERT/UPDATE
“Bollocks” – Bryn Lewellyn
• Starting simple, focus on normal runtime behavior
• Seed data patching issues later
• How it’s done!
• Add a Quantum Column to child table based on EBR SYS_CONTEXT variable
• We’ll name the Quantum Column “EDITION_NAME_QC”
• Drop the FK constraint(s)
• Add a non-virtual version column to parent/Seed table
• Holds the value of EBR editions
• We’ll name this “EDITION_NAME
• Drop PK constraint
• Recreate PK constraint with prior columns plus new version column
• Add Virtual Private Database expression to parent/Seed table to use appropriate EBR edition value
• Normal runtime code uses above EBR SYS_CONTEXT variable value
• Recreate FK
• NO CHANGES TO EXISTING DML!
Demos
• Query to show original query works without new columns in join
• Add new release to Seed Data with updated/new info
• Show same query works in both editions returning appropriate data
• Show referential integrity works
Part 1 – QCs and Foreign Key Constraints
• FK columns may be based on a virtual column
• Virtual column may be based on SYS_CONTEXT variable value
• Such as EBR’s <need name>
• QC is a virtual column
• But what about the parent table’s primary key?
Part 2 – Modify Seed Table Primary Key
• Add new column, “EDITION NAME” to PK
• DEFAULT value of EBR_EDITION
• PK now consists of original PK, i.e. “FIELD_NAME”
• Patching code explicitly manages value of EDITION_NAME
• Application code INSERT addressed later
New Data Model Diagram
VPD Example (Spooky Join)
• VPD provides the additional join column between the Seed Data table
and the child table
• “Spooky” join
Spooky Join Demo
• Create and populate tables with 1 release of data
• Run Query
• Enable EBR
• Drop constraints
• Add columns, PK and VPD
Virtual Integrity Constraint Demo
• Add FK constraint
• Insert into child table with valid original PK column values
• succeeds
• Demo Spooky Join
• Attempt to INSERT with invalid original PK column values
• fails
Important Stuff!
• QC column can be added to any non-Seed table
• FK constraint need not be changed if no Seed table reference
• DO NOT ADD QC VIRTUAL COLUMN TO INDEX!
• Inherently non-deterministic value!
• Adding to index persists value
• No need to use new columns in DML
• DO NOT use EDITION_NAME (QC and parent PK columns) in DML
• VPD handles appropriate join
• For normal application runtime
• Create virtual column with SYS_CONTEXT
• Create new PK column with DEFAULT VALUE. (Double check this)
• Seed data patching process needs explicit control
Recap
• Demo’ed and explained basic technique
Life Is Never That Simple
• Distinguish between:
• Normal application code
• Code to manage Seed Data – requires explicit control of values
• Distinguish between:
• Release/upgrade – a new version of the application
• Typically requires new Seed Data
• Patch/fix
• No, or very few, changes to Seed Data
• EBR may have many editions of either type
• Need indirection for SYS_CONTEXT variables and EBR Edition values
• What if end user can update/add to Seed Data table?
More Things to Consider
• The technique described assumes a complete set of Seed Data for
ZDT EBR Rollover to a given release
• For new release, typically bulk copy/MERGE from prior release either:
• At start of release work
• Prior to rollover
• For a fix/patch requiring a only a small amount of Seed Data changes
and small downtime is acceptable
• Backward MERGE from pending release
Beyond Simple EBR – Context Variable
Management
• There may be many EBR editions
• DDL and PL/SQL changes form a single line inheritance structure
• Each EBR edition holds only “true” changes
• Not every new edition requires Seed Data changes
• Solution
• Create new set of SYS_CONTEXT variable, i.e.
• RUNTIME_EDITION holds EBR edition name for current application code release
• PATCHING_EDITION holds EBR edition name for the next release
• Create a mapping table between DEFAULT_EBR and SYS_CONTEXT variable values
• RUNTIME_EDITION <> EBR Default
• Consider not using edition names
• Morph edition name into “release” values
Sample Mapping Table
Application Code INSERT/UPDATE
• Can application code INSERT/UPDATE into Seed Data Table
• If Yes:
• INSERT/UPDATE should be controlled in application, not ad-hoc
INSERT/UPDATE
• Prior to rollover, MERGE from runtime edition into patch edition
• May need to handle sequence/identity column issues
• Potential conflict between new release values and application values
• Out of Scope
• Assumes a brief freeze of such INSERT/UPDATE before rollover
• Worst case requires AFTER INSERT/AFTER UPDATE triggers
Beyond EBR
• This technique is NOT dependent on EBR!!!
• QC, Spook Joins, Virtual Integrity Constraints
• A new technique for versioning multi-row, multi-table datasets
Beyond EBR, Quantum Columns, Spook Joins and Virtual Integrity for ZDT Data Versioning

More Related Content

What's hot

Database migrations with Flyway and Liquibase
Database migrations with Flyway and LiquibaseDatabase migrations with Flyway and Liquibase
Database migrations with Flyway and LiquibaseLars Östling
 
Don’t Get Caught with An Out of Support MS SQL Server…
Don’t Get Caught with An Out of Support MS SQL Server…Don’t Get Caught with An Out of Support MS SQL Server…
Don’t Get Caught with An Out of Support MS SQL Server…Hostway|HOSTING
 
Brightcove presentation on Automated Testing
Brightcove presentation on Automated TestingBrightcove presentation on Automated Testing
Brightcove presentation on Automated TestingMassTLC
 
Apex world 2018 continuously delivering APEX
Apex world 2018 continuously delivering APEXApex world 2018 continuously delivering APEX
Apex world 2018 continuously delivering APEXSergei Martens
 
Bringing DevOps to the Database
Bringing DevOps to the DatabaseBringing DevOps to the Database
Bringing DevOps to the DatabaseMichaela Murray
 
Mule tcat server - Server profiles
Mule tcat server - Server profilesMule tcat server - Server profiles
Mule tcat server - Server profilesShanky Gupta
 
Ansible Automation for Oracle RMAN / Apex Restores
Ansible Automation for Oracle RMAN / Apex RestoresAnsible Automation for Oracle RMAN / Apex Restores
Ansible Automation for Oracle RMAN / Apex RestoresAbhilash Kumar
 
ASP.NET Core Demos Part 2
ASP.NET Core Demos Part 2ASP.NET Core Demos Part 2
ASP.NET Core Demos Part 2Erik Noren
 
Database testing with JMeter
Database testing with JMeterDatabase testing with JMeter
Database testing with JMeterLoadium
 
Mule dataweave
Mule dataweaveMule dataweave
Mule dataweaveSon Nguyen
 
ASP.NET Core Demos
ASP.NET Core DemosASP.NET Core Demos
ASP.NET Core DemosErik Noren
 
Fix My Functions: TSQL User Defined Functions in SQL Server
Fix My Functions: TSQL User Defined Functions in SQL ServerFix My Functions: TSQL User Defined Functions in SQL Server
Fix My Functions: TSQL User Defined Functions in SQL ServerKendra Little
 
Continuous DB migration based on carbon5 framework
Continuous DB migration based on carbon5 frameworkContinuous DB migration based on carbon5 framework
Continuous DB migration based on carbon5 frameworkb0ris_1
 
Борис Трофимов. Continuous Database migration-это просто!
Борис Трофимов. Continuous Database migration-это просто!Борис Трофимов. Continuous Database migration-это просто!
Борис Трофимов. Continuous Database migration-это просто!Volha Banadyseva
 
KnowItPresentation
KnowItPresentationKnowItPresentation
KnowItPresentationChuan Su
 

What's hot (20)

Database migrations with Flyway and Liquibase
Database migrations with Flyway and LiquibaseDatabase migrations with Flyway and Liquibase
Database migrations with Flyway and Liquibase
 
Don’t Get Caught with An Out of Support MS SQL Server…
Don’t Get Caught with An Out of Support MS SQL Server…Don’t Get Caught with An Out of Support MS SQL Server…
Don’t Get Caught with An Out of Support MS SQL Server…
 
ESB Fundamentals 3.7
ESB Fundamentals 3.7ESB Fundamentals 3.7
ESB Fundamentals 3.7
 
Brightcove presentation on Automated Testing
Brightcove presentation on Automated TestingBrightcove presentation on Automated Testing
Brightcove presentation on Automated Testing
 
Flywaydb
FlywaydbFlywaydb
Flywaydb
 
Spring 5
Spring 5Spring 5
Spring 5
 
Apex world 2018 continuously delivering APEX
Apex world 2018 continuously delivering APEXApex world 2018 continuously delivering APEX
Apex world 2018 continuously delivering APEX
 
Bringing DevOps to the Database
Bringing DevOps to the DatabaseBringing DevOps to the Database
Bringing DevOps to the Database
 
Mule tcat server - Server profiles
Mule tcat server - Server profilesMule tcat server - Server profiles
Mule tcat server - Server profiles
 
Ansible Automation for Oracle RMAN / Apex Restores
Ansible Automation for Oracle RMAN / Apex RestoresAnsible Automation for Oracle RMAN / Apex Restores
Ansible Automation for Oracle RMAN / Apex Restores
 
ASP.NET Core Demos Part 2
ASP.NET Core Demos Part 2ASP.NET Core Demos Part 2
ASP.NET Core Demos Part 2
 
Database testing with JMeter
Database testing with JMeterDatabase testing with JMeter
Database testing with JMeter
 
Mule dataweave
Mule dataweaveMule dataweave
Mule dataweave
 
ASP.NET Core Demos
ASP.NET Core DemosASP.NET Core Demos
ASP.NET Core Demos
 
Fix My Functions: TSQL User Defined Functions in SQL Server
Fix My Functions: TSQL User Defined Functions in SQL ServerFix My Functions: TSQL User Defined Functions in SQL Server
Fix My Functions: TSQL User Defined Functions in SQL Server
 
Continuous DB migration based on carbon5 framework
Continuous DB migration based on carbon5 frameworkContinuous DB migration based on carbon5 framework
Continuous DB migration based on carbon5 framework
 
Борис Трофимов. Continuous Database migration-это просто!
Борис Трофимов. Continuous Database migration-это просто!Борис Трофимов. Continuous Database migration-это просто!
Борис Трофимов. Continuous Database migration-это просто!
 
Uniqueness of java
Uniqueness of javaUniqueness of java
Uniqueness of java
 
KnowItPresentation
KnowItPresentationKnowItPresentation
KnowItPresentation
 
Selenium
SeleniumSelenium
Selenium
 

Similar to Beyond EBR, Quantum Columns, Spook Joins and Virtual Integrity for ZDT Data Versioning

Exciting Features for SQL Devs in SQL 2012
Exciting Features for SQL Devs in SQL 2012Exciting Features for SQL Devs in SQL 2012
Exciting Features for SQL Devs in SQL 2012Brij Mishra
 
Evolutionary database design
Evolutionary database designEvolutionary database design
Evolutionary database designSalehein Syed
 
Rolta’s application testing services for handling ever changing environment.
Rolta’s application testing services for handling ever changing environment.   Rolta’s application testing services for handling ever changing environment.
Rolta’s application testing services for handling ever changing environment. Rolta
 
SQL Server 2008 For Developers
SQL Server 2008 For DevelopersSQL Server 2008 For Developers
SQL Server 2008 For DevelopersJohn Sterrett
 
Achieve the Impossible: Use INSTEAD OF triggers in SQL Server 2000 to Deal Tr...
Achieve the Impossible:Use INSTEAD OF triggers in SQL Server 2000 to Deal Tr...Achieve the Impossible:Use INSTEAD OF triggers in SQL Server 2000 to Deal Tr...
Achieve the Impossible: Use INSTEAD OF triggers in SQL Server 2000 to Deal Tr...Fernando G. Guerrero
 
Oracle applications r12.2, ebr, online patching means lot of work for devel...
Oracle applications r12.2, ebr, online patching   means lot of work for devel...Oracle applications r12.2, ebr, online patching   means lot of work for devel...
Oracle applications r12.2, ebr, online patching means lot of work for devel...Ajith Narayanan
 
Ten query tuning techniques every SQL Server programmer should know
Ten query tuning techniques every SQL Server programmer should knowTen query tuning techniques every SQL Server programmer should know
Ten query tuning techniques every SQL Server programmer should knowKevin Kline
 
Object Oriented Programming I
Object Oriented Programming IObject Oriented Programming I
Object Oriented Programming Iraven_rainagi
 
The future of DevOps: fully left-shifted deployments with version control and...
The future of DevOps: fully left-shifted deployments with version control and...The future of DevOps: fully left-shifted deployments with version control and...
The future of DevOps: fully left-shifted deployments with version control and...Red Gate Software
 
Webinar: Migrating from RDBMS to MongoDB
Webinar: Migrating from RDBMS to MongoDBWebinar: Migrating from RDBMS to MongoDB
Webinar: Migrating from RDBMS to MongoDBMongoDB
 
Pl sql best practices document
Pl sql best practices documentPl sql best practices document
Pl sql best practices documentAshwani Pandey
 
Entity Framework: Code First and Magic Unicorns
Entity Framework: Code First and Magic UnicornsEntity Framework: Code First and Magic Unicorns
Entity Framework: Code First and Magic UnicornsRichie Rump
 
dotNet Miami - June 21, 2012: Richie Rump: Entity Framework: Code First and M...
dotNet Miami - June 21, 2012: Richie Rump: Entity Framework: Code First and M...dotNet Miami - June 21, 2012: Richie Rump: Entity Framework: Code First and M...
dotNet Miami - June 21, 2012: Richie Rump: Entity Framework: Code First and M...dotNet Miami
 
Shshsjsjsjs-4 - Copdjsjjsjsjsjakakakaaky.pptx
Shshsjsjsjs-4 - Copdjsjjsjsjsjakakakaaky.pptxShshsjsjsjs-4 - Copdjsjjsjsjsjakakakaaky.pptx
Shshsjsjsjs-4 - Copdjsjjsjsjsjakakakaaky.pptx086ChintanPatel1
 
OUG Ireland Meet-up 12th January
OUG Ireland Meet-up 12th JanuaryOUG Ireland Meet-up 12th January
OUG Ireland Meet-up 12th JanuaryBrendan Tierney
 
Database Build and Release - SQL In The City - Ernest Hwang
Database Build and Release - SQL In The City - Ernest HwangDatabase Build and Release - SQL In The City - Ernest Hwang
Database Build and Release - SQL In The City - Ernest HwangRed Gate Software
 
Capture the Streams of Database Changes
Capture the Streams of Database ChangesCapture the Streams of Database Changes
Capture the Streams of Database Changesconfluent
 

Similar to Beyond EBR, Quantum Columns, Spook Joins and Virtual Integrity for ZDT Data Versioning (20)

Exciting Features for SQL Devs in SQL 2012
Exciting Features for SQL Devs in SQL 2012Exciting Features for SQL Devs in SQL 2012
Exciting Features for SQL Devs in SQL 2012
 
Evolutionary database design
Evolutionary database designEvolutionary database design
Evolutionary database design
 
Rolta’s application testing services for handling ever changing environment.
Rolta’s application testing services for handling ever changing environment.   Rolta’s application testing services for handling ever changing environment.
Rolta’s application testing services for handling ever changing environment.
 
SQL Server 2008 For Developers
SQL Server 2008 For DevelopersSQL Server 2008 For Developers
SQL Server 2008 For Developers
 
Achieve the Impossible: Use INSTEAD OF triggers in SQL Server 2000 to Deal Tr...
Achieve the Impossible:Use INSTEAD OF triggers in SQL Server 2000 to Deal Tr...Achieve the Impossible:Use INSTEAD OF triggers in SQL Server 2000 to Deal Tr...
Achieve the Impossible: Use INSTEAD OF triggers in SQL Server 2000 to Deal Tr...
 
Oracle applications r12.2, ebr, online patching means lot of work for devel...
Oracle applications r12.2, ebr, online patching   means lot of work for devel...Oracle applications r12.2, ebr, online patching   means lot of work for devel...
Oracle applications r12.2, ebr, online patching means lot of work for devel...
 
Ten query tuning techniques every SQL Server programmer should know
Ten query tuning techniques every SQL Server programmer should knowTen query tuning techniques every SQL Server programmer should know
Ten query tuning techniques every SQL Server programmer should know
 
Object Oriented Programming I
Object Oriented Programming IObject Oriented Programming I
Object Oriented Programming I
 
The future of DevOps: fully left-shifted deployments with version control and...
The future of DevOps: fully left-shifted deployments with version control and...The future of DevOps: fully left-shifted deployments with version control and...
The future of DevOps: fully left-shifted deployments with version control and...
 
What's new in SQL Server Integration Services 2012?
What's new in SQL Server Integration Services 2012?What's new in SQL Server Integration Services 2012?
What's new in SQL Server Integration Services 2012?
 
Webinar: Migrating from RDBMS to MongoDB
Webinar: Migrating from RDBMS to MongoDBWebinar: Migrating from RDBMS to MongoDB
Webinar: Migrating from RDBMS to MongoDB
 
Pl sql best practices document
Pl sql best practices documentPl sql best practices document
Pl sql best practices document
 
Entity Framework: Code First and Magic Unicorns
Entity Framework: Code First and Magic UnicornsEntity Framework: Code First and Magic Unicorns
Entity Framework: Code First and Magic Unicorns
 
dotNet Miami - June 21, 2012: Richie Rump: Entity Framework: Code First and M...
dotNet Miami - June 21, 2012: Richie Rump: Entity Framework: Code First and M...dotNet Miami - June 21, 2012: Richie Rump: Entity Framework: Code First and M...
dotNet Miami - June 21, 2012: Richie Rump: Entity Framework: Code First and M...
 
Ssn0020 ssis 2012 for beginners
Ssn0020   ssis 2012 for beginnersSsn0020   ssis 2012 for beginners
Ssn0020 ssis 2012 for beginners
 
Shshsjsjsjs-4 - Copdjsjjsjsjsjakakakaaky.pptx
Shshsjsjsjs-4 - Copdjsjjsjsjsjakakakaaky.pptxShshsjsjsjs-4 - Copdjsjjsjsjsjakakakaaky.pptx
Shshsjsjsjs-4 - Copdjsjjsjsjsjakakakaaky.pptx
 
ASP.NET vNext
ASP.NET vNextASP.NET vNext
ASP.NET vNext
 
OUG Ireland Meet-up 12th January
OUG Ireland Meet-up 12th JanuaryOUG Ireland Meet-up 12th January
OUG Ireland Meet-up 12th January
 
Database Build and Release - SQL In The City - Ernest Hwang
Database Build and Release - SQL In The City - Ernest HwangDatabase Build and Release - SQL In The City - Ernest Hwang
Database Build and Release - SQL In The City - Ernest Hwang
 
Capture the Streams of Database Changes
Capture the Streams of Database ChangesCapture the Streams of Database Changes
Capture the Streams of Database Changes
 

Recently uploaded

如何办理(UPenn毕业证书)宾夕法尼亚大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(UPenn毕业证书)宾夕法尼亚大学毕业证成绩单本科硕士学位证留信学历认证如何办理(UPenn毕业证书)宾夕法尼亚大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(UPenn毕业证书)宾夕法尼亚大学毕业证成绩单本科硕士学位证留信学历认证acoha1
 
Abortion Clinic in Kempton Park +27791653574 WhatsApp Abortion Clinic Service...
Abortion Clinic in Kempton Park +27791653574 WhatsApp Abortion Clinic Service...Abortion Clinic in Kempton Park +27791653574 WhatsApp Abortion Clinic Service...
Abortion Clinic in Kempton Park +27791653574 WhatsApp Abortion Clinic Service...mikehavy0
 
Bios of leading Astrologers & Researchers
Bios of leading Astrologers & ResearchersBios of leading Astrologers & Researchers
Bios of leading Astrologers & Researchersdarmandersingh4580
 
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...Klinik kandungan
 
DS Lecture-1 about discrete structure .ppt
DS Lecture-1 about discrete structure .pptDS Lecture-1 about discrete structure .ppt
DS Lecture-1 about discrete structure .pptTanveerAhmed817946
 
原件一样(UWO毕业证书)西安大略大学毕业证成绩单留信学历认证
原件一样(UWO毕业证书)西安大略大学毕业证成绩单留信学历认证原件一样(UWO毕业证书)西安大略大学毕业证成绩单留信学历认证
原件一样(UWO毕业证书)西安大略大学毕业证成绩单留信学历认证pwgnohujw
 
如何办理(UCLA毕业证书)加州大学洛杉矶分校毕业证成绩单学位证留信学历认证原件一样
如何办理(UCLA毕业证书)加州大学洛杉矶分校毕业证成绩单学位证留信学历认证原件一样如何办理(UCLA毕业证书)加州大学洛杉矶分校毕业证成绩单学位证留信学历认证原件一样
如何办理(UCLA毕业证书)加州大学洛杉矶分校毕业证成绩单学位证留信学历认证原件一样jk0tkvfv
 
Case Study 4 Where the cry of rebellion happen?
Case Study 4 Where the cry of rebellion happen?Case Study 4 Where the cry of rebellion happen?
Case Study 4 Where the cry of rebellion happen?RemarkSemacio
 
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24  Building Real-Time Pipelines With FLaNKDATA SUMMIT 24  Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNKTimothy Spann
 
Seven tools of quality control.slideshare
Seven tools of quality control.slideshareSeven tools of quality control.slideshare
Seven tools of quality control.slideshareraiaryan448
 
SCI8-Q4-MOD11.pdfwrwujrrjfaajerjrajrrarj
SCI8-Q4-MOD11.pdfwrwujrrjfaajerjrajrrarjSCI8-Q4-MOD11.pdfwrwujrrjfaajerjrajrrarj
SCI8-Q4-MOD11.pdfwrwujrrjfaajerjrajrrarjadimosmejiaslendon
 
obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...
obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...
obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...yulianti213969
 
Simplify hybrid data integration at an enterprise scale. Integrate all your d...
Simplify hybrid data integration at an enterprise scale. Integrate all your d...Simplify hybrid data integration at an enterprise scale. Integrate all your d...
Simplify hybrid data integration at an enterprise scale. Integrate all your d...varanasisatyanvesh
 
Digital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham WareDigital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham WareGraham Ware
 
如何办理澳洲拉筹伯大学毕业证(LaTrobe毕业证书)成绩单原件一模一样
如何办理澳洲拉筹伯大学毕业证(LaTrobe毕业证书)成绩单原件一模一样如何办理澳洲拉筹伯大学毕业证(LaTrobe毕业证书)成绩单原件一模一样
如何办理澳洲拉筹伯大学毕业证(LaTrobe毕业证书)成绩单原件一模一样wsppdmt
 
Displacement, Velocity, Acceleration, and Second Derivatives
Displacement, Velocity, Acceleration, and Second DerivativesDisplacement, Velocity, Acceleration, and Second Derivatives
Displacement, Velocity, Acceleration, and Second Derivatives23050636
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteedamy56318795
 
Pentesting_AI and security challenges of AI
Pentesting_AI and security challenges of AIPentesting_AI and security challenges of AI
Pentesting_AI and security challenges of AIf6x4zqzk86
 

Recently uploaded (20)

如何办理(UPenn毕业证书)宾夕法尼亚大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(UPenn毕业证书)宾夕法尼亚大学毕业证成绩单本科硕士学位证留信学历认证如何办理(UPenn毕业证书)宾夕法尼亚大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(UPenn毕业证书)宾夕法尼亚大学毕业证成绩单本科硕士学位证留信学历认证
 
Abortion Clinic in Kempton Park +27791653574 WhatsApp Abortion Clinic Service...
Abortion Clinic in Kempton Park +27791653574 WhatsApp Abortion Clinic Service...Abortion Clinic in Kempton Park +27791653574 WhatsApp Abortion Clinic Service...
Abortion Clinic in Kempton Park +27791653574 WhatsApp Abortion Clinic Service...
 
Bios of leading Astrologers & Researchers
Bios of leading Astrologers & ResearchersBios of leading Astrologers & Researchers
Bios of leading Astrologers & Researchers
 
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get CytotecAbortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get Cytotec
 
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
 
Abortion pills in Riyadh Saudi Arabia| +966572737505 | Get Cytotec, Unwanted Kit
Abortion pills in Riyadh Saudi Arabia| +966572737505 | Get Cytotec, Unwanted KitAbortion pills in Riyadh Saudi Arabia| +966572737505 | Get Cytotec, Unwanted Kit
Abortion pills in Riyadh Saudi Arabia| +966572737505 | Get Cytotec, Unwanted Kit
 
DS Lecture-1 about discrete structure .ppt
DS Lecture-1 about discrete structure .pptDS Lecture-1 about discrete structure .ppt
DS Lecture-1 about discrete structure .ppt
 
原件一样(UWO毕业证书)西安大略大学毕业证成绩单留信学历认证
原件一样(UWO毕业证书)西安大略大学毕业证成绩单留信学历认证原件一样(UWO毕业证书)西安大略大学毕业证成绩单留信学历认证
原件一样(UWO毕业证书)西安大略大学毕业证成绩单留信学历认证
 
如何办理(UCLA毕业证书)加州大学洛杉矶分校毕业证成绩单学位证留信学历认证原件一样
如何办理(UCLA毕业证书)加州大学洛杉矶分校毕业证成绩单学位证留信学历认证原件一样如何办理(UCLA毕业证书)加州大学洛杉矶分校毕业证成绩单学位证留信学历认证原件一样
如何办理(UCLA毕业证书)加州大学洛杉矶分校毕业证成绩单学位证留信学历认证原件一样
 
Case Study 4 Where the cry of rebellion happen?
Case Study 4 Where the cry of rebellion happen?Case Study 4 Where the cry of rebellion happen?
Case Study 4 Where the cry of rebellion happen?
 
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24  Building Real-Time Pipelines With FLaNKDATA SUMMIT 24  Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
 
Seven tools of quality control.slideshare
Seven tools of quality control.slideshareSeven tools of quality control.slideshare
Seven tools of quality control.slideshare
 
SCI8-Q4-MOD11.pdfwrwujrrjfaajerjrajrrarj
SCI8-Q4-MOD11.pdfwrwujrrjfaajerjrajrrarjSCI8-Q4-MOD11.pdfwrwujrrjfaajerjrajrrarj
SCI8-Q4-MOD11.pdfwrwujrrjfaajerjrajrrarj
 
obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...
obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...
obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...
 
Simplify hybrid data integration at an enterprise scale. Integrate all your d...
Simplify hybrid data integration at an enterprise scale. Integrate all your d...Simplify hybrid data integration at an enterprise scale. Integrate all your d...
Simplify hybrid data integration at an enterprise scale. Integrate all your d...
 
Digital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham WareDigital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham Ware
 
如何办理澳洲拉筹伯大学毕业证(LaTrobe毕业证书)成绩单原件一模一样
如何办理澳洲拉筹伯大学毕业证(LaTrobe毕业证书)成绩单原件一模一样如何办理澳洲拉筹伯大学毕业证(LaTrobe毕业证书)成绩单原件一模一样
如何办理澳洲拉筹伯大学毕业证(LaTrobe毕业证书)成绩单原件一模一样
 
Displacement, Velocity, Acceleration, and Second Derivatives
Displacement, Velocity, Acceleration, and Second DerivativesDisplacement, Velocity, Acceleration, and Second Derivatives
Displacement, Velocity, Acceleration, and Second Derivatives
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
 
Pentesting_AI and security challenges of AI
Pentesting_AI and security challenges of AIPentesting_AI and security challenges of AI
Pentesting_AI and security challenges of AI
 

Beyond EBR, Quantum Columns, Spook Joins and Virtual Integrity for ZDT Data Versioning

  • 1. Beyond EBR (Draft) Quantum Columns, Spooky Joins and Virtual Integrity for ZDT Data Versioning Jeff Jacobs, Consulting Data Architect Jeffrey Jacobs & Associates
  • 3. The Problem • Complex Application • 1,000s of Tables and Views • Referential integrity constraints require enforcement • Application code in PL/SQL, Java, etc. • New releases/upgrades/patches require significant downtime
  • 4. Partial Solution - Edition Based Redefinition (EBR) • Migrate to Edition Based Redefinition EBR for Zero Down Time (ZDT) release • Stage and test new release in same infrastructure independent of current release
  • 5. EBR Features • EBR manages editions of an application for: • PL/SQL changes • DDL changes • EBR’s edition triggers provide the ability to synch data between editions for changes to DDL • Edition to be used by code governed by SYS_CONTEXT variable • Very transparent to existing code • Each edition has an EDITION_NAME
  • 6. What is Seed Data? • Seed Data tables are (usually) reference only tables • May be parent to multiple Non-Seed Data tables • “Seed Data” tables contain data that is added/updated for a new release • Data needs to be “versioned” for each release • Data is not synched across releases • Data changes not due to changes in DDL • New, coordinated version of data for multiple tables for new edition • Examples • Field labels for application screen • Text • Font • Color • Size • Demo/sample data • Etc.
  • 7. Solution Goals • EBR does not provide support for managing Seed Data • But we want independent Seed Data for each edition • Minimal or no changes to existing DML • Minimal or no changes to existing code • Minimal or no affect on performance • Avoid creation of new DB objects, i.e. VIEWS, synonyms, etc. • Minimize rework • Preserve referential integrity enforcement
  • 9. SYS_CONTEXT Variables • What are they? • How to create? • <code sample> • How to use? • <code sample>
  • 10. Quantum Column Physics POP Quiz! (Schrodinger’s Cat + Quantum Superposition) • Can a given row’s virtual column have multiple values at the same instant in time with no in-flight transactions? • Yes • Call this a “Quantum Column” (QC) • How? • Virtual column is based on a SYS_CONTEXT variable • Value of QC is determined by value of SYS_CONTEXT variables • Can this be used to solve our Seed Data problem? • TBD!
  • 11. Never Include a Quantum Column in an Index • QCs are inherently non-deterministic • Value is based on session’s value of SYS_CONTEXT variable at time of query • Virtual column value is determined at runtime • Indexes are deterministic: • A virtual column’s value is persisted in the index with the value at the time of INSERT/UPDATE
  • 12. “Bollocks” – Bryn Lewellyn • Starting simple, focus on normal runtime behavior • Seed data patching issues later • How it’s done! • Add a Quantum Column to child table based on EBR SYS_CONTEXT variable • We’ll name the Quantum Column “EDITION_NAME_QC” • Drop the FK constraint(s) • Add a non-virtual version column to parent/Seed table • Holds the value of EBR editions • We’ll name this “EDITION_NAME • Drop PK constraint • Recreate PK constraint with prior columns plus new version column • Add Virtual Private Database expression to parent/Seed table to use appropriate EBR edition value • Normal runtime code uses above EBR SYS_CONTEXT variable value • Recreate FK • NO CHANGES TO EXISTING DML! Demos • Query to show original query works without new columns in join • Add new release to Seed Data with updated/new info • Show same query works in both editions returning appropriate data • Show referential integrity works
  • 13. Part 1 – QCs and Foreign Key Constraints • FK columns may be based on a virtual column • Virtual column may be based on SYS_CONTEXT variable value • Such as EBR’s <need name> • QC is a virtual column • But what about the parent table’s primary key?
  • 14. Part 2 – Modify Seed Table Primary Key • Add new column, “EDITION NAME” to PK • DEFAULT value of EBR_EDITION • PK now consists of original PK, i.e. “FIELD_NAME” • Patching code explicitly manages value of EDITION_NAME • Application code INSERT addressed later
  • 15. New Data Model Diagram
  • 16. VPD Example (Spooky Join) • VPD provides the additional join column between the Seed Data table and the child table • “Spooky” join
  • 17. Spooky Join Demo • Create and populate tables with 1 release of data • Run Query • Enable EBR • Drop constraints • Add columns, PK and VPD
  • 18. Virtual Integrity Constraint Demo • Add FK constraint • Insert into child table with valid original PK column values • succeeds • Demo Spooky Join • Attempt to INSERT with invalid original PK column values • fails
  • 19. Important Stuff! • QC column can be added to any non-Seed table • FK constraint need not be changed if no Seed table reference • DO NOT ADD QC VIRTUAL COLUMN TO INDEX! • Inherently non-deterministic value! • Adding to index persists value • No need to use new columns in DML • DO NOT use EDITION_NAME (QC and parent PK columns) in DML • VPD handles appropriate join • For normal application runtime • Create virtual column with SYS_CONTEXT • Create new PK column with DEFAULT VALUE. (Double check this) • Seed data patching process needs explicit control
  • 20. Recap • Demo’ed and explained basic technique
  • 21. Life Is Never That Simple • Distinguish between: • Normal application code • Code to manage Seed Data – requires explicit control of values • Distinguish between: • Release/upgrade – a new version of the application • Typically requires new Seed Data • Patch/fix • No, or very few, changes to Seed Data • EBR may have many editions of either type • Need indirection for SYS_CONTEXT variables and EBR Edition values • What if end user can update/add to Seed Data table?
  • 22. More Things to Consider • The technique described assumes a complete set of Seed Data for ZDT EBR Rollover to a given release • For new release, typically bulk copy/MERGE from prior release either: • At start of release work • Prior to rollover • For a fix/patch requiring a only a small amount of Seed Data changes and small downtime is acceptable • Backward MERGE from pending release
  • 23. Beyond Simple EBR – Context Variable Management • There may be many EBR editions • DDL and PL/SQL changes form a single line inheritance structure • Each EBR edition holds only “true” changes • Not every new edition requires Seed Data changes • Solution • Create new set of SYS_CONTEXT variable, i.e. • RUNTIME_EDITION holds EBR edition name for current application code release • PATCHING_EDITION holds EBR edition name for the next release • Create a mapping table between DEFAULT_EBR and SYS_CONTEXT variable values • RUNTIME_EDITION <> EBR Default • Consider not using edition names • Morph edition name into “release” values
  • 25. Application Code INSERT/UPDATE • Can application code INSERT/UPDATE into Seed Data Table • If Yes: • INSERT/UPDATE should be controlled in application, not ad-hoc INSERT/UPDATE • Prior to rollover, MERGE from runtime edition into patch edition • May need to handle sequence/identity column issues • Potential conflict between new release values and application values • Out of Scope • Assumes a brief freeze of such INSERT/UPDATE before rollover • Worst case requires AFTER INSERT/AFTER UPDATE triggers
  • 26. Beyond EBR • This technique is NOT dependent on EBR!!! • QC, Spook Joins, Virtual Integrity Constraints • A new technique for versioning multi-row, multi-table datasets