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:

ORA-00059: Maximum Number Of DB_FILES Exceeded in 19C database

When I am adding datafile to my 19C database facing the below error. SQL> alter tablespace DATA  add datafile '/u01/data/data15.dbf&#...