Home » SQL & PL/SQL » SQL & PL/SQL » Problem with Recompiling Invalid PLSQL Objects(ORA-04068)
Problem with Recompiling Invalid PLSQL Objects(ORA-04068) [message #187741] Tue, 15 August 2006 05:51 Go to next message
bahy91
Messages: 91
Registered: September 2005
Location: Amsterdam
Member
I have a script which will end with the execution of a procedure PR_REBUILDVIEWS (This procedure refresh the building of views in the database).
when this script executed it return the following error:

ORA-04068: existing state of packages has been discarded
ORA-04064: not executed, invalidated procedure "SMS5D01.PR_REBUILDCHANNELVIEWS"
ORA-06508: PL/SQL: could not find program unit being called
ORA-06512: at "SMS5D01.PR_REBUILDVIEWS", line 31
ORA-06512: at line 2

well ..the using of the following code will not solve the problem,
i still got that the invalid objects recompiled with errors:
Set heading off;
set feedback off;
set echo off;
Set lines 999;

Spool run_invalid.sql

select 'ALTER ' || OBJECT_TYPE || ' ' || OBJECT_NAME || ' COMPILE REUSE SETTINGS;'
from user_objects
where status = 'INVALID'
and object_type in ('PACKAGE','FUNCTION','PROCEDURE','TRIGGER');

spool off;

set heading on;
set feedback on;
set echo on;

@run_invalid.sql

So..can anyone tell me who can i solve this problem?


[Updated on: Tue, 15 August 2006 05:52]

Report message to a moderator

Re: Problem with Recompiling Invalid PLSQL Objects(ORA-04068) [message #187769 is a reply to message #187741] Tue, 15 August 2006 10:02 Go to previous message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Would it help if you include PACKAGE BODY into the object types list?

-> and object_type in ('PACKAGE','FUNCTION','PROCEDURE','TRIGGER', 'PACKAGE BODY')
Previous Topic: PL/SQL Cursor Fetch error
Next Topic: simple plsql
Goto Forum:
  


Current Time: Tue Dec 03 08:35:01 CST 2024