Better locks info
Posted in 2000
Topics: Third-Party Tools & Monitoring
Does someone have a better lock monitoring tool besides the one at
iiug.org? (onstat -k interpreter?)
There was a script there, but frankly, at least in the environment I
currently find myself in, it is useless.....It reads syslocks, which
I've never happened to have done before, but it does not come back in a
reasonable amount of time (over 5 minutes.....by that time, I could have
isolated the lock that I was having problems with manually!)
I know better tools exist as I have used them before (a place I used to
work had a decent shell script for this, which I actually enhanced, but
of course that is the intellectual property of that former employer, so
I don't have it now - though I could probably recreate it if noone has
anything better).
Thanks,
Danny
the reply-to address will work, but the real (more permanent) one
is......dan_@_wright@big_@_foot.com (remove the 2 extra @ signs and
accompanying underscores)
Danny Wright wrote:
> Does someone have a better lock monitoring tool besides the one at
> iiug.org? (onstat -k interpreter?)
>
> There was a script there, but frankly, at least in the environment I
> currently find myself in, it is useless.....It reads syslocks, which
> I've never happened to have done before, but it does not come back in a
> reasonable amount of time (over 5 minutes.....by that time, I could have
> isolated the lock that I was having problems with manually!)
>
> I know better tools exist as I have used them before (a place I used to
> work had a decent shell script for this, which I actually enhanced, but
> of course that is the intellectual property of that former employer, so
> I don't have it now - though I could probably recreate it if noone has
> anything better).
>
> Thanks,
> Danny
> the reply-to address will work, but the real (more permanent) one
> is......dan_@_wright@big_@_foot.com (remove the 2 extra @ signs and
> accompanying underscores)
You could try the following if "who's locked out by whom?" is what you are
looking for? The script was designed specifically for sites that could have
a large number of locks active at any given time.
#!/bin/ksh
# rudy Thu Mar 4 11:28:22 EST 1999
# determines locking interactions - i.e which session is locking out
another
TMP_FILE=$0.tmp.$$
GET_ONSTATK=1
FOUND=0
ABNORMAL="Abnormal termination. Cleaning up and exiting..."
trap "echo $ABNORMAL;rm -f $TMP_FILE ; exit 1" 1 2 13 15
for SESS in `onstat -u | grep "L-" | cut -b 18-26`
do
FOUND=1
echo "Session $SESS locked by session ... \\c"
for LOCK in `onstat -u | grep " $SESS " | cut -b 45-52`
do
if [ $GET_ONSTATK = 1 ]
then
onstat -k | cut -b 1-26 > $TMP_FILE
GET_ONSTATK=0
fi
LOCKER=`grep "^${LOCK} " $TMP_FILE | awk '{ print $3 }'`
LOCKER_SESS=`onstat -u | grep "${LOCKER} " | cut -b 18-26`
echo $LOCKER_SESS
donedone
if [ $FOUND = 0 ]
then
echo 'No process waiting on locks'
fi
rm -f $TMP_FILE
############ End ############
Rudy
Related threads
- record locked
- who locks a record?
- Regarding Non-Default Page Sizes
- Don't Understand Table's Space Requirement