The powerhouse PL/SQL upgrade option: Edition-Based Redefinition (EBR)

Slides:



Advertisements
Similar presentations
Prligence Empowering Intelligence All About Fine Grained Access Control by Arup Nanda.
Advertisements

Oracle9i Database Administrator: Implementation and Administration 1 Chapter 12 System and Object Privileges.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Oracle Database Vault with Oracle Database 12c Chi Ching Chui Senior Development.
System Administration Accounts privileges, users and roles
A Guide to Oracle9i1 Advanced SQL And PL/SQL Topics Chapter 9.
2 Copyright © 2004, Oracle. All rights reserved. Creating Stored Functions.
Getting Started with Oracle11g Abeer bin humaid. Create database user You should create at least one database user that you will use to create database.
Clonedb: The quick and easy cloning solution you never knew you had. Tim Hall Oracle ACE Director Oracle ACE of the Year 2006.
By Lecturer / Aisha Dawood 1.  Administering Users  Create and manage database user accounts.  Create and manage roles.  Grant and revoke privileges.
Database Security and Auditing: Protecting Data Integrity and Accessibility Chapter 6 Virtual Private Databases.
CSIS 4310 – Advanced Databases Virtual Private Databases.
Copyright س Oracle Corporation, All rights reserved. 14 Controlling User Access.
Database Programming Sections 13–Creating, revoking objects privileges.
Week 6 Lecture 2 System and Object Privileges. Learning Objectives  Identify and manage system and object privileges  Grant and revoke privileges to.
Week 7 Lecture 1 Database Roles. Learning Objectives  Discover when and why to use roles  Learn how to create, modify, and remove roles  Learn how.
From Zero to Hero : Using an assortment of caching techniques to improve performance of SQL containing PL/SQL calls. Tim Hall.
PL/SQLPL/SQL Oracle11g : PL/SQL Programming Chapter 6 Functions.
Daniel A. Morgan | | Edition Based Redefinition in Oracle Database 11gR2 Edition Based Redefinition Zero Downtime.
Controlling User Access. Objectives After completing this lesson, you should be able to do the following: Create users Create roles to ease setup and.
Using Procedures & Functions Oracle Database PL/SQL 10g Programming Chapter 9.
Lecture 8 Creating Stored Functions. Objectives  After completing this lesson, you should be able to do the following:  What is Function?  Types of.
Security, Transactions, and Views. About Security As is the case in most shared environments, the DBMS also must implement a security mechanism that allows.
17 Copyright © Oracle Corporation, All rights reserved. Managing Roles.
Roles & privileges privilege A user privilege is a right to execute a particular type of SQL statement, or a right to access another user's object. The.
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Using Edition-based redefinition with PL/SQL How to deploy database code changes.
Dale Roberts 1 Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI
CHAPTER 9 Views, Synonyms, and Sequences. Views are used extensively in reporting applications and also to present subsets of data to applications. Synonyms.
Controlling User Access Fresher Learning Program January, 2012.
1 © 2010 Julian Dyke Edition-Based Redefinition Julian Dyke Independent Consultant juliandyke.com Web Version.
Controlling User Access. 2 home back first prev next last What Will I Learn? Compare the difference between object privileges and system privileges Construct.
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
Database Security. Multi-user database systems like Oracle include security to control how the database is accessed and used for example security Mechanisms:
PL/SQLPL/SQL Oracle10g Developer: PL/SQL Programming Chapter 8 Program Unit Dependencies.
Chapter 5 : Integrity And Security  Domain Constraints  Referential Integrity  Security  Triggers  Authorization  Authorization in SQL  Views 
Authorization in Oracle Part 1 Ji-WonMahesh. Sources Starting source: Starting source: Oracle Database – Security Guide Oracle Database – Security Guide.
Transactions, Roles & Privileges Oracle and ANSI Standard SQL Lecture 11.
IST 318 Database Administration Lecture 9 Database Security.
Chapter 13Introduction to Oracle9i: SQL1 Chapter 13 User Creation and Management.
A Guide to SQL, Eighth Edition Chapter Six Updating Data.
Oracle 11g: SQL Chapter 7 User Creation and Management.
Chapter 6 Virtual Private Databases
13 Copyright © Oracle Corporation, All rights reserved. Controlling User Access.
Database Security. Multi-user database systems like Oracle include security to control how the database is accessed and used for example security Mechanisms:
1 Copyright © 2009, Oracle. All rights reserved. Controlling User Access.
19 Managing Privileges Objectives Identifying system and object privileges Granting and revoking privileges Controlling operating system or password.
Oracle9i Developer: PL/SQL Programming Chapter 5 Functions.
20 Copyright © 2006, Oracle. All rights reserved. Best Practices and Operational Considerations.
E Copyright © 2006, Oracle. All rights reserved. Using SQL Developer.
Tim Hall Oracle ACE Director
Controlling User Access
Controlling User Access
Managing Privileges.
Controlling User Access
Controlling User Access
Managing Privileges.
Chapter 8 Dependencies, Privileges and Compilation Oracle11g:
1Z0-071 Exam : Oracle Database 12c SQL
IS221: Database Management
Database Security.
Using Data Dictionary and Dynamic Performance Views
Chapter 7 Program Unit Dependencies Oracle9i Developer:
The powerhouse PL/SQL upgrade option: Edition-Based Redefinition (EBR)
Database Security.
1Z0-148 Dumps Oracle Database 12c: Advanced PL/SQL Exam Just 1 day study required to pass exam 100% Passing Assurance.
Clonedb: The quick and easy cloning solution you never knew you had.
OER- UNIT 3 Authorization
Using JDeveloper.
Oracle9i Developer: PL/SQL Programming Chapter 8 Database Triggers.
Managing Privileges.
Prof. Arfaoui. COM390 Chapter 9
Presentation transcript:

