check invalid database link for the DBA

followup of check invalid database link If you need to check db link in another schema, you need to create code that run with that schema. base on the example from yesterday, here is an extended version for the dba CREATE FUNCTION dba_status   (owner VARCHAR2, db_link VARCHAR2)   RETURN VARCHAR2 IS   PRAGMA AUTONOMOUS_TRANSACTION;   status   VARCHAR2 (4000); […]

check invalid database link

If one database link is invalid, you cannot select through it SQL> select * from dual@z; select * from dual@z                    * ERROR at line 1: ORA-02019: connection description for remote database not found However, there is no STATUS command in your user_db_links table that you could use. For this purpose, write a function. create […]

dynamic database link

How do I select thru a database link, where the database link is not fixed? SQL> var db_link varchar2(255); SQL> exec :db_link := 'DB02'; SQL> select x from LSC_T@:db_link where x>0;   select x from LSC_T@:db_link where x>0;                       * ERROR at line 1: ORA-01729: database link name expected My solution using dynamic SQL Remote databases DB02 […]