How to recompile invalid objects?

Questions by hasanvtu   answers by hasanvtu

Showing Answers 1 - 6 of 6 Answers

Vijayaraju T

  • Nov 7th, 2006
 

First check all the INVALID objects in the schema using :

select OBJECT_NAME,OBJECT_TYPE from user_objects where status='INVALID';

compile the objects accordingly....

ALTER PACKAGE my_package COMPILE;

ALTER PACKAGE my_package COMPILE BODY;

ALTER PROCEDURE my_procedure COMPILE;

ALTER FUNCTION my_function COMPILE;

ALTER TRIGGER my_trigger COMPILE;

ALTER VIEW my_view COMPILE;

Regards,

VijayRaju

  Was this answer useful?  Yes

srirama varma

  • Nov 18th, 2006
 

you will need to recompile the invalid objects in the Repository.

  Was this answer useful?  Yes

Debi Prasad Maharana,Wipro Technologies.

  • Nov 20th, 2006
 

hi,There are two method for compiling the INVALID object.(1) using ALTER statement.SQL > ALTER [OBJECT TYPE ] [ OBJECT NAME ] COMPILE;

  Was this answer useful?  Yes

Debi Prasad Maharana,Wipro Technologies.

  • Nov 20th, 2006
 

hi,There are two method for compiling the INVALID object.(1) using ALTER statement.SQL > ALTER [OBJECT TYPE ] [ OBJECT NAME ] COMPILE;OBJECT TYPE AND OBJECT NAME can be found from USER_OBJECTS viewsSQL > SELECT CBJECT_TYPE,OBJECT_NAME FROM USER_OBJECTS WHERE STATUS LIKE 'INVALID';(2) using DBMS_DDL packagewrite a small program for thisbeginDBMS_DDL.ALTER_COMPILE('[OBJECT_TYPE]','[SCHEMA NAME]','[OBJECT_NAME]');end;/ex :begindbms_ddl.alter_compile('PROCEDURE','SCOTT','TEST_PROCEDURE');end;/Then check the status of the object in user_objects views.Thanks and RegardsDebi Prasad MaharanaWipro Technologies.

  Was this answer useful?  Yes

daniels

  • Dec 18th, 2006
 

you could also do the following.dbms_utility.compile_schema(schema IN VARCHAR2,compile_all BOOLEAN DEFAULT TRUE,reuse_settings BOOLEAN DEFAULT FALSE);exec dbms_utility.compile_schema('SCOTT');

  Was this answer useful?  Yes

sik tauk

  • Apr 26th, 2007
 

If you are a DBA, login on the host using sqlplus to the database using sys as sysdba privilege.

$ export ORACLE_HOME=<ORACLE_HOME>
$ export ORACLE_SID=<ORACLE_SID>
$ sqlplus "/ as sysdba"

Execute the Oracle-supplied utility to compile invalid objects globally:

SQL> ?/rdbms/admin/utlrp

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions