Home » SQL & PL/SQL » SQL & PL/SQL » plsql procedure gets invalidated (11g)
plsql procedure gets invalidated [message #613866] Tue, 13 May 2014 03:57 Go to next message
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 #613868 is a reply to message #613866] Tue, 13 May 2014 04:09 Go to previous messageGo to next message
Lalit Kumar B
Messages: 3174
Registered: May 2013
Location: World Wide on the Web
Senior Member
Is the procedure itself on other DB or only the underlying objects are accessed? You can have a look at REMOTE_DEPENDENCIES_MODE
Re: plsql procedure gets invalidated [message #613869 is a reply to message #613868] Tue, 13 May 2014 04:13 Go to previous messageGo to next message
ashwanth77
Messages: 95
Registered: April 2013
Location: India
Member
the proc in other database,we just query to get the data from remotedb.it was working fine, all of sudden something is causing this problem
Re: plsql procedure gets invalidated [message #613871 is a reply to message #613869] Tue, 13 May 2014 04:41 Go to previous messageGo to next message
Lalit Kumar B
Messages: 3174
Registered: May 2013
Location: World Wide on the Web
Senior Member
ashwanth77 wrote on Tue, 13 May 2014 14:43
the proc in other database


So are you handling the dependencies on remote PL/SQL stored procedures? Did you read the link I posted?
Re: plsql procedure gets invalidated [message #613877 is a reply to message #613871] Tue, 13 May 2014 05:47 Go to previous messageGo to next message
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 #613890 is a reply to message #613877] Tue, 13 May 2014 07:08 Go to previous messageGo to next message
Michel Cadot
Messages: 68645
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Most likely but just try it.

Re: plsql procedure gets invalidated [message #613896 is a reply to message #613877] Tue, 13 May 2014 07:27 Go to previous messageGo to next message
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 Go to previous messageGo to next message
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 Go to previous messageGo to next message
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 #613917 is a reply to message #613898] Tue, 13 May 2014 09:43 Go to previous messageGo to next message
Lalit Kumar B
Messages: 3174
Registered: May 2013
Location: World Wide on the Web
Senior Member
I don't know why sometimes there are duplicate posts getting submitted simultaneously. Is it a browser issue or something else? Anyone aware of it?
If it seems to be an issue, could a moderator split this post to suggestions and feedback forum. And of course delete the duplicate post. Sorry for the inconvenience Sad
Re: plsql procedure gets invalidated [message #613979 is a reply to message #613914] Wed, 14 May 2014 02:24 Go to previous messageGo to next message
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;
Re: plsql procedure gets invalidated [message #614481 is a reply to message #613979] Thu, 22 May 2014 05:30 Go to previous message
ashwanth77
Messages: 95
Registered: April 2013
Location: India
Member
the db link errors was solved.the public synonym of the sp was in invalid state.changing that to valid state resolved the ORA-04052,ORA-00604,ORA-02019 errors

[Updated on: Thu, 22 May 2014 05:30]

Report message to a moderator

Previous Topic: randomize records and groupby date.
Next Topic: Need procedure logic
Goto Forum:
  


Current Time: Thu Apr 25 16:30:52 CDT 2024