Re: Time the locks



On Feb 23, 10:24 pm, Mohit <mohitanch...@xxxxxxxxx> wrote:
Version: IDS 10

I asked this question in earlier post, and after that I tried to look
at CDI archives but didn't get the answer. I want to know if there is
any way to find out which lock is being held over certain period of
time on certain resource. I have below query to find out about the
locks:

select  sysdatabases.name database,             -- Database Name
                syssessions.username,           -- User Name
                syssessions.hostname,           -- Workstation
                syslocks.owner sid              --InformixSession ID
                syslocks.tabname
 from    syslocks, sysdatabases , outer syssessions
where   syslocks.tabname = "sysdatabases"       -- Find locks on
sysdatabases
  and      syslocks.rowidlk = sysdatabases.rowid -- Join rowid to
database
  and     syslocks.owner = syssessions.sid        -- Session ID to get
user info
order by 1;

After little bit of work and pieces of information I got, I have this
query. Is this query correct ?

select r.sid,r.address,l.owner,
dbinfo('utc_to_datetime', l.grtime),dbinfo('utc_current')-l.grtime,
s.pid,s.hostname, dbinfo('dbspace', l.partnum),st.tabname, s.progname
from
systxptab t, sysrstcb r,syslcktab l,flags_text f,sysscblst s,
systabnames st
where dbinfo('utc_current')-l.grtime > $SECS_OLD and t.address =
l.owner
and r.address = t.owner and f.tabname = "syslcktab" and l.type =
f.flags
and s.sid = r.sid and r.address = s.address and st.partnum =
l.partnum;

This query looks correct, but when I run, I don't get any rows. If I
remove r.address = s.address then it seems to be working, but I added
r.address = s.address so that I get only specific information about
lock associated with that table.
.



Relevant Pages

  • RE: Xlocking with a select statement
    ... named query expression, order clause, update clause, lock option ... A result table or the underlying base tables are updateable if the query ... A lock can be requested for the ...
    (microsoft.public.sqlserver.programming)
  • Its working :-)
    ... The query results that I get is without using the single quotes. ... Each test REQUEST has a Lock, Key and Pattern Combination (sometimes ... "Ken Sheridan" wrote: ...
    (microsoft.public.access.queries)
  • RE: Using Multiple Combo Boxes as Criteria for Query
    ... I Believe the query works the way it is written to, ... In my results table I wanted to track which lock they were using, ... "Ken Sheridan" wrote: ... In such circumstances I'd usually leave the bound column for Null, ...
    (microsoft.public.access.queries)
  • Re: A new proof of the superiority of set oriented approaches: numerical/time serie linear interpola
    ... reduces the number of passes through the data required to answer a query. ... What kind of lock? ... The reduction in execution time improves response time. ... by a "sufficiently intelligent" optimizer. ...
    (comp.databases.theory)
  • NETWORKIO?!?!
    ... I have a database here which is used for purchasing/stock etc. ... The queries return all ... if a query is run, this lock is exhibited. ...
    (microsoft.public.access.queries)