How to create and drop db link

create public database link HISTORYDB connect to pihist identified by pihist using ‘pihist’;
create public database link
  mylink
connect to
  remote_username
identified by
  mypassword
using ‘tns_service_name’;

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Drop database link pidb
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
SQL> select OWNER,DB_LINK from dba_db_links;
OWNER                                         DB_LINK
——————————————— ———————————————
PUBLIC                                        TESTING
PIDB                                          HISTORYDB
SQL> connect pidb/pidb
Connected.
SQL> drop database link HISTORYDB
  2  ;
Database link dropped.
SQL> connect / as sysdba
Connected.
SQL> connect / as sysdba;
Connected.
SQL> select OWNER,DB_LINK from dba_db_links;
OWNER                                         DB_LINK
——————————————— ———————————————
PUBLIC                                        TESTING
SQL> drop PUBLIC database link TESTING;
Database link dropped.
SQL> select OWNER,DB_LINK from dba_db_links;
no rows selected
SQL> create public database link HISTORYDB connect to pihist identified by pihist using ‘pihist’;
Database link created.
SQL> connect pidb/pidb
Connected.

No comments:

SHRD0014: GLLEZL - process exiting with failure

  SYMPTOMS Journal Import completes with the following error: Error ------ ORA-01653 : unable to extend table GL.GL_IMPORT_REFERENCES ORA-01...