SlideShare a Scribd company logo
1 of 30
Download to read offline
dbi services
Edition Based Redefinition




                           Jérôme Witt
                           Consultant - Oracle Certified Professional 11g
                           Mobile +41 79 961 27 73
                           jerome.witt@dbi-services.com
                           www.dbi-services.com




1   www.dbi-services.com                                08.11.2012 © dbi services
Edition Based Redefinition
Agenda



                  Agenda
                  i.       Introduction
                  ii.      Concept
                  iii.     Basics
                  iv.      Redefining objects
                  v.       Advanced functionalities
                  vi.      Limits




2   www.dbi-services.com                              08.11.2012 © dbi services
Edition Based Redefinition
Introduction

 Upgrading applications can be difficult
 Short or long downtimes can not be scheduled
 Implementation of online upgrades are desirable


 As of Oracle Database 11gR2 with Oracle Edition
  Based Redefinition (aka. EBR) online application
  upgrades are now supported


 Announced as “the killer feature” at the OOW 2009



3    www.dbi-services.com                   08.11.2012 © dbi services
Edition Based Redefinition
       Introduction


                             • Creation of new objects
Application upgrade




                             • Changing objects
                                (alter and create or replace)


                             • Drop redundant objects                      Downtime


                                                                             EBR
                             • Convert or migrate data


                             • Resume normal operations

       4              www.dbi-services.com                      08.11.2012 © dbi services
Edition Based Redefinition
Agenda



                  Agenda
                  i.       Introduction
                  ii.      Concept
                  iii.     Basics
                  iv.      Redefining objects
                  v.       Advanced functionalities
                  vi.      Limits




5   www.dbi-services.com                              08.11.2012 © dbi services
Edition Based Redefinition
Concept(1)

 As of Oracle 11gR2 an object is identified by
     His name and the schema it belongs to
     And now also to an EDITION
       SQL> desc DBA_OBJECTS
        Name                  Null?    Type
        ------------------ -------- ----------------
        . . .
        EDITION_NAME                     VARCHAR2(30)


 Allows to support several copies of an object
     Objects which might have copies are called “editioned objects”
 All other objects are “non editionable”


6     www.dbi-services.com                         08.11.2012 © dbi services
Edition Based Redefinition
Concept (2)

 Which objects are “editionable” ?
      SYNONYM              All PL/SQL objects
      VIEW                    PACKAGE and PACKAGE BODY
                               PROCEDURE
                               FUNCTION
                               LIBRARY
                               TRIGGER
                               TYPE and TYPE BODY




 A non-editonable object cannot depend on an
  editonable object


7   www.dbi-services.com                 08.11.2012 © dbi services
Edition Based Redefinition
Concept(3)

 Editions are organized hierarchically «parent-child»

    ORA$BASE                  ED1      ED2                 ED3

                        • OBJ_1                      • OBJ_1
                        • OBJ_2     • OBJ_2
                        • OBJ_3                      • OBJ_3


                              ED2




8      www.dbi-services.com                   08.11.2012 © dbi services
Edition Based Redefinition
Concept(4)

 Editions are organized hierarchically «parent-child»

    ORA$BASE                  ED1                 ED2                ED3

                        • OBJ_1                                • OBJ_1
                        • OBJ_2           • OBJ_2
                        • OBJ_3                                • OBJ_3



 Inheritance
      When an edition is created all objects associated with the parent
       are inherited by the child. They become «inherited»
      Objects re-created or altered in an edition become “actualized”
       (i.e. objects OBJ_2 & OBJ_3 of the edition ED3)
      Inherited & actual objects are “visible”
9      www.dbi-services.com                             08.11.2012 © dbi services
Edition Based Redefinition
Agenda



                   Agenda
                   i.       Introduction
                   ii.      Concept
                   iii.     Basics
                   iv.      Redefining objects
                   v.       Advanced functionalities
                   vi.      Limits




10   www.dbi-services.com                              08.11.2012 © dbi services
Edition Based Redefinition
Basics (1)

 Creating editions
      Database default edition «ORA$BASE»
          Database creation or upgrade to Oracle 11.2
          Has no actual editioned objects
     SQL> CREATE EDITION <ed_name> {AS CHILD OF ora$base};


 Enabling editions
     SQL> ALTER USER <schema> ENABLE EDITIONS {FORCE};
      Editioned objects can only be owned by schemas that have
       been explicitly enabled
      FORCE if schema has potentially editionable objects
      By the way DISABLE EDTIONS doesn’t exists !

11     www.dbi-services.com                              08.11.2012 © dbi services
Edition Based Redefinition
Basics (2)

 Granting editions
     SQL> GRANT USE ON EDITION <ed_name> TO <schema>;


 Selecting editions
     SQL> ALTER SESSION SET EDITION =<ed_name>;


 Retrieving current and session edition
     SQL> SHOW EDITION;

     SQL> SELECT
           SYS_CONTEXT('USERENV', 'CURRENT_EDITION_NAME'),
           SYS_CONTEXT('USERENV', 'SESSION_EDITION_NAME')
        FROM dual;

