set long 99999 lines 100
col ddl format a100
select dbms_metadata.get_ddl('DB_LINK', 'RD_DBRI.WORLD', 'PUBLIC') as ddl from dual;
set lines 300
clear column
col owner form a12
col host form a15
col db_link form a20
col username form a15
select OWNER, DB_LINK, USERNAME, HOST, CREATED
from dba_db_links
--where db_link= 'RD_DB2.WORLD';
CREATE PUBLIC DATABASE LINK "LINK1" CONNECT TO "SCOTT" IDENTIFIED BY tiger USING 'dbname';
Change password of user SCOTT on remote DB
alter public database link RD_DEMO connect to SCOTT identified by tiger;
DROP PUBLIC DATABASE LINK; CREATE PUBLIC DATABASE LINK CONNECT TO scott IDENTIFIED BY tiger USING 'ORCL'
select 'select sysdate from dual@'||db_link||';'||chr(10) from dba_db_links;