tables locked
Posted in 1999
Topics: Error Codes & Troubleshooting, Triggers, Constraints & Referential Integrity
Hi,
I have some triggers on some tables. I am trying to delete them,
I deleted some but for others it complains that the underlying
table of that trigger is locked by another user. This is what I
get for a trigger defined on table10:
# 242: Could not open database table (Kim.table10).
# 106: ISAM error: non-exclusive access.
I looked at my informix server host and 'onstat -g ses' does not
show that Kim owns any session. We normally use isql for any database
work and I don't see any process indicating that Kim has left any
isql or database access process running.
I am getting this error message for many tables and I don't think that
Kim was working on all tables at one time. And... the Kim is on vacation.
I want to solve the prob. without reboot online to clear up locks.
Questions:
1. Is there a way to tell who has locks on a table. The syslocks
table doesn't have this info ?.
2. Is there a way to clear the locks held by another user ?.
3. Will rebooting Kim's workstation help ? (assuming Kim only
was accessing the informix from her workstation only).
4. I sometimes get this error even though I am not accessing the
table. Sometimes just getting out of isql completely helps, sometimes
not. What should be done in that case. ?
Thanks for any info. Please all cc me reply if possible.
-AH
Atiq Hashmi wrote in message <381e0eaa@news.eclipse.net>...
>Hi,
>
>I have some triggers on some tables. I am trying to delete them,
>I deleted some but for others it complains that the underlying
>table of that trigger is locked by another user. This is what I
>get for a trigger defined on table10:
>
># 242: Could not open database table (Kim.table10).
># 106: ISAM error: non-exclusive access.
>
>I looked at my informix server host and 'onstat -g ses' does not
>show that Kim owns any session. We normally use isql for any database
>work and I don't see any process indicating that Kim has left any
>isql or database access process running.
That's because Kim owns the table, not the sessions causing you trouble.
>
>I am getting this error message for many tables and I don't think that
>Kim was working on all tables at one time. And... the Kim is on vacation.
>I want to solve the prob. without reboot online to clear up locks.
>
>
>Questions:
>1. Is there a way to tell who has locks on a table. The syslocks
> table doesn't have this info ?.
Yes is does, try the shell script below
------------------cut -----------------------
#!/bin/ksh
# Get program arguments
# owner will be the session id
if [[ $# -ne 1 ]]
then
echo ""
echo "Usage: who_locked tablename "
echo " example who_locked tablename"
echo ""
exit 1
fi
dbaccess sysmaster <<@EOF
select dbsname, type, owner, username, rowidlk from syslocks, syssessions
where tabname = '$1' and syslocks.owner = syssessions.sid;@EOF
------------------------cut---------------------------------
>2. Is there a way to clear the locks held by another user ?.
Get the session id from the owner column in the above script
and run onmode -z <sid>
>3. Will rebooting Kim's workstation help ? (assuming Kim only
> was accessing the informix from her workstation only).
No, since she most likely isn't causing you any trouble.
>4. I sometimes get this error even though I am not accessing the
> table. Sometimes just getting out of isql completely helps, sometimes
> not. What should be done in that case. ?
?
>
>Thanks for any info. Please all cc me reply if possible.
>-AH
Hope this helps,
Scott Kolaya
Related threads
- Posting from the Informix-list
- Migrating from IDS 9.40.UC6 to 11.50.UC3
- Ip for a network session
- questions onstat -g