12     www.dbi-services.com                   08.11.2012 © dbi services
Edition Based Redefinition
Basics (3)

 Enabling an edition database wide
     SQL> ALTER DATABASE DEFAULT EDITION=<ed_name>;

     SQL> SELECT property_value FROM database_properties
          WHERE property_name = 'DEFAULT_EDITION';

 Selecting edition at connection time
     DBMS_SERVICE.CREATE_SERVICE(
        service_name => '<ORACLE_SID.DB_DOMAIN>',
        . . .
        edition       => '<ed_name>');

 EBR integrated with
      Oracle Call Interface        JDBC
      Oracle Restart (srvctl)
13     www.dbi-services.com                   08.11.2012 © dbi services
Edition Based Redefinition
Basics (4)

 Display all database editions
      Views {DBA|ALL}_EDITIONS


 Display all objects editions
      Views {DBA|ALL|USER}_OBJECTS_AE


 View current edition from an object
      Views {DBA|ALL|USER}_OBJECTS.EDITION_NAME




 And so on …

14    www.dbi-services.com                 08.11.2012 © dbi services
Edition Based Redefinition
Agenda



                   Agenda
                   i.       Introduction
                   ii.      Concept
                   iii.     Basics
                   iv.      Redefining objects
                   v.       Advanced functionalities
                   vi.      Limits




15   www.dbi-services.com                              08.11.2012 © dbi services
Edition Based Redefinition
Redefining objects(1)




     SQL> BEGIN
            raiseSalary(
                p_title_in   => 'COM_DBISERVICES . . . ',
                p_rate_in    => 1.10,
                p_max_sal_in => 50000 );
          END;
     /

16    www.dbi-services.com                   08.11.2012 © dbi services
Edition Based Redefinition
 Redefining objects(2)

PROCEDURE raiseSalary(. . .) IS
  . . .
  CURSOR cur_emp IS SELECT * FROM EMPLOYEES FOR UPDATE;
BEGIN
  OPEN cur_emp;
  LOOP
     FETCH cur_emp INTO rec_emp;
     . . .
     SELECT upper(job_title) INTO v_cur_title FROM hr.jobs
         WHERE job_id = rec_emp.job_id;
     IF v_cur_title = v_title_in
         AND rec_emp.salary*p_rate_in <= p_max_sal_in
    THEN
       -- Do some other checks on employee
       UPDATE . . .
     END IF;
  END LOOP;
  CLOSE cur_emp;
  COMMIT;
END;
 17    www.dbi-services.com                        08.11.2012 © dbi services
Edition Based Redefinition
 Redefining objects(3)

PROCEDURE raiseSalary(. . .) IS
  . . .
  CURSOR cur_emp IS
    SELECT e.employee_id from hr.employees e, hr.jobs j
    WHERE e.job_id = j.job_id AND upper(j.job_title) = v_title_in
    AND e.salary*p_rate_in <= p_max_sal_in;
BEGIN
  OPEN cur_emp;
  LOOP
    FETCH cur_emp BULK COLLECT INTO v_empid_list LIMIT 1000;
    EXIT WHEN v_empid_list.COUNT = 0;

      -- Do some other checks on employee
      FORALL i IN v_empid_list.FIRST .. v_empid_list.LAST
        UPDATE hr.employees SET salary=salary*p_rate_in
          WHERE employee_id=v_empid_list(i);

  END LOOP;
  CLOSE cur_emp; COMMIT;
END;
 18      www.dbi-services.com                       08.11.2012 © dbi services
Edition Based Redefinition
Redefining objects(3)

 Typical EBR redefinition steps
     1. Create the new edition
     2. Set the edition as session edition
     3. Redefine the objects
     4. Permanently switch to the new edition


 To “redefine” objects it’s necessary to select the new
  edition and either re-compile or recreate objects


 Consider application roll out strategy



19     www.dbi-services.com                     08.11.2012 © dbi services
Edition Based Redefinition
Redefining objects(4)




20   www.dbi-services.com    08.11.2012 © dbi services
Edition Based Redefinition
Agenda



                   Agenda
                   i.       Introduction
                   ii.      Concept
                   iii.     Basics
                   iv.      Redefining objects
                   v.       Advanced functionalities
                   vi.      Limits




21   www.dbi-services.com                              08.11.2012 © dbi services
Edition Based Redefinition
Advanced functionalities(1)

 Views
      Editionable (of course)
      Support only INSTEAD OF triggers


 Editioning views
      Selects a subset of the columns from a single base table
      Optionally, provide aliases for columns
      Doesn’t support indexes nor constraints
      No performance penalty for accessing base table
      Support any type of triggers
       (especially CROSSEDITION TRIGGERS)
     SQL> CREATE EDITIONING VIEW <name> AS SELECT ...;

22     www.dbi-services.com                        08.11.2012 © dbi services
Edition Based Redefinition
Advanced functionalities(2)

 Crossedition triggers
      Propagate data changes made by the old edition into the new
       edition’s columns, or vice-versa.
      From type FORWARD or REVERSE
      They are temporary!

     SQL> CREATE OR REPLACE TRIGGER <trigger_name>
       BEFORE INSERT OR UPDATE ON <table_name>
       FOR EACH ROW
       FORWARD CROSSEDITION
       DISABLE
     BEGIN
     . . .
     END <trigger_name>;
     /

