0% found this document useful (0 votes)
50 views1 page

Compiling Invalid Database Objects

Uploaded by

krishijaasri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views1 page

Compiling Invalid Database Objects

Uploaded by

krishijaasri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

Invalid Objects in Database:

============================

set lines 130;


col object_name for a35
col object_type for a15
col status for a8
select object_name, object_type, owner from dba_objects where status='INVALID' and
owner like upper('%&owner%');

-----------------------------------------------------------------------------------
-------------

Compiling Package, Function, Procedure, Views:


=================================================

Spool run_invalid.sql
select
'ALTER ' || OBJECT_TYPE || ' ' ||
OWNER || '.' || OBJECT_NAME || ' COMPILE;'
from
dba_objects
where
status = 'INVALID' and
owner = upper('&owner') and
object_type in ('PACKAGE','FUNCTION','PROCEDURE','VIEW')
/

spool off

-----------------------------------------------------------------------------------
-----------

Compiling Package Body


=======================

select
'ALTER ' || OBJECT_TYPE || ' ' ||
OWNER || '.' || OBJECT_NAME || ' COMPILE BODY;'
from
dba_objects
where
status = 'INVALID' and
owner = upper('&owner') and
object_type in ('PACKAGE BODY')
/

You might also like