Skip Headers
Oracle® Database Administrator's Guide
11g Release 2 (11.2)

Part Number E25494-02
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

Managing Editions

Application developers who are upgrading their applications using edition-based redefinition may ask you to perform edition-related tasks that require DBA privileges.

In this section:

About Editions and Edition-Based Redefinition

Edition-based redefinition enables you to upgrade an application's database objects while the application is in use, thus minimizing or eliminating down time. This is accomplished by changing (redefining) database objects in a private environment known as an edition. Only when all changes have been made and tested do you make the new version of the application available to users.

See Also:

Oracle Database Advanced Application Developer's Guide for a complete discussion of edition-based redefinition

DBA Tasks for Edition-Based Redefinition

Table 18-1 summarizes the edition-related tasks that require privileges typically granted only to DBAs. Any user that is granted the DBA role can perform these tasks.

Table 18-1 DBA Tasks for Edition-Based Redefinition

Task See

Grant or revoke privileges to create, alter, and drop editions

The CREATE EDITION and DROP EDITION commands in Oracle Database SQL Language Reference

Enable editions for a schema

Oracle Database Advanced Application Developer's Guide

Set the database default edition

"Setting the Database Default Edition"

Set the edition attribute of a database service

"Setting the Edition Attribute of a Database Service"


Setting the Database Default Edition

There is always a default edition for the database. This is the edition that a database session initially uses if it does not explicitly indicate an edition when connecting.

To set the database default edition: 

  1. Connect to the database as a user with the ALTER DATABASE privilege.

  2. Enter the following statement:

    ALTER DATABASE DEFAULT EDITION = edition_name;
    

Querying the Database Default Edition

The database default edition is stored as a database property.

To query the database default edition: 

  1. Connect to the database as any user.

  2. Enter the following statement:

    SELECT PROPERTY_VALUE FROM DATABASE_PROPERTIES WHERE 
       PROPERTY_NAME = 'DEFAULT_EDITION';
    
    PROPERTY_VALUE
    ------------------------------
    ORA$BASE
    

Note:

The property name DEFAULT_EDITION is case sensitive and must be supplied as upper case.

Setting the Edition Attribute of a Database Service

Note:

This functionality is available starting with Oracle Database 11g release 2 (11.2.0.2).

You can set the edition attribute of a database service when you create the service, or you can modify an existing database service to set its edition attribute. When you set the edition attribute of a service, all subsequent connections that specify the service, such as client connections and DBMS_SCHEDULER jobs, use this edition as the initial session edition. However, if a session connection specifies a different edition, then the edition specified in the session connection is used for the session edition. To check the edition attribute of a database service, query the EDITION column in the ALL_SERVICES view or the DBA_SERVICES view.

Note:

The number of database services for an instance has an upper limit. See Oracle Database Reference for more information about this limit.

Setting the Edition Attribute During Database Service Creation

Follow the instructions in "Creating Database Services" and use the appropriate option for setting the edition attribute for the database service:

  • If your single-instance database is being managed by Oracle Restart, use the SRVCTL utility to create the database service and specify the -t option to set its edition attribute.

    For the database with the DB_UNIQUE_NAME of dbcrm, this example creates a new database service named crmbatch and sets the edition attribute of the database service to e2:

    srvctl add service -d dbcrm -s crmbatch -t e2
    
  • If your single-instance database is not being managed by Oracle Restart, use the DBMS_SERVICE.CREATE_SERVICE procedure, and specify the edition parameter to set the edition attribute of the database service.

Setting the Edition Attribute of an Existing Database Service

You can use the SRVCTL utility or the DBMS_SERVICE package to set the edition attribute of an existing database service.

To set the edition attribute of an existing database service: 

  1. Stop the database service.

  2. Set the edition attribute of the database service using the appropriate option:

    • If your single-instance database is being managed by Oracle Restart, use the SRVCTL utility to modify the database service and specify the -t option to set its edition attribute.

      For the database with the DB_UNIQUE_NAME of dbcrm, this example modifies a database service named crmbatch and sets the edition attribute of the service to e3:

      srvctl modify service -d dbcrm -s crmbatch -t e3
      
    • If your single-instance database is not being managed by Oracle Restart, use the DBMS_SERVICE.MODIFY_SERVICE procedure, and specify the edition parameter to set the edition attribute of the database service. Ensure that the modify_edition parameter is set to TRUE when you run the MODIFY_SERVICE procedure.

  3. Start the database service.

See Also:

Using an Edition

To view or modify objects in a particular edition, you must use the edition first. You can specify an edition to use when you connect to the database. If you do not specify an edition, your session starts in the database default edition. To use a different edition, submit the following statement:

ALTER SESSION SET EDITION=edition_name;

The following statements first set the current edition to e2 and then to ora$base:

ALTER SESSION SET EDITION=e2;
...
ALTER SESSION SET EDITION=ora$base;

See Also:

Editions Data Dictionary Views

There are several data dictionary views that aid with managing editions. The following table lists three of them. For a complete list, see Oracle Database Advanced Application Developer's Guide.

View Description
*_EDITIONS Lists all editions in the database. (Note: USER_EDITIONS does not exist.)
*_OBJECTS Describes every object in the database that is visible (actual or inherited) in the current edition.
*_OBJECTS_AE Describes every actual object in the database, across all editions.