9 Kasım 2009 Pazartesi

ORACLE invalid objects

invalid obje daha önce compile edilmemiş obje manasındadır. siz ne zaman o sql çalıştırırsanız validr duruma geçecektir.
invalid object list;
break on c1 skip 2

set pages 999

col c1 heading 'owner' format a15
col c2 heading 'name' format a40
col c3 heading 'type' format a10

ttitle 'Invalid|Objects'

select
owner c1,
object_type c3,
object_name c2
from
dba_objects
where
status != 'VALID'
order by
owner,
object_type
;
----------------------------------------
You can invoke the utl_recomp package to recompile invalid objects:

EXEC UTL_RECOMP.recomp_serial('schema name');

Oracle highly recommends running this script towards the end of of any migration/upgrade/downgrade.

Set heading off;

set feedback off;

set echo off;

Set lines 999;



Spool run_invalid.sql



select

'ALTER ' || OBJECT_TYPE || ' ' ||

OWNER || '.' || OBJECT_NAME || ' COMPILE;'

from

dba_objects

where

status = 'INVALID'

and

object_type in ('PACKAGE','FUNCTION','PROCEDURE')

;



spool off;



set heading on;

set feedback on;

set echo on;



@run_invalid.sql
----------------------

Hiç yorum yok:

Yorum Gönder