23     www.dbi-services.com                       08.11.2012 © dbi services
Edition Based Redefinition
Advanced functionalities(3)


                              New Edition : ED_V1
          C_Pool
          ED_V1                    EMPLOYEES
                              First     Last    Phone
                              Name     Name      Nbr




                                 EMPLOYEES_TAB
                                   EMPLOYEES
                               First    Last    Phone
                               Name    Name      Nbr


24   www.dbi-services.com                 08.11.2012 © dbi services
Edition Based Redefinition
Advanced functionalities(4)


                                                  ED_V2
                                    New Edition : ED_V1
          C_Pool
          ED_V1                          EMPLOYEES
                                        EMPLOYEES
                            First     First Phone
                                     Last     Last    Phone
                                                     Dial   Int
                            Name     Name
                                    Name     Name
                                             Nbr       Nbr PhNbr
                                                     Code


                               FWD_TRG

                               REV_TRG

                                       EMPLOYEES_TAB
                                      EMPLOYEES_TAB
                            First      First Phone
                                     Last       Last Phone Int
                                                     Dial
                            Name      Name Nbr
                                    Name       Name Code
                                                       Nbr PhNbr


25   www.dbi-services.com                       08.11.2012 © dbi services
Edition Based Redefinition
Advanced functionalities(5)


                                    New Edition : ED_V2
          C_Pool
          ED_V1                         EMPLOYEES
                            First    Last   Phone    Dial        Int
                            Name    Name     Nbr     Code       PhNbr


                               FWD_TRG

                               REV_TRG

                                      EMPLOYEES_TAB
          C_Pool
          ED_V2             First    Last   Phone    Dial        Int
                            Name    Name     Nbr     Code       PhNbr


26   www.dbi-services.com                       08.11.2012 © dbi services
Edition Based Redefinition
Advanced functionalities(2)

 Hot roll-over “bulk forward”
      Wait for pending DMLs
     DBMS_UTILITY.WAIT_ON_PENDING_DML(
                 tables => '<Base_Table>',
                 timeout => timeout,
                 scn => scn
             );

      Apply transformation
      DBMS_SQL.PARSE(
        c                          =>   c,
        Language_Flag              =>   DBMS_SQL.NATIVE,
        Statement=> 'UPDATE employees   SET ID = ID',
        Apply_Crossedition_Trigger =>   '<CRED_TRG_FWD>'
       );

27     www.dbi-services.com                    08.11.2012 © dbi services
Edition Based Redefinition
Agenda



                   Agenda
                   i.       Introduction
                   ii.      Concept
                   iii.     Basics
                   iv.      Redefining objects
                   v.       Advanced functionalities
                   vi.      Limits




28   www.dbi-services.com                              08.11.2012 © dbi services
Edition Based Redefinition
Limits

 Performance & Tuning
      Indexes & constraints must be added to the base table
      To limit negative performance impact specify an INDEX hint
       within the crossedition triggers
      Editioning views accept SQL optimizer hints
          Logical column names must be mapped to an index on the
           corresponding physical column in the base table
     SQL> SELECT /*+ INDEX (edview1 idx1)*/ email
            FROM edview1 WHERE last_name='King';


 Can not drop retired editions!
      Bugs (11.2.0.3) – do not drop edition ORA$BASE
 One of the least known Oracle database feature
29     www.dbi-services.com                           08.11.2012 © dbi services
dbi services
Any Questions? Please Do Ask!




                            Jérôme Witt
                            Consultant - Oracle Certified Professional 11g
                            Mobile +41 79 961 27 73
                            jerome.witt@dbi-services.com
                            www.dbi-services.com


         „We look forward to working with you!“


30   www.dbi-services.com                                08.11.2012 © dbi services

More Related Content

Viewers also liked

[JSS2015] In memory and operational analytics
[JSS2015] In memory and operational analytics[JSS2015] In memory and operational analytics
[JSS2015] In memory and operational analyticsGUSS
 
Datit207 scénarios hybrides entre sql server et windows azure
Datit207   scénarios hybrides entre sql server et windows azureDatit207   scénarios hybrides entre sql server et windows azure
Datit207 scénarios hybrides entre sql server et windows azureChristophe Laporte
 
[JSS2015] - Document db et nosql
[JSS2015] - Document db et nosql[JSS2015] - Document db et nosql
[JSS2015] - Document db et nosqlGUSS
 
Serveurs core et virtualisation
Serveurs core et virtualisationServeurs core et virtualisation
Serveurs core et virtualisationChristophe Laporte
 
Jss2014 performance counters and dmvs
Jss2014   performance counters and dmvsJss2014   performance counters and dmvs
Jss2014 performance counters and dmvsChristophe Laporte
 
JSS2013 : Haute disponibilité
JSS2013 : Haute disponibilitéJSS2013 : Haute disponibilité
JSS2013 : Haute disponibilitéChristophe Laporte
 
