Thursday, December 1, 2016

ORA-39127: unexpected error from call to "SYS"."DBMS_JVM_EXP_PERMS"."GRANT_SYSPRIVS_EXP"

While doing an export (expdp) following error was encountered.
Processing object type DATABASE_EXPORT/ROLE
ORA-39127: unexpected error from call to "SYS"."DBMS_JVM_EXP_PERMS"."GRANT_SYSPRIVS_EXP"
ORA-44002: invalid object name
ORA-06512: at "SYS.DBMS_ASSERT", line 383
ORA-06512: at "SYS.DBMS_METADATA", line 9408
The reason for this is the java components are removed but DBMS_JVM_EXP_PERMS package remains in the database.
SQL> select comp_name,status from dba_registry order by 2;

COMP_NAME                                STATUS
---------------------------------------- --------
Oracle Database Java Packages            REMOVED
JServer JAVA Virtual Machine             REMOVED
Oracle XDK                               REMOVED
Oracle Real Application Clusters         VALID
Oracle Database Catalog Views            VALID
Oracle Workspace Manager                 VALID
Oracle XML Database                      VALID
Oracle Database Packages and Types       VALID
To fix this, remove the DBMS_JVM_EXP_PERMS package from the database. Refer 1095533.1 for exact steps. Removing this package doesn't make any changes to component status. Java components will be shown as removed. However the packages left behind during the removal process is cleaned up.
Afterwards expdp continue without any issue.



Useful metalink note
DataPump Export (EXPDP) Failed On Identifier SYS.DBMS_JVM_EXP_PERMS Must Be Declared [ID 1095533.1]

Related Posts
ORA-39127: unexpected error from call to export_string :=WMSYS.LT_EXPORT_PKG.SCHEMA_INFO_EXP
ORA-39127: unexpected error from call to export_string :=SYS.DBMS_CUBE_EXP.SCHEMA_INFO_EXP while Exporting