Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Mohit Anchlia (IDS 10) wanted a script to find sessions stuck on locks, buffers, checkpoints or heavy log use, and planned to parse onstat -u. Scottishpoet suggested upgrading to IDS 11 for OpenAdmin Tool; Mohit said not at this point. He then posted a shell script using onstat -g tpf, ath, u and ses to find processes writing the most logical logs, and asked for review. No replies.
Auto-generated by Claude from the posts below — may be imperfect; read the full thread.
Version: IDS 10
I am trying to write a script that will find out those threads or
sessions that are stuck at particular step for more than x mts. It
could be stuck to acquire a lock on a resouce, or waiting for buffer
or checkpoint or using lot of logical logs or may be just running a
particular DB operation like long updates, inserts etc. I was thinking
of using output from onstat -u and parse first flag 1 and run again
after x mts and compare and spit out the details to the user. However,
I am not really sure if it covers all the scenarios. What's the better
way of writing such a script ?
On Jan 16, 12:43 am, mohitanch...@gmail.com wrote:
> Version: IDS 10
>
> I am trying to write a script that will find out those threads or
> sessions that are stuck at particular step for more than x mts. It
> could be stuck to acquire a lock on a resouce, or waiting for buffer
> or checkpoint or using lot of logical logs or may be just running a
> particular DB operation like long updates, inserts etc. I was thinking
> of using output from onstat -u and parse first flag 1 and run again
> after x mts and compare and spit out the details to the user. However,
> I am not really sure if it covers all the scenarios. What's the better
> way of writing such a script ?
Is upgrading to IDS 11 a possibility?
The OpenAdmin Tool provided with IDS 11 probably provides a lot of the
information you are looking to capture.
On Jan 16, 5:29 am, scottishpoet <drybur...@yahoo.com> wrote:
> On Jan 16, 12:43 am, mohitanch...@gmail.com wrote:
>
> > Version: IDS 10
>
> > I am trying to write a script that will find out those threads or
> > sessions that are stuck at particular step for more than x mts. It
> > could be stuck to acquire a lock on a resouce, or waiting for buffer
> > or checkpoint or using lot of logical logs or may be just running a
> > particular DB operation like long updates, inserts etc. I was thinking
> > of using output from onstat -u and parse first flag 1 and run again
> > after x mts and compare and spit out the details to the user. However,
> > I am not really sure if it covers all the scenarios. What's the better
> > way of writing such a script ?
>
> Is upgrading to IDS 11 a possibility?
>
> The OpenAdmin Tool provided with IDS 11 probably provides a lot of the
> information you are looking to capture.
Not at this point.
On Jan 16, 10:10 am, mohitanch...@gmail.com wrote:
> On Jan 16, 5:29 am, scottishpoet <drybur...@yahoo.com> wrote:
>
>
>
>
>
> > On Jan 16, 12:43 am, mohitanch...@gmail.com wrote:
>
> > > Version: IDS 10
>
> > > I am trying to write a script that will find out those threads or
> > > sessions that are stuck at particular step for more than x mts. It
> > > could be stuck to acquire a lock on a resouce, or waiting for buffer
> > > or checkpoint or using lot of logical logs or may be just running a
> > > particular DB operation like long updates, inserts etc. I was thinking
> > > of using output from onstat -u and parse first flag 1 and run again
> > > after x mts and compare and spit out the details to the user. However,
> > > I am not really sure if it covers all the scenarios. What's the better
> > > way of writing such a script ?
>
> > Is upgrading to IDS 11 a possibility?
>
> > The OpenAdmin Tool provided with IDS 11 probably provides a lot of the
> > information you are looking to capture.
>
> Not at this point.- Hide quoted text -
>
> - Show quoted text -
To start with, I wrote this small script that will report those
processes that are writing most logical logs, this script is an
attempt to identify processes that could potentially lead to long
transactions and also report high usage of logical logs, please
review:
#Get that process that's writing most logical logs
onstat -g tpf | tr -s " " | sort -nr -k 16 | head > onstat.tpf.out
for i in `cat onstat.tpf.out|cut -d " " -f1`do
if [ $i -gt 0 ]
then
echo "------ LOGICAL LOG $i START"
user_add=`onstat -g ath|grep $i|tr -s " "|cut -d " " -f4`
if [ `echo "$user_add"|grep -c "[a-z]` -gt 0 ]
then
sess_id=`onstat -u |grep $user_add|cut -d " " -f3`
if [ `echo "$sess_id"|grep -c "[0-9]"` -gt 0 ]
then
u_pid=`onstat -g ses|grep "^$sess_id"|tr -s " "|cut -d "
" -f4`
echo "Process Info "
ps -eaf|grep "$u_pid"
fi
fi
echo "------ LOGICAL LOG $i END"
fi
done
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.