Skip to content
March 30, 2018 / doganay

ORA-38818: illegal reference to editioned object


Problem:

In oracle 12c, when you want to use sysman grid objects in a procedure or package, you get this error:

[Error] ORA-38818 (4: 41): PL/SQL: ORA-38818: illegal reference to editioned object .
ORA-38818: illegal reference to editioned object SYSMAN.MGMT_TARGETS


Solution:

Use ctas in the beginning of sp, and use this flat table instead of sysman views:

create table myuser.mgmt_targets as select target_type, target_name from sysman.mgmt_targets;

create or replace procedure1 is

begin

execute immediate 'delete myuser.mgmt_targets';

execute immediate 'insert /*+ append */ into myuser.mgmt_targets select target_type, target_name from sysman.mgmt_targets';

execute immediate 'commit';

..

..

end;

/

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: