dbTalk Databases Forums  

Ingres dispatch_command ?

comp.databases.ingres comp.databases.ingres


Discuss Ingres dispatch_command ? in the comp.databases.ingres forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Zfs..
 
Posts: n/a

Default Ingres dispatch_command ? - 01-27-2011 , 04:56 AM






Hi,

Odd query.

In mysql I can run a dtrace script as follows to list all sql
statements being executed by the mysql process

#!/usr/sbin/dtrace -qs
pid$1::*dispatch_command*:entry
{
printf("%d::%s\n",tid,copyinstr(arg2));
}

This obviously fails when I run it against an Ingres DBMS server.

*dispatch_command*:entry does not match any probes

My question then is, does anybody know what the appropiate probe to
Ingres would be to get the same information ?

Reply With Quote
  #2  
Old   
Paul Mason
 
Posts: n/a

Default Re: [Info-Ingres] Ingres dispatch_command ? - 01-27-2011 , 06:03 AM






Hi,

I don't know dtrace but it looks like what this is doing is finding
instances where the dispatch_command() function is called and outputting
the second argument which presumably is the query text.

There isn't really an equivalent function you could use unless you can
navigate through various pointers and structures.

However if what you want is query tracing then I'd recommend trace point
SC930 - here's a little script to set it up.

#!/bin/sh
#
# turn on SC930 query tracing
#
# parameters:
# $1 - directory for logs (must exist) defaults to pwd
# $2 - trace level 1=queries, 2=queries+qeps default=1

LOGDIR=$1
if [ "$LOGDIR" = "" ]
then
LOGDIR=`pwd`
fi
echo "SC930 Log Directory set to $LOGDIR"
TRACE_LVL=$2
if [ "$TRACE_LVL" = "" ]
then
TRACE_LVL=1
fi
echo "SC930 trace level set to $LOGDIR"

if [ ! -d $LOGDIR ]
then
echo $LOGDIR does not exist
exit 2
fi

cd $LOGDIR
rm -f sess*

for dbms in `iigcfid iidbms`
do
export II_DBMS_SERVER=$dbms
echo II_DBMS_SERVER=$dbms

sql -s iidbdb <<!
set trace record '$LOGDIR';
set trace point sc930 $TRACE_LVL ;
\p\g\q
!
done

HTH
Paul

Quote:
-----Original Message-----
From: info-ingres-bounces (AT) kettleriver...ting (DOT) com [mailto:info-
ingres-bounces (AT) kettleriverconsulting (DOT) com] On Behalf Of Zfs..
Sent: 27 January 2011 10:57
To: info-ingres (AT) kettleriverconsulting (DOT) com
Subject: [Info-Ingres] Ingres dispatch_command ?

Hi,

Odd query.

In mysql I can run a dtrace script as follows to list all sql
statements being executed by the mysql process

#!/usr/sbin/dtrace -qs
pid$1::*dispatch_command*:entry
{
printf("%d::%s\n",tid,copyinstr(arg2));
}

This obviously fails when I run it against an Ingres DBMS server.

*dispatch_command*:entry does not match any probes

My question then is, does anybody know what the appropiate probe to
Ingres would be to get the same information ?
_______________________________________________
Info-Ingres mailing list
Info-Ingres (AT) kettleriverconsulting (DOT) com

http://ext-cando.kettleriverconsulti...fo/info-ingres

Reply With Quote
  #3  
Old   
Ingres Forums
 
Posts: n/a

Default Re: Ingres dispatch_command ? - 01-27-2011 , 06:53 AM



Paul, thanks! I did not know about iigcfid til now! I used iinamu in my
scripts to find DBMS IDs.


--
dejan

Reply With Quote
  #4  
Old   
Zfs..
 
Posts: n/a

Default Re: Ingres dispatch_command ? - 01-27-2011 , 07:16 AM



On Jan 27, 12:03*pm, "Paul Mason" <Paul.Ma... (AT) ingres (DOT) com> wrote:
Quote:
Hi,

I don't know dtrace but it looks like what this is doing is finding
instances where the dispatch_command() function is called and outputting
the second argument which presumably is the query text.

There isn't really an equivalent function you could use unless you can
navigate through various pointers and structures.

However if what you want is query tracing then I'd recommend trace point
SC930 - here's a little script to set it up.

