Tuesday, August 12, 2008

DB Links

Tables dba_db_links, all_db_links, dbms_dblink
Syntax :
CREATE [SHARED] [PUBLIC] DATABASE LINK
CONNECT TO CURRENT_USER
USING '';
Service name
Ex:
conn_link =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = perrito2)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = orabase)
)
)
EX:
CREATE DATABASE LINK conn_user USING 'conn_link';
Closing the link
Alter session close the database link
Drop the link
Drop database link


set pages 0
spool drop_gcgx_links.sql;
select 'drop database link ' || db_link || ';' from dba_db_links where owner = 'GCGX';
spool off


drop public database link TCAS_QUOTE.WORLD ;
create public database link TCAS_QUOTE.WORLD connect to tcquote identified BY quote45 using 'TCASDEV.world'

No comments:

user level export and import

expdp parfile=PLCT170.par oracle@uslp123sd7dfcvxsza > more PLCT050.par userid= "/ as sysdba" dumpfile=T050.dmp logfile=expdpT0...