Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

DB link check

HeshJul 3 2017 — edited Dec 23 2017

Hi,

I have a process which runs over DB link.

I have to schedule this process, but for that, I have to check whether the DB(over link) is available in the first place before the actual process starts.

I have tried following kind of code and expecting it to go to the exception block when the DB is not available, but its rather 'failing' showing following errors

Can someone help me with this? how can I check the DB link and proceed further with my processing?

ORA-04052: error occurred when looking up remote object reporting

ORA-00604: error occurred at recursive SQL level 1

ORA-28500: connection from ORACLE to a non-Oracle system returned this message:

Declare

V_CHK number;

begin

select 1 into V_CHK from T_PO_HEAD@DBLINK where rownum=1;

DBMS_OUTPUT.PUT_LINE('V_CHK...1'||V_CHK);

exception

when others then

V_CHK:=0;

DBMS_OUTPUT.PUT_LINE('V_CHK...2'||V_CHK);

end ;

Thanks

Hesh

This post has been answered by Nimish Garg on Jul 3 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 31 2017
Added on Jul 3 2017
4 comments
442 views