Today one of our data pump export/import jobs failed with errors attached at the bottom. The process working fine before our 11g upgrade.
I did a little research and found metalink doc 304449.1 has perfect solution.
The problem is we removed some unused database options before we upgrade from 10g to 11g.
The reason is because with all these unnecessary options, the upgrade scripts will run almost two hours. Removing them the upgrade will finish in 15 minutes.
It turns out DMSYS data mining option is among them, but somehow Oracle didn't cleanly remove the option with some left over records in data pump export table.
The solution in this case is delete these records,
SQL> DELETE FROM exppkgact$ WHERE SCHEMA='DMSYS';
SQL> commit;
There are other potential causes for the same error. You can check the metalink doc for more info.
Database Data Pump Export fails with PLS-00201 identifier DMSYS.DBMS_MODEL_EXP must be declared [ID 304449.1]
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "SYSTEM"."SYS_IMPORT_SCHEMA_11": userid=system/********@TEST parfile=/home/oracle/dba/sql/DWS.par
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
ORA-39126: Worker unexpected fatal error in KUPW$WORKER.GET_TABLE_DATA_OBJECTS []
ORA-31642: the following SQL statement fails:
BEGIN "DMSYS"."DBMS_DM_MODEL_EXP".SCHEMA_CALLOUT(:1,0,1,'11.02.00.00.00'); END;
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 86
ORA-06512: at "SYS.DBMS_METADATA", line 1245
ORA-04063: package body "DMSYS.DBMS_DM_MODEL_EXP" has errors
ORA-06508: PL/SQL: could not find program unit being called: "DMSYS.DBMS_DM_MODEL_EXP"
ORA-06512: at "SYS.DBMS_METADATA", line 5300
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 86
ORA-06512: at "SYS.KUPW$WORKER", line 8159
----- PL/SQL Call Stack -----
object line object
handle number name
70000007ddbc258 19028 package body SYS.KUPW$WORKER
70000007ddbc258 8191 package body SYS.KUPW$WORKER
70000007ddbc258 12728 package body SYS.KUPW$WORKER
70000007ddbc258 4618 package body SYS.KUPW$WORKER
70000007ddbc258 8902 package body SYS.KUPW$WORKER
70000007ddbc258 1651 package body SYS.KUPW$WORKER
70000007eaf9060 2 anonymous block