Search notes:

Oracle: Editions

A database has at least one edition. The first edition is named ORA$BASE.
The edition names are unique in their own namespace.
An edition is an object without an owner.
An adition can have at most one child.

Simple example

--
--  Kind of important:
--
alter user rene enable editions;

create edition tq84_ed_01;

select * from dba_objects  where object_name  = 'TQ84_ED_01';
select * from dba_editions where edition_name = 'TQ84_ED_01';

alter session set edition = tq84_ed_01;

create editionable function tq84_f return varchar2 authid definer is begin
   return 'This function was created in edition 01';
end tq84_f;
/

select tq84_f from dual;

create edition tq84_ed_02;
alter session set edition = tq84_ed_02;
select tq84_f from dual;

create or replace  editionable function tq84_f return varchar2 authid definer is begin
   return 'This function was altered in edition 02';
end tq84_f;
/

select tq84_f from dual;

alter session set edition = tq84_ed_01;
select tq84_f from dual;
drop function tq84_f;

alter session set edition = ora$base;

--
--  Show current edition of object
--
select * from user_objects    where object_name = 'TQ84_F';
--
--  Unlike user_object, user_objects_AE lists all editions of an object
--
select * from user_objects_ae where object_name = 'TQ84_F';

drop edition tq84_ed_02;
--
-- ORA-38811: need CASCADE option to drop edition that has actual objects
--
drop edition tq84_ed_02 cascade;
drop edition tq84_ed_01 cascade;

TODO

select
   sys_context('userenv', 'current_edition_id'  ) id,
   dbms_metadata.get_edition_id                   id_,
   sys_context('userenv', 'current_edition_name') name
from
   dual;

TODO

sys.user_editioning$
dba_edition_inherited_objects

See also

The edition SQL noun.
v$editionable_types lists editionable object types.
_current_edition_obj
Other Oracle object types

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1758199682, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/Oracle/objects/editions/index(125): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78