Thursday, October 4, 2012

ORA-39082 "..CREATE WITH COMPILATION WARNINGS"WHILE IMPORTING



ORA-39082 ".... created with compilation warnings" while Importing

. . imported "CLEPROD"."SCM_CORRECT_RESPONSE_SECOND"                 0 KB       0 rows
. . imported "CLEPROD"."SCM_GLOBAL_OBJECTIVE"                                        0 KB       0 rows
. . imported "CLEPROD"."SCM_GLOBAL_OBJ_PROGRESS_INFO"               0 KB       0 rows
. . imported "CLEPROD"."SCM_INTERACTION"                                                    0 KB       0 rows
. . imported "CLEPROD"."SCM_LEARNER_RESPONSE"                                     0 KB       0 rows
. . imported "CLEPROD"."SCM_LEARNER_RESPONSE_FIRST"                       0 KB       0 rows
. . imported "CLEPROD"."SCM_OBJECTIVE_PROGRESS_INFO"                    0 KB       0 rows

ORA-39082: Object type TRIGGER:"CLEPROD"."BEF_INS_ENTITYPROPS" created with compilation warnings
ORA-39082: Object type TRIGGER:"CLEPROD"."BEF_INS_ENTITYPROPS" created with compilation warnings
ORA-39082: Object type TRIGGER:"CLEPROD"."BEF_INS_ENTITYTAGAPPS" created with compilation warnings
ORA-39082: Object type TRIGGER:"CLEPROD"."BEF_INS_ENTITYTAGAPPS" created with compilation warnings
Processing object type SCHEMA_EXPORT/TABLE/INDEX/FUNCTIONAL_AND_BITMAP/INDEX
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/FUNCTIONAL_AND_BITMAP/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type SCHEMA_EXPORT/POST_SCHEMA/PROCOBJ
Job "CLEPROD"."SYS_IMPORT_SCHEMA_01" completed with 6 error(s) at 08:39:47


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 . For example  , in above case data pump import create procedures before views, if our procedure have dependency on views then we will have the ORA-39082 compilation errors . There are various ways to solve these issues. 



1.)              Run  utlrp.sql  to recompile all invalid objects within the database after the import is complete. This script is in the $ORACLE_HOME\rdbms\admin  directory or alternatively we can use the built-in  DBMS_RECOMP package . This will usually clean up all the invalid objects. utlrp.sql  will compile objects in the database across schemas. In case of  Re-mapping objects from one schema to another and utlrp.sql  won't be able to compile them .
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 

3.)              SQL> ALTER PACKAGE <SchemaName>.<PackageName> COMPILE;
4.)              SQL> ALTER PACKAGE <SchemaName>.<PackageName> COMPILE BODY;
5.)              SQL> ALTER PROCEDURE my_procedure COMPILE;
6.)              SQL> ALTER FUNCTION my_function COMPILE;
7.)              SQL> ALTER TRIGGER my_trigger COMPILE;
8.)              SQL> ALTER VIEW my_view COMPILE;
9.)              SQL> EXEC DBMS_UTILITY.compile_schema(schema => 'cleprod')
10.)         SQL> EXEC UTL_RECOMP.recomp_serial('cleprod') ;


No comments:

Post a Comment