database.sarang.net
UserID
Passwd
Database
DBMS
MySQL
PostgreSQL
Firebird
Oracle
ㆍInformix
Sybase
MS-SQL
DB2
Cache
CUBRID
LDAP
ALTIBASE
Tibero
DB 문서들
스터디
Community
공지사항
자유게시판
구인|구직
DSN 갤러리
도움주신분들
Admin
운영게시판
최근게시물
Informix Tutorials 1519 게시물 읽기
 News | Q&A | Columns | Tutorials | Devel | Files | Links
No. 1519
session's lock release
작성자
정재익(advance)
작성일
2002-10-19 19:23
조회수
14,246

▒▒ 특정 테이블에 lock을 갖고 있는 세션 찾기 ▒▒

 

원본출처 : http://bbs4u.lycos.co.kr/Board/Basic/ReadBoard.asp?__lk_groupid=board5415&__lk_bbsid=1&__lk_subBBSID=fm541474&number=127&page=1

 

1.dbaccess 를 이용하여 아래의 쿼리를 실행시켜 해당 테이블의 partnum을 구한다.

 

select hex(partnum) from systables where tabname = 'mytable';

 

 

2.결과에서 얻은 partnum을 이용하여 현재 lock을 갖고 있는 session의 address를 구한다.

 

onstat -k |grep PARTNUM

(단, 이때 사용하는 PARTNUM은 0x를 제외한 값을 사용하며, alphabet이 들어있는 경우에는 소문자를 사용한다. )

 

 

3. session address를 이용하여 세션번호를 구한다.

 

onstat -u|grep SESS_ADDR

(단 SESS_ADDR은 2)의 결과에서 3번째 필드값임 )

 

 

4.구한 세션번호를 이용하여 해당 세션이 문제의 작업을 진행하던 세션인지 확인한다.

 

onstat -g ses SID

(단, SID는 3)의 결과에서 3번째 필드값임 )

 

 

5. 해당 세션을 종료시킨다.

 

onmode -z SID

 

 

6. 2)를 반복하여 해당 lock이 release 되었는지 확인한다.

 

 

 

/opt/informix ] $ dbaccess stores7 -

 

Database selected.

 

> select hex(partnum) from systables where tabname = 't1';

 

 

(expression)

 

0x001000BA

 

1 row(s) retrieved.

 

/opt/informix ] $

/opt/informix ] $

/opt/informix ] $ onstat -k |grep 1000ba

a116e20 0 afa53c8 a116dec HDR+IX 1000ba 0 0

a116e54 0 afa53c8 a116e20 HDR+X 1000ba ea900 0

a116e88 0 afa53c8 a116e54 HDR+X 1000ba ea300 1

/opt/informix ] $ onstat -u|grep afa53c8

afa53c8 Y-BP--- 60 informix 4 b29b530 0 4 1 0

/opt/informix ] $ onstat -g ses 60

Informix Dynamic Server Version 7.31.UC7 -- On-Line -- Up 5 days 20:39:25 -- 23696 Kbytes

 

session #RSAM total used

id user tty pid hostname threads memory memory

60 informix 4 19174 kor-oliv 1 40960 28384

 

tid name rstcb flags curstk status

98 sqlexec afa53c8 Y-BP--- 1392 afa53c8 cond wait(netnorm)

 

Memory pools count 1

name class addr totalsize freesize #allocfrag #freefrag

60 V b22a018 40960 12576 273 6

 

name free used name free used

overhead 0 120 scb 0 96

opentable 0 1960 filetable 0 536

ru 0 224 log 0 2152

temprec 0 840 keys 0 48

gentcb 0 8528 ostcb 0 2496

sqscb 0 7792 rdahead 0 112

hashfiletab 0 280 osenv 0 1696

sqtcb 0 1320 fragman 0 184

 

Sess SQL Current Iso Lock SQL ISAM F.E.

Id Stmt type Database Lvl Mode ERR ERR Vers

60 - stores7 CR Not Wait 0 0 7.31

 

Last parsed SQL statement :

insert into t1(c1) values ('11111111')

 

/opt/informix ] $ onmode -z 60

[Top]
No.
제목
작성자
작성일
조회
1522isolation Levels 설명
정재익
2002-10-19
9652
1521SQL성능향상을위한방법
정재익
2002-10-19
11925
1520체크포인트
정재익
2002-10-19
10045
1519session's lock release
정재익
2002-10-19
14246
1518Informix IDS9.* 의 강력한 DataLoading Tool
정재익
2002-10-19
10829
1510인포믹의 개요
정재익
2002-10-19
8341
1228Java-DB (JDBC) 연결
정재익
2002-01-07
7872
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2023 DSN, All rights reserved.
작업시간: 0.050초, 이곳 서비스는
	PostgreSQL v16.1로 자료를 관리합니다