Tuesday, 27 March 2007

kill the sessions held locks on the dbspace

1.Execute command "onstat -k".It will list out the locks in the database

sv210cwm3% onstat -k

IBM Informix Dynamic Server Version 9.40.UC4X3 -- On-Line -- Up 20:41:00 -- 410624 Kbytes

Locks
address wtlist
owner lklist type tblsnum rowid key#/bsiz
1010efe0 0
151f86f0 0 HDR+S 100002 204 0
1 active, 128000 total, 32768 hash buckets, 0 lock table overflows

2. Get the session id of the userthread which held the lock by grep with owner id "onstat -u | grep 151f86f0"

sv210cwm3# onstat -u | grep 151f86f0

address flags sessid user tty wait tout locks nreads nwrites
151f86f0 Y--P---
472 svplus - 1621a9f8 0 1 0 0

3. Now "472" is the session id.Kill the session using the command "onmode -z 472"

4.Now verify no locks are held on the database by executing "onstat -k "

No comments: