If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > IDS 9.3 Row lock ... Find and kill process

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-17-04, 12:53
kelvinpuk kelvinpuk is offline
Registered User
 
Join Date: Jul 2003
Posts: 23
Angry IDS 9.3 Row lock ... Find and kill process

I'm using IDs 9.3 on AIX 5.2.

Has ayone a script that will return the process ID of the user who has a row locked or table locked.
Reply With Quote
  #2 (permalink)  
Old 02-17-04, 14:47
jwain jwain is offline
Registered User
 
Join Date: Aug 2003
Location: Allentown pa
Posts: 41
Re: IDS 9.3 Row lock ... Find and kill process

Quote:
Originally posted by kelvinpuk
I'm using IDs 9.3 on AIX 5.2.

Has ayone a script that will return the process ID of the user who has a row locked or table locked.
nstat -u | awk '{print "onstat -g ses "$3}' > ses.out

view ses.out and revove the following lines
nstat -g ses
onstat -g ses Dynamic
onstat -g ses
onstat -g ses
onstat -g ses sessid

Just keep the onstat with the session numbers

Run ses.out > who.out

view who.out and do a find for the table that the row is locked. To unlock onmode -z session id
__________________
Jeff Wain
Reply With Quote
  #3 (permalink)  
Old 02-17-04, 14:48
jwain jwain is offline
Registered User
 
Join Date: Aug 2003
Location: Allentown pa
Posts: 41
Sorry thats onstat -u | awk '{print "onstat -g ses "$3}' > ses.out
__________________
Jeff Wain
Reply With Quote
  #4 (permalink)  
Old 02-18-04, 12:05
tmullins tmullins is offline
Registered User
 
Join Date: Aug 2003
Posts: 68
database sysmaster;
select dbsname, b.tabname, rowidr, keynum, e.txt type, d.sid owner,
g.username ownername, f.sid waiter, h.username waitname
from syslcktab a, systabnames b, systxptab c, sysrstcb d, sysscblst g,
flags_text e, outer (sysrstcb f , sysscblst h)
where a.partnum = b.partnum
and a.owner = c.address
and c.owner = d.address
and a.wtlist = f.address
and d.sid = g.sid
and e.tabname = 'syslcktab'
and e.flags = a.type
and f.sid = h.sid
into temp tmplocks with no log;

select dbsname,
tabname,
rowidr,
type[1,4],
owner,
ownername
from tmplocks
order by dbsname, tabname, owner;
drop table tmplocks;
Reply With Quote
  #5 (permalink)  
Old 02-19-04, 03:20
vpshriyan vpshriyan is offline
Registered User
 
Join Date: Nov 2003
Location: Mumbai, India
Posts: 92
Hi,

select unique
dbsname db,
tabname table,
case
when type="S" then "shared lock"
when type="IS" then "intent shared lock"
when type="SIX" then "shared intent excl lock"
when type="XS" then "shared key value by RR"
when type="IX" then "intent excl lock"
when type="X" then "exclusive lock"
when type="XR" then "excl key value by RR"
when type="U" then "update lock"
when type="B" then "byte lock"
else
"unknown lock type"
end lock_type,
lpad(owner,5) ses_id,
lpad(waiter,5) wait_id
from sysmaster:syslocks
where tabname != 'sysdatabases';

Regards,
Shriyan
Reply With Quote
  #6 (permalink)  
Old 03-12-04, 09:36
jwain jwain is offline
Registered User
 
Join Date: Aug 2003
Location: Allentown pa
Posts: 41
Re: IDS 9.3 Row lock ... Find and kill process

Redirect the output of this to a file and then do a find on the table that you think is locked. Note the session ID then perform onmode -z session ID Our dam developers lock tables here all the Time. Make sure that the code does dirty reads.

dbaccess sysmaster <<!
select * from sysprofile;
select * from syslocks;
!


Quote:
Originally posted by kelvinpuk
I'm using IDs 9.3 on AIX 5.2.

Has ayone a script that will return the process ID of the user who has a row locked or table locked.
__________________
Jeff Wain
Reply With Quote
  #7 (permalink)  
Old 03-12-04, 09:41
jwain jwain is offline
Registered User
 
Join Date: Aug 2003
Location: Allentown pa
Posts: 41
Re: IDS 9.3 Row lock ... Find and kill process

Redirect the output of this to a file and then do a find on the table that you think is locked. Note the session ID then perform onmode -z session ID Our dam developers lock tables here all the Time. Make sure that the code does dirty reads.

dbaccess sysmaster <<!
select * from sysprofile;
select * from syslocks;
!


Quote:
Originally posted by kelvinpuk
I'm using IDs 9.3 on AIX 5.2.

Has ayone a script that will return the process ID of the user who has a row locked or table locked.
__________________
Jeff Wain
Reply With Quote
  #8 (permalink)  
Old 02-17-05, 13:43
jwain jwain is offline
Registered User
 
Join Date: Aug 2003
Location: Allentown pa
Posts: 41
dbaccess sysmaster <<!
select * from sysprofile;
select * from syslocks;
!

Returns all table that have row or table locks. Displays the user with the lock run onmode -z session number to kill the process
__________________
Jeff Wain
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On