Take the 2-minute tour ×  I have a need to write PL SQL that
fetches data from another database over a DB link and perform
some actions on it.     CURSOR cur_progs       SELECT *
FROM allen.table_dummy@db_link;   In the above example, I faced
two issues.  When the link is not created, below error message
is thrown  ORA-04054: database link db_link does not exist  when
the link is present but the password of the user with which the
link is created is now expired, below error message is thrown
ORA-04052: error occurred when looking up remote object
allen.table_dummy@db_link ORA-00604: error occurred at recursive
SQL level 1 ORA-01017: invalid username/password; logon denied
ORA-02063: preceding line from db_link  Is there a way to catch
both these errors? Something like writing PLSQL block within
PLSQL block.  share|improve this question possible duplicate of
How to check if a database link is valid in Oracle? –  Klas
Lindbäck Jun 12 '13 at 7:01 add comment  2 Answers  up vote 3
down vote accepted  The