ORA-39082: Object type PACKAGE_BODY or VIEW

ORA-39082: Object type PACKAGE_BODY

ORA-39082: Object type VIEW

ORA-39082 generally occur during the import . The error message states that the object in the SQL statement following this error was created with compilation errors.

impdp system/xxxx schemas=DMTRC  dumpfile=DMTRC.DMP logfile=DMTRC.log

Import: Release 10.2.0.1.0 – Production on Wednesday, 30 November, 2011 14:40:06
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Express Edition Release 10.2.0.1.0 – Production
Master table “SYSTEM”.”SYS_IMPORT_FULL_04″ successfully loaded/unloaded
Starting “SYSTEM”.”SYS_IMPORT_FULL_04″: system/********@schemaS=DMTRC dumpfile=DMTRC.DMP logfile=DMTRC.log
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/SEQUENCE/SEQUENCE
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
. . imported “DMTRC”.”AD_ARCHIVE” 188.3 MB 1785 rows
. . imported “DMTRC”.”T_REPORTSTATEMENT” 54.13 MB 952472 rows
. . imported “DMTRC”.”FACT_ACCT” 23.79 MB 115203 rows
. . imported “DMTRC”.”AD_QUERYLOG” 20.35 MB 78411 rows
. . imported “DMTRC”.”T_TRIALBALANCE” 12.54 MB 55310 rows
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/FUNCTION/FUNCTION
Processing object type SCHEMA_EXPORT/PROCEDURE/PROCEDURE
Processing object type SCHEMA_EXPORT/FUNCTION/ALTER_FUNCTION
ORA-39082: Object type ALTER_FUNCTION:”DMTRC”.”DSI_FUNC_PRODUCTREP” created with compilation warnings
ORA-39082: Object type ALTER_FUNCTION:”DMTRC”.”INVOICEOPEN” created with compilation warnings
Processing object type SCHEMA_EXPORT/PROCEDURE/ALTER_PROCEDURE
ORA-39082: Object type ALTER_PROCEDURE:”DMTRC”.”T_INVENTYVALUE_CREATE” created with compilation warnings
ORA-39082: Object type ALTER_PROCEDURE:”DMTRC”.”AD_SYNCHRONIZE” created with compilation warnings
Processing object type SCHEMA_EXPORT/VIEW/VIEW
ORA-39082: Object type VIEW:”DMTRC”.”M_STORAGE_V” created with compilation warning

All the above error ORA-30082 is a warning . This error occurs due to improper or re-order the sequence of importing the objects or due to the dependency on others objects .  There are various ways to solve this issues .

1.) Run utlrp.sql to recompile all invalid objects ($ORACLE_HOME\rdbms\admin\utlrp.sql) .

2.) After the import is completed, recompile the every errors . This is useful when you have few errors. The below command are used to recompile the objects as

SQL> ALTER PACKAGE <SchemaName>.<PackageName> COMPILE;
SQL> ALTER PACKAGE <SchemaName>.<PackageName> COMPILE BODY;
SQL> ALTER PROCEDURE my_procedure COMPILE;
SQL> ALTER FUNCTION my_function COMPILE;
SQL> ALTER TRIGGER my_trigger COMPILE;
SQL> ALTER VIEW my_view COMPILE;
SQL> EXEC DBMS_UTILITY.compile_schema(schema => ‘shaik9sep11g’) ; or
SQL> EXEC UTL_RECOMP.recomp_serial(‘shaik9sep11g’) ;

While compile any package if you get following error:

364/3    PLS-00201: identifier ‘DBMS_AQADM’ must be declared

Just grant that privilege to that user:

grant execute on DBMS_AQADM to DMTRAC;

Then you can compile the package again.

Nagulu Polagani

"We are all apprentices in a craft where no one ever becomes a master."