SlideShare a Scribd company logo
Tales from a Parallel Universe:Using 11gR2’s Edition Based Redefinitions (in APEX)Roel Hartman
EBR and APEX?Sorry, you can’t do it...Questions?John’s suggestion....
Who am I?Oracle since v5, Forms 2.3, Case*Designer etc
Presenter at UKOUG (3x), OOW (3x), ODTUG (2x)roelhartman.blogspot.comNo. 3
Tom Kytesays:
Tales from a Parallel Universe: Using Oracle 11gR2's Edition Based Redefinition in combination with APEX
Tales from a Parallel Universe: Using Oracle 11gR2's Edition Based Redefinition in combination with APEX
Tales from a Parallel Universe: Using Oracle 11gR2's Edition Based Redefinition in combination with APEX
Tales from a Parallel Universe: Using Oracle 11gR2's Edition Based Redefinition in combination with APEX
Tales from a Parallel Universe: Using Oracle 11gR2's Edition Based Redefinition in combination with APEX
Unplanned DowntimePhysical Standby DatabaseLogical Standby DatabaseRACThe Case
Unplanned Downtime
Planned DowntimeDatabase UpgradeStreamsRolling Upgrade using Logical Standby DatabaseApplication MaintenanceOnline Index RebuildOnline Table RedefinitionThe Case
Planned Downtime
Planned Downtime Application UpgradeCreate objectsReplace objectsDrop objectsRecompilationThe Case
Tales from a Parallel Universe: Using Oracle 11gR2's Edition Based Redefinition in combination with APEX
Keep the Shop openPrepare new Release Cut overRandallVersion 22Boo1Version 1Sulley1+ 2
EditionSchemaObject TypeObject NameSession runs in the context of an EditionParallel Universes
SQL>ALTER USER HR ENABLE EDITIONS;USER ALTERED.SQL> ALTER USER HR DISABLE EDITIONS;ALTER USER HR DISABLE EDITIONS              *ERROR at line 1:ORA-00922: missing or invalid optionSQL>
SQL> select * from all_editions;EDITION_NAME PARENT_EDITION_NAME USA------------ ------------------- ---ORA$BASE                         YESSQL>
SQL> CREATE EDITION HR_RELEASE2 AS CHILD OF ORA$BASE;Edition created.SQL> CREATE EDITION OE_RELEASE2 AS CHILD OF ORA$BASE;CREATE EDITION OE_RELEASE2 AS CHILD OF ORA$BASE;*ERROR at line 1:ORA-38807: Implementation restriction: an edition can have only one child
ORA$BASEHROEHR_RELEASE2HR’OE_RELEASE2OE’One Child – One Parent
EditionablePL/SQL ObjectsPackagesProceduresFunctionsTriggersViewsSynonymsTypesNot everything is editionable...Not EditionableTablesMaterialized ViewsDB Links
Table XTable YORA$BASEPL/SQL (A)PL/SQL (B)HR_RELEASE2PL/SQL (A)PL/SQL (B)PL/SQL (B’)
“Instead-of-table”Only one table in the from clauseNo expressions, only columnsCan have “regular” table triggersSame execution planEditioning Views are the new tablesEditioning Views are Editionable....Editioning View
Tales from a Parallel Universe: Using Oracle 11gR2's Edition Based Redefinition in combination with APEX
Editioning ViewData is the sameView is differentDepends on your position / edition
Table X_tTable Y_tORA$BASEEditioning View XEditioning View YPL/SQL (A)PL/SQL (B)HR_RELEASE2Editioning View Y’PL/SQL (A)PL/SQL (B)PL/SQL (B’)
Old situation : One column NAMENew situation : FIRST_NAME / LAST_NAMECross Edition TriggersForwardReverseOnly on a TableEditionableIn the newedition!How to handle Table changes?
Cross Edition TriggersNAMEFIRST_NAMELAST_NAME“split”“concat”RELEASE 2ORA$BASERELEASE 3ForwardCrossEditionTriggerReverseCrossEditionTriggerSession ASession BSession C
Chain of forward / reverse Xedition triggers in decendent / ancestor editionsForward Xedition DML fires Forward Xedition triggers only (not regular triggers)The same for Reverse Xedition DMLXedition DML fires only other Xedition trigger (in same edition) if there is an ordering (follows xxx clause)Advanced principles
Forward Xedition isn’t fired in own editionFill FIRST_NAME / LAST_NAME from NAMEFire the Xedition trigger onlyUse dbms_utility.wait_on_pending_dml() to prevent “lost updates”Use applying_crossedition_trigger function to prevent “collision”Use IGNORE_ROW_ON_DUPKEY_INDEX / CHANGE_DUPKEY_ERROR_INDEX hint (mandate!) to prevent collisionApply changes - 1DBMS_Sql.Parse(c => The_Cursor,Language_Flag => DBMS_Sql.Native,Statement => 'update emp set empno = empno',Apply_Crossedition_Trigger => 'Fwd_Xed');
Apply changes - 2CREATE OR REPLACE TRIGGER trigger1 BEFORE INSERT OR UPDATE ON table1  FOR EACH ROW CROSSEDITIONDECLARErow_already_present EXCEPTION;  PRAGMA EXCEPTION_INIT(row_already_present, -38911);BEGIN  IF APPLYING_CROSSEDITION_TRIGGER THEN    /* Trigger is running because of serendipitous change.       Insert new row into table2 unless it is already there. */    INSERT /*+ IGNORE_ROW_ON_DUPKEY_INDEX(table2(key)) */    INTO table2    VALUES(:new.key, :new.value, to_date('1900-01-01', 'YYYY-MM-DD'));  ELSE    /* Trigger is running because you are applying transform.       If tranform has not yet inserted new row in table2, insert new row;       otherwise, update new row. */    BEGIN      INSERT /*+ CHANGE_DUPKEY_ERROR_INDEX(table2(key)) */      INTO table2      VALUES(:new.key, :new.value, SYSTIMESTAMP);    EXCEPTION WHEN row_already_present      THEN        UPDATE table2        SET value = :new.value, last_updated = SYSTIMESTAMP        WHERE key = :new.key;    END;  END IF;END;
Rename your TablesCreate Editioning ViewsReroute PrivilegesRecreate TriggersRecompile all PL/SQLApply VPD PoliciesPrepare your ApplicationYour last Planned Downtime
Prepare your Application1Renameyour tables2Createeditioning views3Reroute privilegesYour last Planned Downtime4Recreatetriggers5Recompile PL/SQL6ApplyVPD policies
grant use on edition to <user>alter database default edition=<x>alter session set edition=<x>dbms_session.set_edition_deferred( <x> )sys.dbms_sys_sql.parse (_as_user)sys_contextSQL*Plus : show editionOpening up an Edition
SQL>GRANT USE ON EDITION HR_RELEASE2 TO SCOTT;Grant succeeded.SQL> CONNECT SCOTT/TIGERConnected.SQL> select sys_context('userenv', 'current_edition_name') current_edition_name from dual; CURRENT_EDITION_NAME--------------------ORA$BASE
SQL>ALTER SESSION SET EDITION=HR_RELEASE2;Session altered.SQL> select sys_context('userenv', 'current_edition_name') current_edition_name from dual; CURRENT_EDITION_NAME--------------------HR_RELEASE2
Rolling back an upgradeRetiring an EditionOnly the root or a leafNo objects are inherited (anymore)Not currently in useNot the DB default editionRecompile objects (reuse settings)Dropping an Edition
*_EDITIONS*_EDITION_COMMENTS*_VIEWS_AE*_SOURCE_AE*_OBJECTS_AE*_ERRORS_AE*_EDITIONING_VIEWS_AE*_EDITIONING_VIEW_COLS_AEDBMS_EDITIONS_UTILITIES.SET_EDITIONING_VIEWS_READ_ONLYDBMS_SESSION.SET_EDITION_DEFERRED( <EDITION_NAME> )New Database Stuff
EBR and APEX - 1ALTER SESSION SET EDITION
DBMS_SESSION.SET_EDITION_DEFERRED
Session Poolingdbms_epg.set_dad_attribute('APEX', 'database-edition', 'HR_RELEASE2');in dads.conf : PlsqlDatabaseEdition*apex_util.set_editionsets CURRENT_EDITIONEBR and APEX - 2Syntax error on line 48 of /home/oracle/OraHome_1/Apache/modplsql/conf/dads.conf:Invalid command 'PlsqlDatabaseEdition', perhaps mis-spelled or defined by a module not included in the server
Build on – views on - Editioning ViewsFour (!) -tier architectureEdition your Views or PL/SQL FunctionsUse Authorization SchemesEBR and APEX - 3UI / APEX(Regular) ViewEditioning ViewTable

