Re: Detailed Status of Locks ?
Posted in 1997
"Art S. Kagel" <kagel@bloomberg.com> wrote:
:Jens Ebert wrote:
:>
:> 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.
:
:In informix 7.xx:
:
:select * -- Or whatever you are interested in.
: from sysmaster:syslocks lock, sysmaster:syssessions sess
: where lock.owner = sess.sid
: and dbsname = "MYDATABASE"
: and tabname = "MYTABLE";
This is fine, but just for information: on 7.10.UC1 on SCO it never
returns any data. It had to be rewritten as follows to work:
select * -- Or whatever you are interested in.
from sysmaster:syslocks, outer sysmaster:syssessions
where syslocks.owner = syssessions.sid
and dbsname = "MYDATABASE"
and tabname = "MYTABLE";
It needed an outer in the from clause and renaming the syslocks table
to lock gave a syntax error. (It worked renaming it to locks, but I
dislike renaming tables like this when it isn't needed for a self
join.)
All this may be due to the use of views that happens in the background
here. With newer versions I would assume the original select works
fine. I haven't had the time to test it.
Nils.Myklebust@idg.no
NM Data AS, P.O.Box 9090 Gronland, N-0133 Oslo, Norway
My opinions are those of my company
The Informix FAQ is at http://www.iiug.org