#!/bin/sh
#
# turn on SC930 query tracing
#
# parameters:
# * * * * * * * $1 - directory for logs (must exist) defaults to pwd
# * * * * * * * $2 - trace level 1=queries, 2=queries+qeps default=1

LOGDIR=$1
if [ "$LOGDIR" = "" ]
then
* LOGDIR=`pwd`
fi
echo "SC930 Log Directory set to $LOGDIR"
TRACE_LVL=$2
if [ "$TRACE_LVL" = "" ]
then
* TRACE_LVL=1
fi
echo "SC930 trace level set to $LOGDIR"

if [ ! -d $LOGDIR ]
then
* echo $LOGDIR does not exist
* exit 2
fi

cd $LOGDIR
rm -f sess*

for dbms in `iigcfid iidbms`
do
* export II_DBMS_SERVER=$dbms
* echo II_DBMS_SERVER=$dbms

* sql -s iidbdb <<!
set trace record '$LOGDIR';
set trace point sc930 $TRACE_LVL ;
\p\g\q
!
done

HTH
Paul



-----Original Message-----
From: info-ingres-boun... (AT) kettleriverconsulting (DOT) com [mailto:info-
ingres-boun... (AT) kettleriverconsulting (DOT) com] On Behalf Of Zfs..
Sent: 27 January 2011 10:57
To: info-ing... (AT) kettleriverconsulting (DOT) com
Subject: [Info-Ingres] Ingres dispatch_command ?

Hi,

Odd query.

In mysql I can run a dtrace script as follows to list all sql
statements being executed by the mysql process

#!/usr/sbin/dtrace -qs
pid$1::*dispatch_command*:entry
{
* * printf("%d::%s\n",tid,copyinstr(arg2));
}

This obviously fails when I run it against an Ingres DBMS server.

*dispatch_command*:entry does not match any probes

My question then is, does anybody know what the appropiate probe to
Ingres would be to get the same information ?
_______________________________________________
Info-Ingres mailing list
Info-Ing... (AT) kettleriverconsulting (DOT) com

http://ext-cando.kettleriverconsulti...fo/info-ingres
Thanks for the reply Paul.

Thats exactly what I need. Although, I'm not sure how to stop the
logging after I execute the script ?

Reply With Quote
  #5  
Old   
Karl Schendel
 
Posts: n/a

Default Re: [Info-Ingres] Ingres dispatch_command ? - 01-27-2011 , 07:25 AM



On Jan 27, 2011, at 8:16 AM, Zfs.. wrote:
Quote:
[re sc930]
Thats exactly what I need. Although, I'm not sure how to stop the
logging after I execute the script ?
After you are finished logging, issue a
set notrace point sc930
sql statement in any session, e.g.
sql iidbdb
set notrace point sc930
\g
\q


Karl

Reply With Quote
  #6  
Old   
Zfs..
 
Posts: n/a

Default Re: Ingres dispatch_command ? - 01-27-2011 , 07:31 AM



On Jan 27, 1:25*pm, Karl Schendel <schen... (AT) kbcomputer (DOT) com> wrote:
Quote:
On Jan 27, 2011, at 8:16 AM, Zfs.. wrote:

[re sc930]
Thats exactly what I need. Although, I'm not sure how to stop the
logging after I execute the script ?

After you are finished logging, issue a
set notrace point sc930
sql statement in any session, e.g.
sql iidbdb
set notrace point sc930
\g
\q

Karl
Thanks Karl.

Most helpful.

Reply With Quote
  #7  
Old   
Zfs..
 
Posts: n/a

Default Re: Ingres dispatch_command ? - 01-27-2011 , 10:40 AM



On Jan 27, 1:25*pm, Karl Schendel <schen... (AT) kbcomputer (DOT) com> wrote:
Quote:
On Jan 27, 2011, at 8:16 AM, Zfs.. wrote:

[re sc930]
Thats exactly what I need. Although, I'm not sure how to stop the
logging after I execute the script ?

After you are finished logging, issue a
set notrace point sc930
sql statement in any session, e.g.
sql iidbdb
set notrace point sc930
\g
\q

Karl
Karl,

Thanks for your reply ( again )

One question. Im trying to put together a startlogging and stoplogging
script.

Pauls tidy little script works perfectly to start the query logging.

However, when I put the same to do a set notrace point within the stop
script, it actually starts the logging again.

for dbms in `iigcfid iidbms`
do
II_DBMS_SERVER=$dbms; export II_DBMS_SERVER
echo II_DBMS_SERVER=$dbms