More Related Content

PPTX
Edition Based Redefinition
PPTX
Edition Based Redefinition - Continuous Database Application Evolution with O...
PPTX
Introducing and Demonstrating Oracle Database 11gR2's Killer Feature – Editio...
PPT
R12 d49656 gc10-apps dba 26
PPT
R12 d49656 gc10-apps dba 23
PPT
R12 d49656 gc10-apps dba 12
PPT
R12 d49656 gc10-apps dba 27
PPT
R12 d49656 gc10-apps dba 10
Edition Based Redefinition
Edition Based Redefinition - Continuous Database Application Evolution with O...
Introducing and Demonstrating Oracle Database 11gR2's Killer Feature – Editio...
R12 d49656 gc10-apps dba 26
R12 d49656 gc10-apps dba 23
R12 d49656 gc10-apps dba 12
R12 d49656 gc10-apps dba 27
R12 d49656 gc10-apps dba 10

What's hot (20)

PPT
R12 d49656 gc10-apps dba 13
PPT
R12 d49656 gc10-apps dba 18
PPT
Phoenix h basemeetup
PDF
DB2 LUW - Backup and Recovery
PPT
Les 18 space
DOC
DB2 utilities
PPTX
Optimizing Your Cloud Applications in RightScale
PPTX
R12.2 dba
PDF
Online Statistics Gathering for ETL
PPT
R12 d49656 gc10-apps dba 08
PDF
SAP HANA System Replication - Setup, Operations and HANA Monitoring
DOCX
PPTX
Mule for each scope header collection
PPT
PPTX
Oracle11g R2 - Edition Based Redefinition for On Line Application Upgrade
PDF
[Altibase] 11 replication part4 (conflict resolution)
PPTX
Spring Cloud Config
PPT
Sql tuning guideline
PDF
Fig 9-03
PPTX
Useful PL/SQL Supplied Packages
R12 d49656 gc10-apps dba 13
R12 d49656 gc10-apps dba 18
Phoenix h basemeetup
DB2 LUW - Backup and Recovery
Les 18 space
DB2 utilities
Optimizing Your Cloud Applications in RightScale
R12.2 dba
Online Statistics Gathering for ETL
R12 d49656 gc10-apps dba 08
SAP HANA System Replication - Setup, Operations and HANA Monitoring
Mule for each scope header collection
Oracle11g R2 - Edition Based Redefinition for On Line Application Upgrade
[Altibase] 11 replication part4 (conflict resolution)
Spring Cloud Config
Sql tuning guideline
Fig 9-03
Useful PL/SQL Supplied Packages
Ad

