행위

ORACLE DBLINK

DB CAFE

1 DB Link 보기

  • 기존 DB LINK 변경 안됨. 삭제 후 생성.
SELECT SUBSTRB(U.NAME, 1, 10) AS OWNER
     , SUBSTRB(L.NAME, 1, 20) AS DB_LINK
     , SUBSTRB(L.HOST, 1, 10) AS HOST
     , SUBSTRB(L.USERID || '/' || L.PASSWORD, 1, 15) AS USERPASS
  FROM SYS.LINK$ L
     , SYS.USER$ U
 WHERE L.OWNER# = U.USER#;

1.1 DBLINK 생성

CREATE [PUBLIC] DATABASE LINK GLS_TEST 
CONNECT TO ol00 identified by ol00 
  USING '(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=2.2.5.9)(Port=1521)))(CONNECT_DATA=(SERVICE_NAME=XXXX)))';

1.1.1 DBLINK 간단 생성

CREATE [PUBLIC] DATABASE LINK GLS_TEST 
CONNECT TO ol00 identified by ol00 
  USING '111.222.333.444:1521/SID';

2 DBLINK 수정

alter명령 불가, 삭제 후 재생성

CREATE [PUBLIC] DATABASE LINK DL_KOREX 
CONNECT TO ol00 identified by ol00 
 USING '(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=2.2.6.9)(Port=1521)))(CONNECT_DATA=(SERVICE_NAME=XXX)))';