-- drop and create a database link
drop database link DBSTAR;
CREATE DATABASE LINK DBSTAR CONNECT TO ADMIN identified by pwd USING 'DBSTAR.world';
-- to query catalog for db_links
select * from dba_db_links
-- to drop database links - you must be logged on in that schema (you cannot reference another schema's db link)
select 'drop database link "'||db_link||'";'
from dba_db_links where owner = user;
-- to drop public database links
select 'drop public database link "'||db_link||'";'
from dba_db_links where owner = 'PUBLIC';