RE: Detailed Status of Locks ?
Posted in 1997
Jens,
You can use onstat -k , it will show you who owns the lock in the owner column,
match the owner number with the output of onstat -u.
The type of lock can be determined by reading the following columns:
* type
* tblsnum
* rowid
* key#/bsiz
TYPE OF LOCK
In the column type you can determine if it is a Shared lock ( S ) ,
Exclusive Lock ( HDR+X ) , Update Lock ( HDR+U ) ,
Intent Lock ( IX ).
Note: Some times you will find an expression lik HDR+SR , the R gives
the lock the meaning Shared Repeatable Read Lock.
DATABASE LOCK
If a process has lock on a database, you will see the number 100002 in the
column tblsnum and use the rowid column to find out which database it is
talking about. ( The first database created will have the lowest rowid, just
figure out in which order the databases were created in your online system).
TABLE LOCK
There will exist a value in the column tblsnum and the column rowid will have
a value of zero ( 0 ). The tblsnum value will correspond to the table`s partnum,
to get a report of the tables with their corresponding partnum try the following
select statement.
Select tabname, hex(partnum) from systables;
PAGE LOCK
If tblsnum has a valid value ( not 0 or not 100002 ),
the page lock can be identified by looking at the rowid column, if it ends with
00 (zero zero ) it will be a page lock.
ROW LOCK
If the tblsnum has a valid value ( not 0 or not 100002 ) and if the value in the
column rowid does not end with 00 ( zero zero) , it will be a row lock.
KEY LOCK
If the last column ( key#/bsiz) has the value K- followed by a number, it will
be a key lock.
BYTE LOCK
It will have a value in the column ( key#/bsiz) and will not containg the letter K-.
I hope this information will help you,
Regards,
PS: Have you read the book "INFORMIX UNLEASHED" from Sams lately?
Mario Estrada
==================Reply Separator===========================
----------
From: Jens Ebert[SMTP:ebert@mail.ppp.net]
Sent: Saturday, August 23, 1997 8:54 AM
To: informix-list@rmy.emory.edu
Subject: Detailed Status of Locks ?
Hi,
does someone has or knows abour a nice tool to show all the
locks set on certain objects in a Onlien database?
I would like to see who owns the locks and what kind of locks
they are.
Thank You,
Jens
ebert@mail.ppp.net