The powerhouse PL/SQL upgrade option: Edition-Based Redefinition (EBR) Tim Hall Oracle ACE Director Oracle ACE of the Year 2006 OakTable Network OCP DBA (7, 8, 8i, 9i, 10g, 11g) OCP Advanced PL/SQL Developer Oracle Database: SQL Certified Expert http://www.oracle-base.com Books Oracle PL/SQL Tuning Oracle Job Scheduling http://www.oracle-base.com

Why should we care about EBR? Application upgrades with no downtime. Run multiple versions of apps simultaneously. Gradual ramp-up. http://www.oracle-base.com

Editions Version label (sort-of) for some objects in schema. Only apply to: PL/SQL Objects: Functions, Libraries, Packages, Procedures, Triggers, Types Also: Synonyms, Views Objects identified by: owner object_name object_type edition http://www.oracle-base.com

New and Amended Dictionary Views *_EDITIONS *_EDITION_COMMENTS *_OBJECTS *_OBJECTS_AE *_ERRORS *_ERRORS_AE *_USERS *_VIEWS *_EDITIONING_VIEWS *_EDITIONING_VIEWS_AE *_EDITIONING_VIEW_COLS *_EDITIONING_VIEW_COLS_AE * = DBA / ALL / USER http://www.oracle-base.com

What about tables? Tables NOT editionable. Use “Editioning Views” to see subsets and rename columns. CREATE OR REPLACE EDITIONING VIEW view-name AS SELECT col1, col2, col4 AS new_name FROM table-name; Apps access EViews, not tables. http://www.oracle-base.com

Editioning Views Schema Edition: release_v1 Edition: release_v2 http://www.oracle-base.com

Performance Oracle guarantee execution plan will match for same query against editioning view and table. No performance impact. http://www.oracle-base.com

Do base tables have missing data? Yes, but there is a solution. Use Cross-Edition Triggers to keep base table consistent. Similar to regular triggers. Transient. http://www.oracle-base.com

Demo setup.sql http://www.oracle-base.com

Managing Editions Editions are created using CREATE EDITION. CREATE EDITION ed-name; CREATE EDITION ed-name AS CHILD OF ed-name; Currently only 1 child per parent. Attempt to branch results in error. ORA-38807: Implementation restriction: an edition can have only one child v1 v2 v3 v1.5 http://www.oracle-base.com

Managing Editions (continued) Unreferenced leaf editions removed using DROP EDITION. Attempt to drop non-leaf edition results in error ORA-38810: Implementation restriction: cannot drop edition that has a parent and a child Query DBA_EDITIONS. manage_editions.sql v1 v2 ✗ v3 ✔ http://www.oracle-base.com

User Setup Editioning must be turned on for a user. ALTER USER username ENABLE EDITIONS; No off switch! Specific editions must be associated with users. GRANT USE ON EDITION ed-name TO username; user_setup.sql http://www.oracle-base.com

Switching between editions Any Session: (switch_editions.sql) ALTER SESSION SET EDITION = ed-name; ALTER DATABASE DEFAULT EDITION = ed-name; SQL*Plus: $ export ORA_EDITION=ed-name C:> set ORA_EDITION=ed-name $ sqlplus username/password@service edition=ed-name SQL> CONNECT username/password@service EDITION=ed-name http://www.oracle-base.com

Switching between editions (continued) Services: Editions associated with services (11.2.0.2) BEGIN DBMS_SERVICE.modify_service( service_name => 'DB11G.WORLD', edition => 'RELEASE_V1', modify_edition => TRUE); END; / When you switch to a new edition, all editionable objects in schema are automatically inherited from the previous edition. Altering or dropping an object breaks inheritance for that object. http://www.oracle-base.com

Preparing existing app for editions. Rename base tables. Create editioning views matching original table structures and names. PL/SQL objects will recompile against editioning view. Drop any triggers and compile them against editioning views, rather than base tables. If necessary, apply VPD policies against editioning views, rather than base tables. Revoke all privileges against tables and recreate them against the editioning views. http://www.oracle-base.com

Create new application Build editioning views over tables. Code references editioning views, not tables. Triggers and VPD policies reference editioning views. (create_app.sql) http://www.oracle-base.com

Upgrade application Amend base tables. Switch edition. Build new editioning views and new app. Build cross edition triggers and update missing data. (upgrade_app.sql) http://www.oracle-base.com

Summary Application upgrades with no downtime. Run multiple versions of apps simultaneously. Gradual ramp-up. Not just a PL/SQL feature. Java apps use tables too. http://www.oracle-base.com

The End… Download slides at: http://www.oracle-base.com/workshops Article: http://www.oracle-base.com/articles/11g/EditionBasedRedefinition_11gR2.php http://www.oracle-base.com