Similar to Tales from a Parallel Universe: Using Oracle 11gR2's Edition Based Redefinition in combination with APEX (20)

PDF
EDITION & TARGET EDITION & Edition-Based Redefinition (EBR) in Oracle
PDF
Basic - Oracle Edition Based Redefinition Presentation
 
PDF
King_EditionBasedRedefinition_oracle12c.pdf
PPTX
Developer's Approach to Code Management
PDF
Editioning use in ebs
PDF
Editioning use in ebs
PDF
Presentation online application upgrade of oracle's bug db with edition-ba...
PPTX
Oracle 11g new features for developers
PDF
How to upgrade your application with no downtime (using edition-based redefin...
PPT
Oracle_PLSQL.ppt ..
PPT
Oracle_PLSQL (1).ppt .
TXT
Oracle 9i notes([email protected])
PPTX
Edition based redefinition joords
DOCX
Java full stack1
DOCX
Oracle 11g developer on linux training in bangalore
DOCX
Oracle 11g developer on linux training in bangalore
PPTX
Edition based redefinition joords
PPTX
Perth APAC Groundbreakers tour - 18c features
PPTX
12 Things About 12c Release 2 for Developers
PPTX
OpenWorld 2018 - Common Application Developer Disasters
EDITION & TARGET EDITION & Edition-Based Redefinition (EBR) in Oracle
Basic - Oracle Edition Based Redefinition Presentation
 
King_EditionBasedRedefinition_oracle12c.pdf
Developer's Approach to Code Management
Editioning use in ebs
Editioning use in ebs
Presentation online application upgrade of oracle's bug db with edition-ba...
Oracle 11g new features for developers
How to upgrade your application with no downtime (using edition-based redefin...
Oracle_PLSQL.ppt ..
Oracle_PLSQL (1).ppt .
Oracle 9i notes([email protected])
Edition based redefinition joords
Java full stack1
Oracle 11g developer on linux training in bangalore
Oracle 11g developer on linux training in bangalore
Edition based redefinition joords
Perth APAC Groundbreakers tour - 18c features
12 Things About 12c Release 2 for Developers
OpenWorld 2018 - Common Application Developer Disasters
Ad

More from Roel Hartman (20)

PDF
Wizard of ORDS
PDF
APEX Bad Practices
PDF
Tweaking the interactive grid
PDF
Docker for Dummies
PDF
A deep dive into APEX JET charts
PDF
My Top 5 APEX JavaScript API's
PDF
Mastering universal theme
PDF
APEX Developers : Do More With LESS !
PDF
Ten Tiny Things To Try Today - Hidden APEX5 Gems Revealed
PDF
Best of both worlds: Create hybrid mobile applications with Oracle Applicatio...
PDF
APEX printing with BI Publisher
PDF
Troubleshooting APEX Performance Issues
PDF
Automated testing APEX Applications
PDF
5 Cool Things you can do with HTML5 and APEX
PDF
Striving for Perfection: The Ultimate APEX Application Architecture
PDF
XFILES, the APEX 4 version - The truth is in there
PDF
Done in 60 seconds - Creating Web 2.0 applications made easy
PPTX
Creating sub zero dashboard plugin for apex with google
PPTX
Integration of APEX and Oracle Forms
PPT
Developing A Real World Logistic Application With Oracle Application - UKOUG ...
Wizard of ORDS
APEX Bad Practices
Tweaking the interactive grid
Docker for Dummies
A deep dive into APEX JET charts
My Top 5 APEX JavaScript API's
Mastering universal theme
APEX Developers : Do More With LESS !
Ten Tiny Things To Try Today - Hidden APEX5 Gems Revealed
Best of both worlds: Create hybrid mobile applications with Oracle Applicatio...
APEX printing with BI Publisher
Troubleshooting APEX Performance Issues
Automated testing APEX Applications
5 Cool Things you can do with HTML5 and APEX
Striving for Perfection: The Ultimate APEX Application Architecture
XFILES, the APEX 4 version - The truth is in there
Done in 60 seconds - Creating Web 2.0 applications made easy
Creating sub zero dashboard plugin for apex with google
Integration of APEX and Oracle Forms
Developing A Real World Logistic Application With Oracle Application - UKOUG ...

Recently uploaded (20)

PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Empathic Computing: Creating Shared Understanding
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Dropbox Q2 2025 Financial Results & Investor Presentation
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Network Security Unit 5.pdf for BCA BBA.
Understanding_Digital_Forensics_Presentation.pptx
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
MIND Revenue Release Quarter 2 2025 Press Release
Unlocking AI with Model Context Protocol (MCP)
Chapter 3 Spatial Domain Image Processing.pdf
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Per capita expenditure prediction using model stacking based on satellite ima...
Empathic Computing: Creating Shared Understanding
Mobile App Security Testing_ A Comprehensive Guide.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Advanced methodologies resolving dimensionality complications for autism neur...
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx

Tales from a Parallel Universe: Using Oracle 11gR2's Edition Based Redefinition in combination with APEX

  • 1. Tales from a Parallel Universe:Using 11gR2’s Edition Based Redefinitions (in APEX)Roel Hartman
  • 2. EBR and APEX?Sorry, you can’t do it...Questions?John’s suggestion....
  • 3. Who am I?Oracle since v5, Forms 2.3, Case*Designer etc
  • 4. Presenter at UKOUG (3x), OOW (3x), ODTUG (2x)roelhartman.blogspot.comNo. 3
  • 11. Unplanned DowntimePhysical Standby DatabaseLogical Standby DatabaseRACThe Case
  • 13. Planned DowntimeDatabase UpgradeStreamsRolling Upgrade using Logical Standby DatabaseApplication MaintenanceOnline Index RebuildOnline Table RedefinitionThe Case
  • 15. Planned Downtime Application UpgradeCreate objectsReplace objectsDrop objectsRecompilationThe Case
  • 17. Keep the Shop openPrepare new Release Cut overRandallVersion 22Boo1Version 1Sulley1+ 2
  • 18. EditionSchemaObject TypeObject NameSession runs in the context of an EditionParallel Universes
  • 19. SQL>ALTER USER HR ENABLE EDITIONS;USER ALTERED.SQL> ALTER USER HR DISABLE EDITIONS;ALTER USER HR DISABLE EDITIONS *ERROR at line 1:ORA-00922: missing or invalid optionSQL>
  • 20. SQL> select * from all_editions;EDITION_NAME PARENT_EDITION_NAME USA------------ ------------------- ---ORA$BASE YESSQL>
  • 21. SQL> CREATE EDITION HR_RELEASE2 AS CHILD OF ORA$BASE;Edition created.SQL> CREATE EDITION OE_RELEASE2 AS CHILD OF ORA$BASE;CREATE EDITION OE_RELEASE2 AS CHILD OF ORA$BASE;*ERROR at line 1:ORA-38807: Implementation restriction: an edition can have only one child
  • 23. EditionablePL/SQL ObjectsPackagesProceduresFunctionsTriggersViewsSynonymsTypesNot everything is editionable...Not EditionableTablesMaterialized ViewsDB Links
  • 24. Table XTable YORA$BASEPL/SQL (A)PL/SQL (B)HR_RELEASE2PL/SQL (A)PL/SQL (B)PL/SQL (B’)
  • 25. “Instead-of-table”Only one table in the from clauseNo expressions, only columnsCan have “regular” table triggersSame execution planEditioning Views are the new tablesEditioning Views are Editionable....Editioning View
  • 27. Editioning ViewData is the sameView is differentDepends on your position / edition
  • 28. Table X_tTable Y_tORA$BASEEditioning View XEditioning View YPL/SQL (A)PL/SQL (B)HR_RELEASE2Editioning View Y’PL/SQL (A)PL/SQL (B)PL/SQL (B’)
  • 29. Old situation : One column NAMENew situation : FIRST_NAME / LAST_NAMECross Edition TriggersForwardReverseOnly on a TableEditionableIn the newedition!How to handle Table changes?
  • 30. Cross Edition TriggersNAMEFIRST_NAMELAST_NAME“split”“concat”RELEASE 2ORA$BASERELEASE 3ForwardCrossEditionTriggerReverseCrossEditionTriggerSession ASession BSession C
  • 31. Chain of forward / reverse Xedition triggers in decendent / ancestor editionsForward Xedition DML fires Forward Xedition triggers only (not regular triggers)The same for Reverse Xedition DMLXedition DML fires only other Xedition trigger (in same edition) if there is an ordering (follows xxx clause)Advanced principles
  • 32. Forward Xedition isn’t fired in own editionFill FIRST_NAME / LAST_NAME from NAMEFire the Xedition trigger onlyUse dbms_utility.wait_on_pending_dml() to prevent “lost updates”Use applying_crossedition_trigger function to prevent “collision”Use IGNORE_ROW_ON_DUPKEY_INDEX / CHANGE_DUPKEY_ERROR_INDEX hint (mandate!) to prevent collisionApply changes - 1DBMS_Sql.Parse(c => The_Cursor,Language_Flag => DBMS_Sql.Native,Statement => 'update emp set empno = empno',Apply_Crossedition_Trigger => 'Fwd_Xed');
  • 33. Apply changes - 2CREATE OR REPLACE TRIGGER trigger1 BEFORE INSERT OR UPDATE ON table1 FOR EACH ROW CROSSEDITIONDECLARErow_already_present EXCEPTION; PRAGMA EXCEPTION_INIT(row_already_present, -38911);BEGIN IF APPLYING_CROSSEDITION_TRIGGER THEN /* Trigger is running because of serendipitous change. Insert new row into table2 unless it is already there. */ INSERT /*+ IGNORE_ROW_ON_DUPKEY_INDEX(table2(key)) */ INTO table2 VALUES(:new.key, :new.value, to_date('1900-01-01', 'YYYY-MM-DD')); ELSE /* Trigger is running because you are applying transform. If tranform has not yet inserted new row in table2, insert new row; otherwise, update new row. */ BEGIN INSERT /*+ CHANGE_DUPKEY_ERROR_INDEX(table2(key)) */ INTO table2 VALUES(:new.key, :new.value, SYSTIMESTAMP); EXCEPTION WHEN row_already_present THEN UPDATE table2 SET value = :new.value, last_updated = SYSTIMESTAMP WHERE key = :new.key; END; END IF;END;
  • 34. Rename your TablesCreate Editioning ViewsReroute PrivilegesRecreate TriggersRecompile all PL/SQLApply VPD PoliciesPrepare your ApplicationYour last Planned Downtime
  • 35. Prepare your Application1Renameyour tables2Createeditioning views3Reroute privilegesYour last Planned Downtime4Recreatetriggers5Recompile PL/SQL6ApplyVPD policies
  • 36. grant use on edition to <user>alter database default edition=<x>alter session set edition=<x>dbms_session.set_edition_deferred( <x> )sys.dbms_sys_sql.parse (_as_user)sys_contextSQL*Plus : show editionOpening up an Edition
  • 37. SQL>GRANT USE ON EDITION HR_RELEASE2 TO SCOTT;Grant succeeded.SQL> CONNECT SCOTT/TIGERConnected.SQL> select sys_context('userenv', 'current_edition_name') current_edition_name from dual; CURRENT_EDITION_NAME--------------------ORA$BASE
  • 38. SQL>ALTER SESSION SET EDITION=HR_RELEASE2;Session altered.SQL> select sys_context('userenv', 'current_edition_name') current_edition_name from dual; CURRENT_EDITION_NAME--------------------HR_RELEASE2
  • 39. Rolling back an upgradeRetiring an EditionOnly the root or a leafNo objects are inherited (anymore)Not currently in useNot the DB default editionRecompile objects (reuse settings)Dropping an Edition
  • 41. EBR and APEX - 1ALTER SESSION SET EDITION
  • 43. Session Poolingdbms_epg.set_dad_attribute('APEX', 'database-edition', 'HR_RELEASE2');in dads.conf : PlsqlDatabaseEdition*apex_util.set_editionsets CURRENT_EDITIONEBR and APEX - 2Syntax error on line 48 of /home/oracle/OraHome_1/Apache/modplsql/conf/dads.conf:Invalid command 'PlsqlDatabaseEdition', perhaps mis-spelled or defined by a module not included in the server
  • 44. Build on – views on - Editioning ViewsFour (!) -tier architectureEdition your Views or PL/SQL FunctionsUse Authorization SchemesEBR and APEX - 3UI / APEX(Regular) ViewEditioning ViewTable
  • 45. EBR and APEX – Cool demo
  • 47. Applications never nevernever access tablesApplication sets the editionAlter DAD’s edition (EPG only)!Be aware!!Dropping objects drops inheritanceNo branchingBest Practices
  • 48. Short timeLong(er) timeOnly for a specific groupSaaS environmentParallel Application Versions
  • 49. Different versions in the same schemaNo more planned downtime!Ease of maintenanceLess redoLess riskSo saving $$$Summary & conclusions
  • 50. Edition-Based Redefinition: Testing Live Application Upgrades (Without Actually Being Live) - Ms Melanie CaffreyToday at 14:15Other sessions @UKOUG
  • 51. Tom Kyte column(s) in Oracle Magazine Jan/Feb 2010 (http://www.oracle.com/technology/oramag/oracle/10-jan/o10asktom.html) Bryn's Whitepaper "Edition-Based Redefinition a new capability in Oracle Database 11g Release 2 to support online application upgrade". July 2009 (http://www.oracle.com/technology/deploy/availability/pdf/edition_based_redefinition.pdf) Documentation in "Oracle Database Advanced Application Developer's Guide 11g Release 2" (http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10471/adfns_editions.htm). References
  • 52. Question TimeThat’s all Folks!My blog : http://roelhartman.blogspot.comMy e-mail : [email protected]

Editor's Notes

  • #4: 0:02 / 0:04Over 15 years experience in the Oracle field. Started with RDBMS v5, Oracle Case, Forms 2.3, RPT/RPF. All the way to the latest version of Designer, Developer, RDBMS (took part in the 11g beta test).Frequent contributor of Oracle APEX Forum – Not &gt; 4000 posts, but I’ve got work to do.BloggerWorking for Logica for over 13 years now as a Software Architect, NL-Lead Technical Architect OracleI set op the model for our Factory for Automated Migration of Oracle (u) Software. A repeatable solution for the migrations of Oracle Designer and Oracle Forms from earlier version to the latest version.Not a native English speaker – as you might have noticed (or will notice)APEX Experience?Forms Experience?APEX 2 Forms conversion experience?APEX 3.2 Early Adopters Release: article in Oghvisie &amp; Oracle Scene
  • #8: 7 years!
  • #11: 1. Physical Standby DatabaseStandby database is called “physical” if the physical structure of stand by exactly matches with stand by structure. Archived redo log transferred from primary database will be directly applied to the stand by database.2. Logical Standby DatabaseStand by database is called “logical”, the physical structure of both databases do not match and from the archived redo log we create SQL statements then these statements will be applied to stand by database.
  • #13: Online Index Rebuild (9i):When the ONLINE keyword is used as part of the CREATE or ALTER syntax the current index is left intact while a new copy of the index is built, allowing DML to access the old index. Any alterations to the old index are recorded in a Index Organized Table known as a &quot;journal table&quot;. Once the rebuild is complete the alterations from the journal table are merged into the new index. This may take several passes depending on the frequency of alterations to the index. The process will skip any locked rows and commit every 20 rows. Once the merge operation is complete the data dictionary is updated and the old index is dropped. DML access is only blocked during the data dictionary updates, which complete very quickly.Online Table Redefinition (9i):Prior to Oracle9i table redefinition was only possible using export/import which meant the table was offline during the process, or the move syntax which locked DML during the operation. Neither of these methods is suitable for large OLTP tables as the downtime can be considerable. To solve this problem Oracle9i has introduced Online Table Redefinitions using the DBMS_REDEFINITION package.The process is similar to online rebuilds of indexes in that the original table is left online while a new copy of the table is built. DML operations on the original table are stored in an temporary table for interim updates. Once the new table is complete the interim updates are merged into it and the names of the original and the new table are swapped in the data dictionary. This step requires a DML lock but it is only held for a short time. At this point all DML is processed against the new table. The interim updates are automatically discarded, but the original table, with it&apos;s new name, has to be discarded manually
  • #17: While Boo is implementing Version2, Sulley continues working in Version 1When Boo is finished, Randall starts a new session in Version 2, while Sulley stills does his thing in Version 1
  • #24: NotEditionedTables X and Y are noteditionable, sothoseobjectsaren’t part of anyeditionBase ReleasePL/SQL Object A reads/writes to Table X and calls PL/SQL Object BPL/SQL Object B reads/writes to Table YRelease 2PL/SQL Object B is replacedby B’. PL/SQL Object A calls PL/SQL Object B’ nowPL/SQL Object B’ reads/writes to Table YPL/SQL Object A is “virtually present”
  • #28: NotEditionedFor Release 2 column C is redundant and columns D and E are added.To keep the base release running column C isn’tdropped (yet).Youcan drop column C eventuallywheneveryone is using Release 2.Base ReleasePL/SQL Object A reads/writes to Editioning View XPL/SQL Object B reads/writes to Editioning View YRelease 2Edition View Y is replacedby Y’, without column C, butwith columns D and EPL/SQL Object B is replacedby B’. PL/SQL Object A calls PL/SQL Object B’ nowPL/SQL Object B’ reads/writes to Edition View Y’
  • #30: Update in base ReleasefiresForwardCrossEditionTrigger in Release 2Update in Release 2FiresReverseCrossEditionTrigger in Release 2Update in Release 3FiresReverseCrossEditionTrigger in Release 2
  • #32: Forward Xedition isn’t fired in own editionSo how to create the “new” information =&gt; FIRST_NAME and LAST_NAME from NAMEIGNORE_ROW_ON_DUPKEY_INDEX : Sort of Merge statement.CHANGE_DUPKEY_ERROR_INDEX : Changes an Duplicate Key error from ORA-00001 to ORA-38911
  • #33: Forward Xedition isn’t fired in own editionSo how to create the “new” information =&gt; FIRST_NAME and LAST_NAME from NAMEIGNORE_ROW_ON_DUPKEY_INDEX HintWhen a statement of the form INSERT INTO target subquery runs, a unique key for some rows to be inserted might collide with existing rows. Suppose that you want your application to ignore such collisions and insert the rows that do not collide with existing rows.Before Release 11.2, you had to write a PL/SQL program which, in a block with a NULL handler for the DUP_VAL_ON_INDEX exception, selected the source rows and then inserted them, one at a time, into the target.As of Release 11.2, you do not have to write a PL/SQL program. You can use the IGNORE_ROW_ON_DUPKEY_INDEX hint in an INSERT statement, which is easier to write and runs much faster.CHANGE_DUPKEY_ERROR_INDEX HintWhen an INSERT or UPDATE statement runs, a unique key might collide with existing rows.Before Release 11.2, the collision caused error ORA-00001. You could tell that a collision had occurred, but you could not tell where.As of Release 11.2, you can use the CHANGE_DUPKEY_ERROR_INDEX hint in an INSERT or UPDATE statement, specifying that when a unique key violation occurs for a specified index or set of columns, ORA-38911 is reported instead of ORA-00001. This hint is especially helpful when implementing crossedition triggers.
  • #36: alter database default edition = &lt;x&gt; -&gt; has as side effect : grant use on edition &lt;x&gt; to publicsys.dbms_sys_sql.parse(_as_user) has additional parameters: Editionapply_crossedition_triggerfire_apply_trigger
  • #39: alter database default edition = &lt;x&gt; -&gt; has as side effect : grant use on edition &lt;x&gt; to publicsys.dbms_sys_sql.parse(_as_user) has additional parameters: Editionapply_crossedition_triggerfire_apply_trigger
  • #40: * = ALL, USER or DBA
  • #41: ALTER SESSION SET EDITION doesn’t work. Must be a top-level SQL statement. We can’t do that in APEX.DBMS_SESSION.SET_EDITION_DEFERRED sets the edition of yourcurrentsession (mightbe different fromyournextsession) select owner, object_name, object_id from all_objects where object_type = &apos;EDITION&apos;; select ses.sid, ses.username, ses.session_edition_id, obj.object_namefrom v_$sessionses, all_objectsobjwhere username in (‘ANONYMOUS’,’APEX_PUBLIC_USER’)And ses.session_edition_id = obj.object_id(ses_id.sql)
  • #42: FAIL : /home/oracle/OraHome_1/Apache/Apache/bin/apachectl start: execinghttpdSyntax error on line 48 of /home/oracle/OraHome_1/Apache/modplsql/conf/dads.conf:Invalid command &apos;PlsqlDatabaseEdition&apos;, perhaps mis-spelled or defined by a module not included in the server configuration = BUG!!
  • #43: That way we can separate the user-interface-layer (the way the information is rendered in the browser), the business-layer (what data is shown and what rules the input should comply to) and the data-layer (the editioning views and the tables itself). This way a three-tier-architecture is not sufficient: we even need a four-tier-architecture!