'Impdp ora-00904 invalid identifier

I'm triying to import our database which is in WE8MSWIN1252 instance to a new AL32UTF8 instance. I'm using impdp tool to achieve this. I get the following error

Processing object type SCHEMA_EXPORT/PACKAGE/COMPILE_PACKAGE/PACKAGE_SPEC/ALTER_PACKAGE_SPEC ORA-39083: Object type ALTER_PACKAGE_SPEC:"MyOwner"."MyPackageOwner" failed to create with error: ORA-00904: "DECL_OBJ#": invalid identifier

Please note that when I compile this package using SQLplus it is working as expected Do you have any idea about what can causes this error ? Thanks, Bilel



Solution 1:[1]

I have just excluded views, packages and package_compile from the export and this worked as expected.

Solution 2:[2]

Open SQL Developer. Set the PLScope identifiers parameter (Tools > Preferences > Database > PL/SQL Compiler > PLScope identifiers) from All to None. Close and open the SQL Developer.

It solved my issue.

Solution 3:[3]

In the support note mentioned above, Oracle says that this error is related to SQL Developer and a specific patched version of Oracle DB (12.2.0.1.181016).

As a workaround it seems you can disable PL/Scope (a functionality to parse and analyse PL/SQL code) like this :

  • Open SQL Developer Set the PLScope identifiers parameter (Tools > Preferences > Database > PL/SQL Compiler > PLScope identifiers) from All to None.
  • Close and open the SQL Developer

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Bilel Chaouadi
Solution 2 mik
Solution 3 R. Du