Xavier Tarafa wrote:
>
> Hi,
>
> I'm working with Informix dbaccess. I've noticed that one of the tables
> on the database I'm working with it's locked.
>
> How can I know who is locking the table?
1)Find the partnum of the table:
select hex(partnum) from systables where tabname = ...
or if the table is fragmented:
select hex(partn)
from sysfragments f, systables t
where f.tabid = t.tabid and tabname = ...
2) onstat -k | egrep <the 8 hex digits selected above without the "0x"
prefix>
Use egrep 'hx1|hx2|...' for multiple fragments.
3) onstat -u | fgrep <value from column 3 (owner) of the onstat -k>
Column 3 of this report is the session id
4) onstat -g ses <session id> to see what that session is doing. If
this is not enough info the top section of the report shows pid,
hostname, username, & tty. The fourth section shows database,
isolation level, and Front End (ESQL/4GL compiler, ODBC, or dbaccess)
version.
5) Use ps -fp <pid> on the host system to track down the application
being run.
Art S. Kagel