DBLINK 로 Select 문 실행시 추가 처리사항과 관련된 질문입니다. 0 1 7,412

by DJ [Oracle Admin] dblink distributed transaction [2015.01.09 10:44:25]


안녕하세요. 궁금한게 있어 문의 드립니다.

dblink 사용하여 select 문을 실행하는 경우입니다.
예를 들면:
select *
from emp a, dept@remote1 b
where a.dept_no = b.dept_no;

1. dblink를 사용하게 되면 분산 transaction 으로 select 문을 실행하였을 경우에도 (rollback segment 하나에 관련 lock이 생성되어) commit 을 쳐줘야 된다는 글이 좀 있는데요.
혹시 이와 관련해서 경험이나 공식문서/자료가 있으신분 계신가요?

2. 또한 dblink 사용시는 remote 쪽 session 이 계속 유지되어 쿼리 수행 후 session 을 종료해 줘야 된다. 혹시 이에 대해 관련 경험이나 자료가 있으시면 공유 부탁드립니다.

3. 혹시 dblink 사용하여 개발할 때 참조할만한 개발 guide 같은거 있는지요?

감사합니다.

by DJ [2015.01.12 10:05:30]

관련 내용을 찾아서 아래 첨부합니다. 어떻게 개발자 분들께 Guide해야 될 지는 더 연구해 봐야 겠네요.

---------------------------------------------------------------------------------------------------

Oracle Database Administrator's Guide

Controlling Connections Established by Database Links

......
Note that when you issue a SELECT statement across a database link, a transaction lock
is placed on the undo segments. To rerelease the segment, you must issue a COMMIT or
ROLLBACK statement.

Terminating remote connections established using database links is useful for
disconnecting high cost connections that are no longer required by the application.
You can terminate a remote connection and session using the ALTER SESSION statement
with the CLOSE DATABASE LINK clause. For example, assume you issue the following
transactions:
SELECT * FROM emp@sales;
COMMIT;
The following statement terminates the session in the remote database pointed to by
the sales database link:
ALTER SESSION CLOSE DATABASE LINK sales;
To close a database link connection in your user session, you must have the ALTER
SESSION system privilege.

댓글등록
SQL문을 포맷에 맞게(깔끔하게) 등록하려면 code() 버튼을 클릭하여 작성 하시면 됩니다.
로그인 사용자만 댓글을 작성 할 수 있습니다. 로그인, 회원가입