sql iidbdb <<!
set notrace point sc930;
\g\p\q
!
done
rm -f sess*

Any idea ?

Confused :\

Reply With Quote
  #8  
Old   
Paul Mason
 
Posts: n/a

Default Re: [Info-Ingres] Ingres dispatch_command ? - 01-27-2011 , 10:56 AM



Try doing a "set trace point sc930 0" instead. In some earlier versions of the code the "notrace point" option wasn't implemented properly. Sc930 0 should work.

Cheers
Paul

Quote:
-----Original Message-----
From: info-ingres-bounces (AT) kettleriver...ting (DOT) com [mailto:info-
ingres-bounces (AT) kettleriverconsulting (DOT) com] On Behalf Of Zfs..
Sent: 27 January 2011 16:41
To: info-ingres (AT) kettleriverconsulting (DOT) com
Subject: Re: [Info-Ingres] Ingres dispatch_command ?

On Jan 27, 1:25*pm, Karl Schendel <schen... (AT) kbcomputer (DOT) com> wrote:
On Jan 27, 2011, at 8:16 AM, Zfs.. wrote:

[re sc930]
Thats exactly what I need. Although, I'm not sure how to stop the
logging after I execute the script ?

After you are finished logging, issue a
set notrace point sc930
sql statement in any session, e.g.
sql iidbdb
set notrace point sc930
\g
\q

Karl

Karl,

Thanks for your reply ( again )

One question. Im trying to put together a startlogging and stoplogging
script.

Pauls tidy little script works perfectly to start the query logging.

However, when I put the same to do a set notrace point within the stop
script, it actually starts the logging again.

for dbms in `iigcfid iidbms`
do
II_DBMS_SERVER=$dbms; export II_DBMS_SERVER
echo II_DBMS_SERVER=$dbms

sql iidbdb <<!
set notrace point sc930;
\g\p\q
!
done
rm -f sess*

Any idea ?

Confused :\
_______________________________________________
Info-Ingres mailing list
Info-Ingres (AT) kettleriverconsulting (DOT) com
http://ext-cando.kettleriverconsulti...fo/info-ingres

Reply With Quote
  #9  
Old   
Zfs..
 
Posts: n/a

Default Re: Ingres dispatch_command ? - 01-27-2011 , 11:04 AM



On Jan 27, 4:56*pm, "Paul Mason" <Paul.Ma... (AT) ingres (DOT) com> wrote:
Quote:
Try doing a "set trace point sc930 0" instead. In some earlier versions of the code the "notrace point" option wasn't implemented properly. Sc930 0 should work.

Cheers
Paul

-----Original Message-----
From: info-ingres-boun... (AT) kettleriverconsulting (DOT) com [mailto:info-
ingres-boun... (AT) kettleriverconsulting (DOT) com] On Behalf Of Zfs..
Sent: 27 January 2011 16:41
To: info-ing... (AT) kettleriverconsulting (DOT) com
Subject: Re: [Info-Ingres] Ingres dispatch_command ?

On Jan 27, 1:25*pm, Karl Schendel <schen... (AT) kbcomputer (DOT) com> wrote:
On Jan 27, 2011, at 8:16 AM, Zfs.. wrote:

[re sc930]
Thats exactly what I need. Although, I'm not sure how to stop the
logging after I execute the script ?

After you are finished logging, issue a
set notrace point sc930
sql statement in any session, e.g.
sql iidbdb
set notrace point sc930
\g
\q

Karl

Karl,

Thanks for your reply ( again )

One question. Im trying to put together a startlogging and stoplogging
script.

Pauls tidy little script works perfectly to start the query logging.

However, when I put the same to do a set notrace point within the stop
script, it actually starts the logging again.

for dbms in `iigcfid iidbms`
do
* II_DBMS_SERVER=$dbms; export II_DBMS_SERVER
* echo II_DBMS_SERVER=$dbms

* * * * sql iidbdb *<<!
set notrace point sc930;
\g\p\q
!
done
rm -f sess*

Any idea ?

Confused :\
_______________________________________________
Info-Ingres mailing list
Info-Ing... (AT) kettleriverconsulting (DOT) com
http://ext-cando.kettleriverconsulti...fo/info-ingres
Brilliant.

I'd have been looking at that for days not knowing what was going on.

Thanks Paul.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.