Enabling Editions for a User Fails with ORA-38819 (Doc ID 1099433.1)

Last updated on JULY 05, 2017

Applies to:

PL/SQL - Version 11.2.0.1 and later
Oracle Database - Enterprise Edition - Version 11.2.0.1 and later
Information in this document applies to any platform.
***Checked for relevance on 6th Sep 2016***

Symptoms

An application consists of two users, user A and user B.
Neither user A nor user B is edition enabled.
User A owns a package (package1) and user B owns a package (package2).
Package1 of user A references a type of a variable declared in the specification of package2 of user B.
Package2 of user B references a type of a variable declared in the specification of package1 of user A.
So the packages are inter-dependent.

If you try to enable editions for user A it will fail with:

ORA-38819: User A owns one or more objects whose type is editionable and that have noneditioned dependants.

and if you try to enable editions for user B it will also fail with:

ORA-38819: User B owns one or more objects whose type is editionable and that have noneditioned dependants.


See the following use case example:


connect sys/change_on_install as sysdba

drop user A cascade;
drop user B cascade;

create user A identified by A;
grant connect,resource,dba to A identified by A;

create user B identified by B;
grant connect,resource,dba to B identified by B;

-- neither A nor B is edition_enabled
select editions_enabled from dba_users where username = 'A';
select editions_enabled from dba_users where username = 'B';

-------------------
connect A/A
set serveroutput on

CREATE OR REPLACE PACKAGE package1 AS
var1 number;
PROCEDURE ref_pkg2 ;
END package1;
/
show errors

CREATE OR REPLACE PACKAGE BODY package1 AS
PROCEDURE ref_pkg2 IS
num1 B.package2.var2%type;
BEGIN
null;
END ref_pkg2;
END package1;
/
show errors

grant execute on package1 to B;
-------------------
connect B/B
set serveroutput on

CREATE OR REPLACE PACKAGE package2 AS
var2 number;
PROCEDURE ref_pkg1;
END package2;
/
show errors

CREATE OR REPLACE PACKAGE BODY package2 AS
PROCEDURE ref_pkg1 IS
num A.package1.var1%type;
result number;
BEGIN
null;
END ref_pkg1;
END package2;
/
show errors

grant execute on package2 to A;
-------------------

connect A/A
alter package package1 compile;

connect sys/change_on_install as sysdba
select editions_enabled from dba_users where username = 'A';
select STATUS from DBA_OBJECTS where OBJECT_NAME = 'PACKAGE1' and owner = 'A';
select STATUS from DBA_OBJECTS where OBJECT_NAME = 'PACKAGE2' and owner = 'B';

alter user A enable editions;

alter user B enable editions;

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms