RE: cannot drop index
Posted in 2004
Very clever. It didn't work on my system, maybe a difference in versions.
The partnum comes out of sysmaster with hex values A through F in uppercase
and in onstat -g opn in lower case, so the grep partnum in line 9 never
picked up anything. Anyway, I hacked it up a little bit while
troubleshooting and this works on AIX 5.2 IDS 9.40.FC3.
And thanks, I've been trying to figure out a way to do this for a long time.
Bill
tabname=$1
echo "select hex(partnum) from systabnames where tabname='$tabname'" |
dbaccess sysmaster | grep "^0x" |
while read partnum
do
partnum_lower=`echo $partnum | awk '{ printf("%s",tolower($1)); }'`
tid_list=`onstat -g ath | grep "^ [1-9]" | awk '{print $1}'`
for x in $tid_list; do
onstat -g opn $x | grep $partnum_lower | awk '{if($8)print
$1}' | sort -u |
while read tid
do
onstat -g ath | grep " $tid "| awk '{print $3}' |
while read rstcb
do
echo $rstcb
onstat -u | grep $rstcb | awk '{print $3}'
done
done
donedone
> -----Original Message-----
> From: timothy.a.brown@marconi.com [SMTP:timothy.a.brown@marconi.com]
> Sent: Thursday, April 15, 2004 4:20 PM
> To: malcolm.weallans@btopenworld.com
> Cc: informix-list@iiug.org; owner-informix-list@iiug.org
> Subject: Re: cannot drop index
>
>
> You might try to find the session using something like,
>
> tabname=f4uhlp
>
> echo "select hex(partnum) from systabnames where tabname='$tabname'" |
> dbaccess sysmaster | grep "^0x" |
> while read partnum
> do
> onstat -g ath | grep "^ [1-9]" | awk '{print "-g opn",$1}' |
> onstat -i |
> grep $partnum | awk '{if($8)print $1}' | sort -u |
> while read tid
> do
> onstat -g ath | grep " $tid "| awk '{print $3}' |
> while read rstcb
> do
> onstat -u | grep $rstcb | awk '{print $3}'
> done
> done> done
>
> Good luck,
> -Tim
>
>
>
>
>
> malcolm.weallans@btope
>
> nworld.com (malcolm) To:
> informix-list@iiug.org
> Sent by: cc:
>
> owner-informix-list@ii Subject: cannot drop
> index
> ug.org
>
>
>
>
>
> 04/15/2004 12:13 PM
>
> Please respond to
>
> malcolm.weallans
>
>
>
>
>
>
>
>
>
> I am having problems dropping an index. The system complains that I
> don't have exclusive access, but there are no locks on the index or
> the table.
>
> Any ideas?
>
> Malcolm
>
>
>
>
> sending to informix-list
sending to informix-list