Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select * from dual@db_link
- set serveroutput on
- -- or equivalent for your client
- declare
- l_dummy dual.dummy%type;
- begin
- for r in (select db_link from all_db_links) loop
- begin
- execute immediate 'select dummy from dual@' || r.db_link into l_dummy;
- dbms_output.put_line('Link ' || r.db_link || ' is OK.');
- -- release undo locks and link
- rollback work;
- execute immediate 'alter session close database link ' || r.db_link;
- exception
- when others then
- dbms_output.put_line('Link ' || r.db_link || ' is not OK: ' || sqlerrm);
- end;
- end loop;
- end;
- /
- Link MY_LINK_1 is not OK: ORA-12170: TNS:Connect timeout occurred
- Link MY_LINK_2 is OK.
- Link MY_LINK_3 is not OK: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
- Link MY_LINK_4 is OK.
Add Comment
Please, Sign In to add comment