SQL Server 2008 'Best Practices' - Stéphane Haby, dbi services - Mövenpick La...
SQL Server 2008 'Best Practices' - Stéphane Haby, dbi services - Mövenpick La...SQL Server 2008 'Best Practices' - Stéphane Haby, dbi services - Mövenpick La...
SQL Server 2008 'Best Practices' - Stéphane Haby, dbi services - Mövenpick La...dbi services
 
Always on les solutions de haute disponibilité avec sql server 2012 (dat302)
Always on les solutions de haute disponibilité avec sql server 2012 (dat302)Always on les solutions de haute disponibilité avec sql server 2012 (dat302)
Always on les solutions de haute disponibilité avec sql server 2012 (dat302)Christophe Laporte
 
[JSS2015] Nouveautés SQL Server 2016:Sécurité,Temporal & Stretch Tables
[JSS2015] Nouveautés SQL Server 2016:Sécurité,Temporal & Stretch Tables[JSS2015] Nouveautés SQL Server 2016:Sécurité,Temporal & Stretch Tables
[JSS2015] Nouveautés SQL Server 2016:Sécurité,Temporal & Stretch TablesGUSS
 
How to Make Awesome SlideShares: Tips & Tricks
How to Make Awesome SlideShares: Tips & TricksHow to Make Awesome SlideShares: Tips & Tricks
How to Make Awesome SlideShares: Tips & TricksSlideShare
 
Getting Started With SlideShare
Getting Started With SlideShareGetting Started With SlideShare
Getting Started With SlideShareSlideShare
 

Viewers also liked (16)

High performance jss 2012
High performance jss 2012High performance jss 2012
High performance jss 2012
 
JSS2013 : Hekaton
JSS2013 : HekatonJSS2013 : Hekaton
JSS2013 : Hekaton
 
[JSS2015] In memory and operational analytics
[JSS2015] In memory and operational analytics[JSS2015] In memory and operational analytics
[JSS2015] In memory and operational analytics
 
Datit207 scénarios hybrides entre sql server et windows azure
Datit207   scénarios hybrides entre sql server et windows azureDatit207   scénarios hybrides entre sql server et windows azure
Datit207 scénarios hybrides entre sql server et windows azure
 
Fusion io
Fusion ioFusion io
Fusion io
 
[JSS2015] - Document db et nosql
[JSS2015] - Document db et nosql[JSS2015] - Document db et nosql
[JSS2015] - Document db et nosql
 
Serveurs core et virtualisation
Serveurs core et virtualisationServeurs core et virtualisation
Serveurs core et virtualisation
 
Jss2014 performance counters and dmvs
Jss2014   performance counters and dmvsJss2014   performance counters and dmvs
Jss2014 performance counters and dmvs
 
JSS2013 : Haute disponibilité
JSS2013 : Haute disponibilitéJSS2013 : Haute disponibilité
JSS2013 : Haute disponibilité
 
Haute disponibilité jss2012
Haute disponibilité jss2012Haute disponibilité jss2012
Haute disponibilité jss2012
 
SQL Server 2008 'Best Practices' - Stéphane Haby, dbi services - Mövenpick La...
SQL Server 2008 'Best Practices' - Stéphane Haby, dbi services - Mövenpick La...SQL Server 2008 'Best Practices' - Stéphane Haby, dbi services - Mövenpick La...
SQL Server 2008 'Best Practices' - Stéphane Haby, dbi services - Mövenpick La...
 
JSS2013 : Statistiques
JSS2013 : StatistiquesJSS2013 : Statistiques
JSS2013 : Statistiques
 
Always on les solutions de haute disponibilité avec sql server 2012 (dat302)
Always on les solutions de haute disponibilité avec sql server 2012 (dat302)Always on les solutions de haute disponibilité avec sql server 2012 (dat302)
Always on les solutions de haute disponibilité avec sql server 2012 (dat302)
 
[JSS2015] Nouveautés SQL Server 2016:Sécurité,Temporal & Stretch Tables
[JSS2015] Nouveautés SQL Server 2016:Sécurité,Temporal & Stretch Tables[JSS2015] Nouveautés SQL Server 2016:Sécurité,Temporal & Stretch Tables
[JSS2015] Nouveautés SQL Server 2016:Sécurité,Temporal & Stretch Tables
 
How to Make Awesome SlideShares: Tips & Tricks
How to Make Awesome SlideShares: Tips & TricksHow to Make Awesome SlideShares: Tips & Tricks
How to Make Awesome SlideShares: Tips & Tricks
 
Getting Started With SlideShare
Getting Started With SlideShareGetting Started With SlideShare
Getting Started With SlideShare
 

Similar to Edition Based Redefinition: Online Application Upgrades Made Possible

SQL Server 2012 : réussir la migration - Stéphane Haby - Antonio De Santo - d...
SQL Server 2012 : réussir la migration - Stéphane Haby - Antonio De Santo - d...SQL Server 2012 : réussir la migration - Stéphane Haby - Antonio De Santo - d...
SQL Server 2012 : réussir la migration - Stéphane Haby - Antonio De Santo - d...dbi services
 
Lesson10
Lesson10Lesson10
Lesson10renguzi
 
企業應用行動化開發架構
企業應用行動化開發架構企業應用行動化開發架構
企業應用行動化開發架構湯米吳 Tommy Wu
 
