plsql procedure gets invalidated [message #613866] |
Tue, 13 May 2014 03:57 |
|
ashwanth77
Messages: 95 Registered: April 2013 Location: India
|
Member |
|
|
procedure involving dblinks gets invalidated regularly on production env.we need to recompile every time.How to find what is causing the problem
|
|
|
|
|
|
Re: plsql procedure gets invalidated [message #613877 is a reply to message #613871] |
Tue, 13 May 2014 05:47 |
|
ashwanth77
Messages: 95 Registered: April 2013 Location: India
|
Member |
|
|
Quote:REMOTE_DEPENDENCIES_MODE specifies how Oracle should handle dependencies upon remote PL/SQL stored procedures.
in my case
procedure p1()--resides in db1
is
begin
....
select col1 from table1@db2;
...
end
/
for some reasons the procedure gets invalidated and the dblinks doesnt work and i get the following errors
ORA-04052
ORA-00604
ORA-02019
and i recompile all the invalid objects this seem to work.
i need to figure why the proc in db1 gets invalidated?
so changing the REMOTE_DEPENDENCIES_MODE = SIGNATURE will fix this issue?
[im using prod env]
[Updated on: Tue, 13 May 2014 06:07] Report message to a moderator
|
|
|
|
Re: plsql procedure gets invalidated [message #613896 is a reply to message #613877] |
Tue, 13 May 2014 07:27 |
Lalit Kumar B
Messages: 3174 Registered: May 2013 Location: World Wide on the Web
|
Senior Member |
|
|
If it works then it would rule out few other common guesses about environmental issues. If it doesn't work, you need to create a script to log the details and analyse further. As Michel said, try it, and feedback.
|
|
|
Re: plsql procedure gets invalidated [message #613898 is a reply to message #613896] |
Tue, 13 May 2014 07:40 |
Solomon Yakobson
Messages: 3273 Registered: January 2010 Location: Connecticut, USA
|
Senior Member |
|
|
There is no "works" or "doesn't work". Using signature will prevent local procedure invalidation when, for example, remote procedure it is referencing was simply recompiled. It will not prevent local procedure invalidation when remote procedure it is referencing changed at least one of the following characterisrics:
•Name
•Number of parameters
•Parameter data type
•Parameter mode
•Data type class of return value (for a function)
SY.
|
|
|
Re: plsql procedure gets invalidated [message #613914 is a reply to message #613898] |
Tue, 13 May 2014 09:35 |
Lalit Kumar B
Messages: 3174 Registered: May 2013 Location: World Wide on the Web
|
Senior Member |
|
|
By "work" I meant OP's issue getting resolved (not the feature working or not) unless there is something else going on. I was 99% sure it has to be remote dependency issue and expect OP resolves his issue. There was a known Oracle bug with timestamp sync issue in dba_objects. I remember with 11g, in our application it was issue between the web call and local DB (not remote) objects. I don't remember the metalink doc id(not required in this case though). Let's wait for OP's feedback.
|
|
|
|
Re: plsql procedure gets invalidated [message #613979 is a reply to message #613914] |
Wed, 14 May 2014 02:24 |
Lalit Kumar B
Messages: 3174 Registered: May 2013 Location: World Wide on the Web
|
Senior Member |
|
|
Not sure if this will help OP. But thought to share this.
Even though the object doesn't show as "INVALID" in DBA_OBJECTS, but the objects are actually invalid w.r.t. each other.
What looks like can happen is that an object can change without changing it's 'Specification' (basically it's input and output). What I think this script is doing is identifying those that change without impacting it's dba_objects valid indicator(DBA_OBJECTS Timestamp vs last_ddl_time).
Typically if an object changes it will 'invalidate' the working copy in memory. And then when it's called it will automatically compile/parse it and if it believes it to be bad it will mark it as invalid.
SELECT do.obj# d_obj,
do.name d_name,
do.type# d_type,
po.obj# p_obj,
po.name p_name,
To_char(p_timestamp, 'DD-MON-YYYY HH24:MI:SS') "P_Timestamp",
To_char(po.stime, 'DD-MON-YYYY HH24:MI:SS') "STIME",
Decode(Sign(po.stime - p_timestamp), 0, 'SAME',
'*DIFFER*') X
FROM sys.obj$ do,
sys.dependency$ d,
sys.obj$ po
WHERE p_obj# = po.obj#(+)
AND d_obj# = do.obj#
AND do.status = 1 /*dependent is valid*/
AND po.status = 1 /*parent is valid*/
AND po.stime != p_timestamp /*parent timestamp not match*/
AND po.owner# <> 0
ORDER BY 2,
1;
|
|
|
|