Oracle® Database Administrator's Guide 11g Release 2 (11.2) Part Number E10595-04 |
|
|
View PDF |
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:
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 redefinitionTable 17-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 17-1 DBA Tasks for Edition-Based Redefinition
Task | See |
---|---|
Grant or revoke privileges to create, alter, and drop editions |
The |
Enable editions for a schema |
|
Set 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:
Connect to the database as a user with the ALTER
DATABASE
privilege.
Enter the following statement:
ALTER DATABASE DEFAULT EDITION = edition_name;
The database default edition is stored as a database property.
To query the database default edition:
Connect to the database as any user.
Enter the following statement:
SELECT PROPERTY_VALUE FROM DATABASE_PROPERTIES WHERE PROPERTY_NAME = 'DEFAULT_EDITION'; PROPERTY_VALUE ------------------------------ ORA$BASE
Note:
The property nameDEFAULT_EDITION
is case sensitive and must be supplied as upper case.If you want 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:
Oracle Database Advanced Application Developer's Guide for more information about using editions, and for instructions for determining the current edition
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. |