Tune my Database! Mehr Oracle SQL Performance über SQLHC - Yann Neuhaus, Nico...
Tune my Database! Mehr Oracle SQL Performance über SQLHC - Yann Neuhaus, Nico...Tune my Database! Mehr Oracle SQL Performance über SQLHC - Yann Neuhaus, Nico...
Tune my Database! Mehr Oracle SQL Performance über SQLHC - Yann Neuhaus, Nico...dbi services
 
Sqlsat154 maintain your dbs with help from ola hallengren
Sqlsat154 maintain your dbs with help from ola hallengrenSqlsat154 maintain your dbs with help from ola hallengren
Sqlsat154 maintain your dbs with help from ola hallengrenAndy Galbraith
 
Liquibase – a time machine for your data
Liquibase – a time machine for your dataLiquibase – a time machine for your data
Liquibase – a time machine for your dataNeev Technologies
 
How to map Domain changes on an existing Database
How to map Domain changes on an existing DatabaseHow to map Domain changes on an existing Database
How to map Domain changes on an existing DatabasePhilip Washington Sorst
 
Oracle GoldenGate - Herve Schweitzer, dbi services - Hilton Basel 5/2011
Oracle GoldenGate - Herve Schweitzer, dbi services - Hilton Basel 5/2011Oracle GoldenGate - Herve Schweitzer, dbi services - Hilton Basel 5/2011
Oracle GoldenGate - Herve Schweitzer, dbi services - Hilton Basel 5/2011dbi services
 
Siebel Resume Arquitecture
Siebel Resume ArquitectureSiebel Resume Arquitecture
Siebel Resume ArquitectureJose Martinez
 
Tune my Application Server! Java Appl. Performance mit JVMD - Gérard Wisson, ...
Tune my Application Server! Java Appl. Performance mit JVMD - Gérard Wisson, ...Tune my Application Server! Java Appl. Performance mit JVMD - Gérard Wisson, ...
Tune my Application Server! Java Appl. Performance mit JVMD - Gérard Wisson, ...dbi services
 
Mock Objects from Concept to Code
Mock Objects from Concept to CodeMock Objects from Concept to Code
Mock Objects from Concept to CodeRob Myers
 
Windows Server Core : environnement pour SQL Server 2012 - Stéphane Haby - db...
Windows Server Core : environnement pour SQL Server 2012 - Stéphane Haby - db...Windows Server Core : environnement pour SQL Server 2012 - Stéphane Haby - db...
Windows Server Core : environnement pour SQL Server 2012 - Stéphane Haby - db...dbi services
 
Iphone programming: Core Data Tutorial for iOS
Iphone programming: Core Data Tutorial for iOSIphone programming: Core Data Tutorial for iOS
Iphone programming: Core Data Tutorial for iOSKenny Nguyen
 
Introduction to Activiti
Introduction to ActivitiIntroduction to Activiti
Introduction to Activitiyunshui
 
NiUG 2012 Discovery Philly: Business Objects
NiUG 2012 Discovery Philly: Business ObjectsNiUG 2012 Discovery Philly: Business Objects
NiUG 2012 Discovery Philly: Business ObjectsKye Hittle
 
FIWARE Global Summit - A Multi-database Plugin for the Orion FIWARE Context B...
FIWARE Global Summit - A Multi-database Plugin for the Orion FIWARE Context B...FIWARE Global Summit - A Multi-database Plugin for the Orion FIWARE Context B...
FIWARE Global Summit - A Multi-database Plugin for the Orion FIWARE Context B...FIWARE
 

Similar to Edition Based Redefinition: Online Application Upgrades Made Possible (20)

SQL Server 2012 : réussir la migration - Stéphane Haby - Antonio De Santo - d...
SQL Server 2012 : réussir la migration - Stéphane Haby - Antonio De Santo - d...SQL Server 2012 : réussir la migration - Stéphane Haby - Antonio De Santo - d...
SQL Server 2012 : réussir la migration - Stéphane Haby - Antonio De Santo - d...
 
Lesson10
Lesson10Lesson10
Lesson10
 
企業應用行動化開發架構
企業應用行動化開發架構企業應用行動化開發架構
企業應用行動化開發架構
 
Tune my Database! Mehr Oracle SQL Performance über SQLHC - Yann Neuhaus, Nico...
Tune my Database! Mehr Oracle SQL Performance über SQLHC - Yann Neuhaus, Nico...Tune my Database! Mehr Oracle SQL Performance über SQLHC - Yann Neuhaus, Nico...
Tune my Database! Mehr Oracle SQL Performance über SQLHC - Yann Neuhaus, Nico...
 
Sqlsat154 maintain your dbs with help from ola hallengren
Sqlsat154 maintain your dbs with help from ola hallengrenSqlsat154 maintain your dbs with help from ola hallengren
Sqlsat154 maintain your dbs with help from ola hallengren
 
Liquibase – a time machine for your data
Liquibase – a time machine for your dataLiquibase – a time machine for your data
Liquibase – a time machine for your data
 
How to map Domain changes on an existing Database
How to map Domain changes on an existing DatabaseHow to map Domain changes on an existing Database
How to map Domain changes on an existing Database
 
