Re: please help! eror 252
Posted in 1997
Oscar Goldes wrote:
>
> Can you explain this?
> (Online 7.2)
>
> dbschema stops with error code -252, ISAM code -113:
>
> It happens very often, sometimes it finishes without errors
> The explanation of the codes is
>
> -252 Cannot get system information for table.
>
> The database server is unable to read from one or more of
> the system catalog tables. ......
>
> -113 ISAM error: the file is locked.
>
> The file (table) that was requested has been opened in
> exclusive mode by another user request. In systems that use
> files for locking, a tablename.lok file exists. Possibly such a
> file is residual, left behind when another program
> terminated abnormally. If you can be sure that is the case,
> you can release the lock by emptying that file. Lock files are
> not used in many systems, and are never used with the
> INFORMIX-OnLine Dynamic Server.
>
> C-ISAM programs: Rerun the program after the file has been
> unlocked. SQL products: Tables are locked explicitly using
> the LOCK TABLE statement, and implicitly during the
> execution of the CREATE INDEX and ALTER TABLE
> commands. Rerun the program or query when the table has
> been unlocked.
>
>
> Who locks the system tables? neither create index nor alter table are being executed by any user.
> There are no lock table statements on system tables.
>
> Thanks for any help you can give me.
It means exactly what you see in the error statement. The table is
locked and you cannot access system catalog tables for that specific
table.
Try running this script and then specify the table in question.
clear
if [ $# -lt 1 ]
then
echo "Usage: wholocked tablename"
echo " wholocked ?"
echo
exit 0
fi
if [ $1 = "?" ]
then
echo
echo "Usage: wholocked tablename"
echo
echo "wholocked displays who currently is holding a lock against"
echo "the specified table, who is waiting for the lock to be rel"
echo "eased and the sql data on the statement locking the table."
echo
exit 0
fi
x=`echo "select owner, waiter from syslocks where tabname =\\""$1\\
"\\" and dbsname != 'sysmaster' " \\
| dbaccess sysmaster - 2> /dev/null | sed "1,4d"`
zzz=`echo $x | wc -w`
if [ $zzz -eq 1 ]
then
wl=`echo $x | cut -f1 -d" "`
else
wl=`echo $x | cut -f1 -d" "`
ww=`echo $x | cut -f2 -d" "`
fi
if [ x$wl = "x" ]
then
echo
echo "No locks on '"$1"'"
echo
exit
fi
wholocked=`onstat -g ses | grep $wl | cut -c10-17`
if [ x$ww = "x" ]
then
whowaits="NOBODY"
else
whowaits=`onstat -g ses | grep $ww | cut -c10-17`
fi
echo
echo "User '"$wholocked "' has lock on '"$1"'"
echo "'"$whowaits"' waiting for table."
onstat -g sql $wl | grep -v "INFORMIX-OnLine"
--
Jorge Torralba Intel
Information Technology HF2-71
(503)696-4587 5200 NE Elam Young Parkwa
jorge_torralba@ccm2.hf.intel.com Hillsboro, Or 97124
=============================================================
Any views or opinions expressed by me do not reflect those of
Intel Corp.