TECH
QUESTION
자주하는 질문답변 입니다.
Oracle
작성자 | 유건데이타 | 등록일 | 2015-05-07 |
제목 | DATABASE LINK 사용 방법 | ||
---|---|---|---|
DATABASE LINK 사용 방법
======================= 먼저 한글 data간의 전달을 위해 두 db간의 character set이 같아야 합니다. character set을 확인하는 방법은 sqlplus system/manager select * from v$nls_parameters; 하여 보면 nls_characterset에 대한 값이 나옵니다. 예를 위해 다음과 같은 환경을 가정하겠습니다. HOST NAME : HP7 - SUN7 ORACLE_SID : ORA7 - ORATEST 이라 할 때 1) HP7 에서 SUN7로 DB LINK 생성하기. scott/tiger 로 Login SQL*NET V1의 경우 SQL> create public database link HP7TOSUN6 connect to scott identified by tiger using 't:SUN7:ORATEST'; (rdbms 7.3 이상은 SQL*NET v2 를 사용하십시오) SQL*NET V2의 경우 SQL> create public database link HP7TOSUN7 connect to scott identified by tiger using 'ORATEST'; 로 하면 된다. 이 때 V2인 경우의 ORATEST는 $ORACLE_HOME/network/admin/ directory의 tnsnames.ora file 내에 지정된 service name이다. tnsnames.ora의 service name이 잘 setting 되어 있는지 확인하는 방법 : SQL*Plus scott/tiger@service name했을 때, SQL*Plus에 log-in되어야 합니다. 2> SUN7 에 있는 TABLE의 select 및 view(view는 필요에 따라 생성) 작성, HP에서 작업 SQL> select * from emp@HP7TOSUN7; SQL> create view emp_view as select * from emp@HP7TOSUN7 a where a.deptno = 10; 3> HP7 에서 SYNONYM을 생성하여 사용하는 경우 SQL> create synonym emp for emp@HP7TOSUN7; SQL> select * from emp; 로 한다면 간단히 분산 DB의 환경에서 사용할 수 있습니다. select를 제외한 DML(insert, update, delete)을 하려면, sql*plus log-in 시에 다음과 같은 option이 display 되어야 합니다. SQL*Plus: Release 3.3.3.0.0 - Production on Mon Jan 19 14:18:47 1998 Copyright (c) Oracle Corporation 1979, 1996. All rights reserved. Connected to: Oracle7 Server Release 7.3.3.4.0 with the 64-bit option - Production Release With the distributed, ...... ------------------------------------ remote 작업의 예 select * from table_name@HP7TOSUN7; insert into table_name@HP7TOSUN7; delete table_name@HP7TOSUN7; ... (단 SERVER TO SERVER로 NETWORK 환경이 구축되어 있어야 하고, listener 가 반드시 떠 있어야 합니다.) 출처 : Technical Bulletin (Korean) |
Comment | |||
---|---|---|---|
등록된 코멘트가 없습니다. |