Dependency Injection Styles
Dependency Injection StylesDependency Injection Styles
Dependency Injection Styles
 
Oracle GoldenGate - Herve Schweitzer, dbi services - Hilton Basel 5/2011
Oracle GoldenGate - Herve Schweitzer, dbi services - Hilton Basel 5/2011Oracle GoldenGate - Herve Schweitzer, dbi services - Hilton Basel 5/2011
Oracle GoldenGate - Herve Schweitzer, dbi services - Hilton Basel 5/2011
 
Siebel Resume Arquitecture
Siebel Resume ArquitectureSiebel Resume Arquitecture
Siebel Resume Arquitecture
 
Tune my Application Server! Java Appl. Performance mit JVMD - Gérard Wisson, ...
Tune my Application Server! Java Appl. Performance mit JVMD - Gérard Wisson, ...Tune my Application Server! Java Appl. Performance mit JVMD - Gérard Wisson, ...
Tune my Application Server! Java Appl. Performance mit JVMD - Gérard Wisson, ...
 
Mock Objects from Concept to Code
Mock Objects from Concept to CodeMock Objects from Concept to Code
Mock Objects from Concept to Code
 
Database change management with Liquibase
Database change management with LiquibaseDatabase change management with Liquibase
Database change management with Liquibase
 
Windows Server Core : environnement pour SQL Server 2012 - Stéphane Haby - db...
Windows Server Core : environnement pour SQL Server 2012 - Stéphane Haby - db...Windows Server Core : environnement pour SQL Server 2012 - Stéphane Haby - db...
Windows Server Core : environnement pour SQL Server 2012 - Stéphane Haby - db...
 
Iphone programming: Core Data Tutorial for iOS
Iphone programming: Core Data Tutorial for iOSIphone programming: Core Data Tutorial for iOS
Iphone programming: Core Data Tutorial for iOS
 
Introduction to Activiti
Introduction to ActivitiIntroduction to Activiti
Introduction to Activiti
 
React & redux
React & reduxReact & redux
React & redux
 
NiUG 2012 Discovery Philly: Business Objects
NiUG 2012 Discovery Philly: Business ObjectsNiUG 2012 Discovery Philly: Business Objects
NiUG 2012 Discovery Philly: Business Objects
 
FIWARE Global Summit - A Multi-database Plugin for the Orion FIWARE Context B...
FIWARE Global Summit - A Multi-database Plugin for the Orion FIWARE Context B...FIWARE Global Summit - A Multi-database Plugin for the Orion FIWARE Context B...
FIWARE Global Summit - A Multi-database Plugin for the Orion FIWARE Context B...
 
Quality control in a cloudy world
Quality control in a cloudy worldQuality control in a cloudy world
Quality control in a cloudy world
 

Recently uploaded

The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Nikki Chapple
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integrationmarketing932765
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...
Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...
Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...itnewsafrica
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...BookNet Canada
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 

Recently uploaded (20)

The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...
Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...
Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 

