[ The imperialist Japanese military must officially acknowledge and apologize for the coercion of young women into sexual slaves. / 幼い女性を性の奴隷にした帝國主義日本軍の?制性を公式に認め、謝罪しなければならない. ]

사용자

ID:
PW:

INDEX
01.게시판
게시판 [72]
02.File Book
File 자료실 [96]
Site Link [14]
개인폴더 [200]
03.Field Book
Altibase [19]
Tibero [30]
MS-SQL [28]
MySQL [47]
DB2 [79]
ORACLE [3099]
PSQL [135]
CUBRID [5]
기타정보 [170]
운영체제 [613]
04.Q/A Book
Q/A [53]
05.방명록
방명록 [54]
레벨업 [37]
구인/구직 [2]

기념일
Search
LINK
+ 가족 Hompy
+ DNSEver
IOTN :: Field Book :: ORACLE

 회원가입

ALTER SESSION CLOSE DATABASE LINK
최길호 [LIST]   2010-07-11 19:46:48, 조회 : 67,924

20190918 추가 alter session close database link 명령어를 수행한 세션 하나에만 영향을 주게 되며 타 세션에 영향을 주지 않습니다.

Create DB Link
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CREATE DATABASE LINK RDBNM
CONNECT TO scott2 IDENTIFIED BY tiger
USING '(description=(address=(protocol=TCP)
(host=node2-vip)(port=1521))(connect_data=(sid=db11g2)))';

ALTER SESSION CLOSE DATABASE LINK TEST
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SQL> select * from tab@RDBNM;
TNAME                          TABTYPE  CLUSTERID
------------------------------ ------- ----------
BONUS                          TABLE
DEPT                           TABLE
EMP                            TABLE
SALGRADE                       TABLE

SQL> ALTER SESSION CLOSE DATABASE LINK RDBNM;
ERROR:
ORA-02080: database link is in use


SQL> commit;
Commit complete.
or
SQL> rollback;
Rollback complete.
SQL> ALTER SESSION CLOSE DATABASE LINK RDBNM;
Session altered.
SQL> select * from tab@RDBNM;
TNAME                          TABTYPE  CLUSTERID
------------------------------ ------- ----------
BONUS                          TABLE
DEPT                           TABLE
EMP                            TABLE
SALGRADE                       TABLE


sample code
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
var v1 varchar2(32);
BEGIN
  SELECT TNAME
  INTO :v1
  FROM tab@RDBNM -- auto reconnect
  WHERE rownum = 1;
  commit; -- or rollback;
  EXECUTE IMMEDIATE 'ALTER SESSION CLOSE DATABASE LINK RDBNM'; -- Close Link Session
END;
/
print v1;

기타 메모
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
EXECUTE IMMEDIATE 'ALTER SESSION CLOSE DATABASE LINK RDBNM';
ORA-02080: database link is in use -- commit or rollback
ORA-02081: database link is not open -- select dblink

alter session close database link ;
dbms_session.close_database_link();
EXECUTE IMMEDIATE 'ALTER SESSION CLOSE DATABASE LINK ';

init.ora: open_links = 4 [default]
+ 11gR2 [ 에러 없이 6개 process 만들어짐 ]

[ RDBNM-server process kill test ]
# kill -9 1234
SQL> select * from tab@RDBNM;
ORA-24757: duplicate transaction identifier
ORA-02063: preceding line from RDBNM
SQL> ALTER SESSION CLOSE DATABASE LINK RDBNM;
Session altered.
SQL> select * from tab@RDBNM;
select * from tab@RDBNM
ORA-02079: cannot join a committing distributed transaction
ORA-02063: preceding line from RDBNM
SQL> exit
ERROR:
ORA-02056: 2PC: k2lcom: bad two-phase command number rdonly from coord
+ alert.log
~~~~~~~~~~~~
Sun Jul 11 22:18:24 2010
Error 2056 trapped in 2PC on transaction 3.21.11735. Cleaning up.
Error stack returned to user:
ORA-02056: 2PC: k2lcom: bad two-phase command number rdonly from coord
3.238.121.7


  LIST

제목 작성자 작성일 조회
Troubleshoot  ORA-03137: TTC    최길호 2018/04/24 1007057
WebLogic  weblogic cache    최길호 2018/02/28 237726
WebLogic  weblogic cluster session share [ 세션 공유 login.jsp login chk, weblogic.management.ManagementException: [Deployer:149188] ]    최길호 2018/03/03 124644
Troubleshoot  IMP-00003 ORA-32603: invalid FREEPOOLS LOB storage option value [ move lob table, lob index ]    최길호 2013/05/26 120262
Troubleshoot  proc, windows, vc 2003 , pcmake , Files\Microsoft은(는) 예상되지 않았습니다    최길호 2006/10/02 100304
Troubleshoot  ORA-00600: internal error code, arguments: [kcbzib_kcrsds_1]    최길호 2021/09/23 99119
Troubleshoot  dblink ORA-02068 ORA-03113 ORA-02080 [ ALTER SESSION CLOSE DATABASE LINK RDBNM; ]  [4]  최길호 2010/07/10 99104
WebLogic   WEB-INF/lib 우선 적용, index-directory-enabled 인덱스 디렉토리    최길호 2018/02/27 97347
WebLogic  java -jar fmw_12.2.1.3.0_wls.jar The OpenJDK JVM is not supported on this platform.    최길호 2018/02/06 86644
Troubleshoot  TRIGGER,Function ORA-02069 ORA-06512 ORA-04088 ORA-02070    최길호 2008/12/19 86563
Script  session monitor [ dbms_xplan sql binds ]  [2]  최길호 2010/06/30 85437
Troubleshoot  ORA-03297 Resizing Empty Datafile    최길호 2009/08/11 84527
Admin  dd copy datafile raw device , filesystem  [4]  최길호 2009/09/07 81860
SQL,PL*SQL  dbms_random 사용예  [1]  최길호 2010/04/12 81320
Troubleshoot  ODBC {Microsoft ODBC for Oracle}, ORA-12154, ODBC NA000 IM006 01000  [1]  최길호 2008/01/04 77731
Troubleshoot  ORA-12537 , <unknown connect data> * 12537  [2]  최길호 2009/11/21 68056
Troubleshoot  ALTER SESSION CLOSE DATABASE LINK    최길호 2010/07/11 67924
Admin  ORACLE과 MSSQL간의 DBLINK 방법    최길호 2008/09/19 65392
Troubleshoot  ld: 0711-224 WARNING: Duplicate symbol: p_xargc    최길호 2010/06/08 65365
Tool  RAC jdbc connection test [ thin java test.java sample ]  [3]  최길호 2010/06/14 61952

    목록보기   다음페이지 1 [2][3][4][5][6][7][8][9][10]..[155]   [다음 10개]
       

Copyright 1999-2024 Zeroboard / skin by 최길호(gilho.kr@gmail.com)
최근 댓글
2021/06/30
윈도우 서버에서 sqlplus .... ORA-...
by 최길호
2021/06/30
ORA-28500: connection from O...
by 최길호
2019/05/02
pkg 확인 SELECT * FROM AL...
by 최길호
최근 게시물
07/22
[ORACLE]
ogg Rolling over remote file [....
by 최길호
07/15
[ORACLE]
PRKF-1125 : multiple values sp....
by 최길호
07/04
[운영체제]
NIC add cli / nmcli device sho....
by 최길호