Locked tables
Posted in 1999
Topics: General Discussion
Is there a way to unlock a table w/o restarting the server? Does Informix or another party have a tool that does this?
In article <s41fugj2a4r81@corp.supernews.com>,
"David Palmer" <dapalmer@imt.net> wrote:
>
> Is there a way to unlock a table w/o restarting the server?
> Does Informix or another party have a tool that does this?
First, PLEASE do not post HTML or other MIME formats, many folk do not
use HTMP/MIME aware news/mail readers.
Now, second, please post version and platform information. For example
if you are using IDS there is no way for a table to become locked
unless there us a currently active session locking it. Onstat -k will
show you the locks, look for a lock with the table's partnum displayed
(see the systables or sysfragments table for partnums) and get the
owner column value and look it up on the onstat -u report to get the
session id. Next run onstat -g ses <session id> and find the pid and
username of the user holding the lock. Get the user to end what he/she
is doing or if you cannot make contact or the session is hung/defunct
(happens with PC clients) kill the session with onmode -z <session id>
as Informix or root. This should free the lock after any required
rollback activity has completed.
If you are using Informix Standard Engine (SE) it IS possible, on some
platforms, for a crashed session to leave a table in a locked state.
Clearing the lock is also platform dependent as SE uses different
locking strategies on different platforms.
Now for the REAL question. Why are you trying to clear a table lock?
For example, need a row count and SELECT COUNT(*) gets a table locked
message? SET ISOLATION DIRTY READ will let the select complete with
the shared lock on the sytem catalog (which is what is preventing the
count). Need to run a dbschema? Get my myschema.ec utility from the
IIUG Software Repository it will do ANYTHING that dbschema will do
except display data distributions and MUCH MUCH more.
So post your platform info and what you are trying to accomplish and
someone will help you, if I have not already ;-)
Art S. Kagel
Sent via Deja.com http://www.deja.com/
Before you buy.