Edition Based Redefinition: Online Application Upgrades Made Possible

  • 1. dbi services Edition Based Redefinition Jérôme Witt Consultant - Oracle Certified Professional 11g Mobile +41 79 961 27 73 jerome.witt@dbi-services.com www.dbi-services.com 1 www.dbi-services.com 08.11.2012 © dbi services
  • 2. Edition Based Redefinition Agenda Agenda i. Introduction ii. Concept iii. Basics iv. Redefining objects v. Advanced functionalities vi. Limits 2 www.dbi-services.com 08.11.2012 © dbi services
  • 3. Edition Based Redefinition Introduction  Upgrading applications can be difficult  Short or long downtimes can not be scheduled  Implementation of online upgrades are desirable  As of Oracle Database 11gR2 with Oracle Edition Based Redefinition (aka. EBR) online application upgrades are now supported  Announced as “the killer feature” at the OOW 2009 3 www.dbi-services.com 08.11.2012 © dbi services
  • 4. Edition Based Redefinition Introduction • Creation of new objects Application upgrade • Changing objects (alter and create or replace) • Drop redundant objects Downtime EBR • Convert or migrate data • Resume normal operations 4 www.dbi-services.com 08.11.2012 © dbi services
  • 5. Edition Based Redefinition Agenda Agenda i. Introduction ii. Concept iii. Basics iv. Redefining objects v. Advanced functionalities vi. Limits 5 www.dbi-services.com 08.11.2012 © dbi services
  • 6. Edition Based Redefinition Concept(1)  As of Oracle 11gR2 an object is identified by  His name and the schema it belongs to  And now also to an EDITION SQL> desc DBA_OBJECTS Name Null? Type ------------------ -------- ---------------- . . . EDITION_NAME VARCHAR2(30)  Allows to support several copies of an object  Objects which might have copies are called “editioned objects”  All other objects are “non editionable” 6 www.dbi-services.com 08.11.2012 © dbi services
  • 7. Edition Based Redefinition Concept (2)  Which objects are “editionable” ?  SYNONYM  All PL/SQL objects  VIEW  PACKAGE and PACKAGE BODY  PROCEDURE  FUNCTION  LIBRARY  TRIGGER  TYPE and TYPE BODY  A non-editonable object cannot depend on an editonable object 7 www.dbi-services.com 08.11.2012 © dbi services
  • 8. Edition Based Redefinition Concept(3)  Editions are organized hierarchically «parent-child» ORA$BASE ED1 ED2 ED3 • OBJ_1 • OBJ_1 • OBJ_2 • OBJ_2 • OBJ_3 • OBJ_3 ED2 8 www.dbi-services.com 08.11.2012 © dbi services
  • 9. Edition Based Redefinition Concept(4)  Editions are organized hierarchically «parent-child» ORA$BASE ED1 ED2 ED3 • OBJ_1 • OBJ_1 • OBJ_2 • OBJ_2 • OBJ_3 • OBJ_3  Inheritance  When an edition is created all objects associated with the parent are inherited by the child. They become «inherited»  Objects re-created or altered in an edition become “actualized” (i.e. objects OBJ_2 & OBJ_3 of the edition ED3)  Inherited & actual objects are “visible” 9 www.dbi-services.com 08.11.2012 © dbi services
  • 10. Edition Based Redefinition Agenda Agenda i. Introduction ii. Concept iii. Basics iv. Redefining objects v. Advanced functionalities vi. Limits 10 www.dbi-services.com 08.11.2012 © dbi services
  • 11. Edition Based Redefinition Basics (1)  Creating editions  Database default edition «ORA$BASE»  Database creation or upgrade to Oracle 11.2  Has no actual editioned objects SQL> CREATE EDITION <ed_name> {AS CHILD OF ora$base};  Enabling editions SQL> ALTER USER <schema> ENABLE EDITIONS {FORCE};  Editioned objects can only be owned by schemas that have been explicitly enabled  FORCE if schema has potentially editionable objects  By the way DISABLE EDTIONS doesn’t exists ! 11 www.dbi-services.com 08.11.2012 © dbi services
  • 12. Edition Based Redefinition Basics (2)  Granting editions SQL> GRANT USE ON EDITION <ed_name> TO <schema>;  Selecting editions SQL> ALTER SESSION SET EDITION =<ed_name>;  Retrieving current and session edition SQL> SHOW EDITION; SQL> SELECT SYS_CONTEXT('USERENV', 'CURRENT_EDITION_NAME'), SYS_CONTEXT('USERENV', 'SESSION_EDITION_NAME') FROM dual; 12 www.dbi-services.com 08.11.2012 © dbi services
  • 13. Edition Based Redefinition Basics (3)  Enabling an edition database wide SQL> ALTER DATABASE DEFAULT EDITION=<ed_name>; SQL> SELECT property_value FROM database_properties WHERE property_name = 'DEFAULT_EDITION';  Selecting edition at connection time DBMS_SERVICE.CREATE_SERVICE( service_name => '<ORACLE_SID.DB_DOMAIN>', . . . edition => '<ed_name>');  EBR integrated with  Oracle Call Interface  JDBC  Oracle Restart (srvctl) 13 www.dbi-services.com 08.11.2012 © dbi services
  • 14. Edition Based Redefinition Basics (4)  Display all database editions  Views {DBA|ALL}_EDITIONS  Display all objects editions  Views {DBA|ALL|USER}_OBJECTS_AE  View current edition from an object  Views {DBA|ALL|USER}_OBJECTS.EDITION_NAME  And so on … 14 www.dbi-services.com 08.11.2012 © dbi services
  • 15. Edition Based Redefinition Agenda Agenda i. Introduction ii. Concept iii. Basics iv. Redefining objects v. Advanced functionalities vi. Limits 15 www.dbi-services.com 08.11.2012 © dbi services
  • 16. Edition Based Redefinition Redefining objects(1) SQL> BEGIN raiseSalary( p_title_in => 'COM_DBISERVICES . . . ', p_rate_in => 1.10, p_max_sal_in => 50000 ); END; / 16 www.dbi-services.com 08.11.2012 © dbi services
  • 17. Edition Based Redefinition Redefining objects(2) PROCEDURE raiseSalary(. . .) IS . . . CURSOR cur_emp IS SELECT * FROM EMPLOYEES FOR UPDATE; BEGIN OPEN cur_emp; LOOP FETCH cur_emp INTO rec_emp; . . . SELECT upper(job_title) INTO v_cur_title FROM hr.jobs WHERE job_id = rec_emp.job_id; IF v_cur_title = v_title_in AND rec_emp.salary*p_rate_in <= p_max_sal_in THEN -- Do some other checks on employee UPDATE . . . END IF; END LOOP; CLOSE cur_emp; COMMIT; END; 17 www.dbi-services.com 08.11.2012 © dbi services
  • 18. Edition Based Redefinition Redefining objects(3) PROCEDURE raiseSalary(. . .) IS . . . CURSOR cur_emp IS SELECT e.employee_id from hr.employees e, hr.jobs j WHERE e.job_id = j.job_id AND upper(j.job_title) = v_title_in AND e.salary*p_rate_in <= p_max_sal_in; BEGIN OPEN cur_emp; LOOP FETCH cur_emp BULK COLLECT INTO v_empid_list LIMIT 1000; EXIT WHEN v_empid_list.COUNT = 0; -- Do some other checks on employee FORALL i IN v_empid_list.FIRST .. v_empid_list.LAST UPDATE hr.employees SET salary=salary*p_rate_in WHERE employee_id=v_empid_list(i); END LOOP; CLOSE cur_emp; COMMIT; END; 18 www.dbi-services.com 08.11.2012 © dbi services
  • 19. Edition Based Redefinition Redefining objects(3)  Typical EBR redefinition steps 1. Create the new edition 2. Set the edition as session edition 3. Redefine the objects 4. Permanently switch to the new edition  To “redefine” objects it’s necessary to select the new edition and either re-compile or recreate objects  Consider application roll out strategy 19 www.dbi-services.com 08.11.2012 © dbi services
  • 20. Edition Based Redefinition Redefining objects(4) 20 www.dbi-services.com 08.11.2012 © dbi services
  • 21. Edition Based Redefinition Agenda Agenda i. Introduction ii. Concept iii. Basics iv. Redefining objects v. Advanced functionalities vi. Limits 21 www.dbi-services.com 08.11.2012 © dbi services
  • 22. Edition Based Redefinition Advanced functionalities(1)  Views  Editionable (of course)  Support only INSTEAD OF triggers  Editioning views  Selects a subset of the columns from a single base table  Optionally, provide aliases for columns  Doesn’t support indexes nor constraints  No performance penalty for accessing base table  Support any type of triggers (especially CROSSEDITION TRIGGERS) SQL> CREATE EDITIONING VIEW <name> AS SELECT ...; 22 www.dbi-services.com 08.11.2012 © dbi services
  • 23. Edition Based Redefinition Advanced functionalities(2)  Crossedition triggers  Propagate data changes made by the old edition into the new edition’s columns, or vice-versa.  From type FORWARD or REVERSE  They are temporary! SQL> CREATE OR REPLACE TRIGGER <trigger_name> BEFORE INSERT OR UPDATE ON <table_name> FOR EACH ROW FORWARD CROSSEDITION DISABLE BEGIN . . . END <trigger_name>; / 23 www.dbi-services.com 08.11.2012 © dbi services
  • 24. Edition Based Redefinition Advanced functionalities(3) New Edition : ED_V1 C_Pool ED_V1 EMPLOYEES First Last Phone Name Name Nbr EMPLOYEES_TAB EMPLOYEES First Last Phone Name Name Nbr 24 www.dbi-services.com 08.11.2012 © dbi services
  • 25. Edition Based Redefinition Advanced functionalities(4) ED_V2 New Edition : ED_V1 C_Pool ED_V1 EMPLOYEES EMPLOYEES First First Phone Last Last Phone Dial Int Name Name Name Name Nbr Nbr PhNbr Code FWD_TRG REV_TRG EMPLOYEES_TAB EMPLOYEES_TAB First First Phone Last Last Phone Int Dial Name Name Nbr Name Name Code Nbr PhNbr 25 www.dbi-services.com 08.11.2012 © dbi services
  • 26. Edition Based Redefinition Advanced functionalities(5) New Edition : ED_V2 C_Pool ED_V1 EMPLOYEES First Last Phone Dial Int Name Name Nbr Code PhNbr FWD_TRG REV_TRG EMPLOYEES_TAB C_Pool ED_V2 First Last Phone Dial Int Name Name Nbr Code PhNbr 26 www.dbi-services.com 08.11.2012 © dbi services
  • 27. Edition Based Redefinition Advanced functionalities(2)  Hot roll-over “bulk forward”  Wait for pending DMLs DBMS_UTILITY.WAIT_ON_PENDING_DML( tables => '<Base_Table>', timeout => timeout, scn => scn );  Apply transformation DBMS_SQL.PARSE( c => c, Language_Flag => DBMS_SQL.NATIVE, Statement=> 'UPDATE employees SET ID = ID', Apply_Crossedition_Trigger => '<CRED_TRG_FWD>' ); 27 www.dbi-services.com 08.11.2012 © dbi services
  • 28. Edition Based Redefinition Agenda Agenda i. Introduction ii. Concept iii. Basics iv. Redefining objects v. Advanced functionalities vi. Limits 28 www.dbi-services.com 08.11.2012 © dbi services
  • 29. Edition Based Redefinition Limits  Performance & Tuning  Indexes & constraints must be added to the base table  To limit negative performance impact specify an INDEX hint within the crossedition triggers  Editioning views accept SQL optimizer hints  Logical column names must be mapped to an index on the corresponding physical column in the base table SQL> SELECT /*+ INDEX (edview1 idx1)*/ email FROM edview1 WHERE last_name='King';  Can not drop retired editions!  Bugs (11.2.0.3) – do not drop edition ORA$BASE  One of the least known Oracle database feature 29 www.dbi-services.com 08.11.2012 © dbi services
  • 30. dbi services Any Questions? Please Do Ask! Jérôme Witt Consultant - Oracle Certified Professional 11g Mobile +41 79 961 27 73 jerome.witt@dbi-services.com www.dbi-services.com „We look forward to working with you!“ 30 www.dbi-services.com 08.11.2012 © dbi services