![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
-----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 |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
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 |
#5
| |||
| |||
|
|
[re sc930] Thats exactly what I need. Although, I'm not sure how to stop the logging after I execute the script ? |
#6
| |||
| |||
|
|
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 |
#7
| |||
| |||
|
|
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 |
#8
| |||
| |||
|
|
-----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 |
#9
| |||
| |||
|
|
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 |
![]() |
| Thread Tools | |
| Display Modes | |
| |