How to verify SQL statements execution date/time
Posted in 2010
Topics: General Discussion
Hi All,
I would like to ask if there's a way to check if the "onstat -g sql sessioid"
can be verified how long it's been running... I've seen just the "Last parsed"
statements and i want to get the date/time it's been runnning...
Is there a way to get the date/time?
thanks and regards,
I don't think that the information exists in the database itself. Perhaps
if you have SQLTRACE set and have the contents of the trace cache being
saved to a table or file you could get that information that way.
Another option is Exact Solutions' iWatch product which captures SQL in
real-time external to the database by sniffing the network packets between
the server and its clients. It can record, report, and analyze the runtime
of a query as well as the volume of data, number of round trips between
client and server, and where the query is spending its time (in data
transfer or search).
Art
Art S. Kagel
Advanced DataTools (www.advancedatatools.com)
IIUG Board of Directors (art@iiug.org)
Disclaimer: Please keep in mind that my own opinions are my own opinions and
do not reflect on my employer, Advanced DataTools, the IIUG, nor any other
organization with which I am associated either explicitly, implicitly, or by
inference. Neither do those opinions reflect those of other individuals
affiliated with any entity with which I am affiliated nor those of the
entities themselves.
On Sun, Sep 26, 2010 at 11:34 PM, JACK PAPA <informix2009@gmail.com> wrote:
> Hi All,
>
> I would like to ask if there's a way to check if the "onstat -g sql
> sessioid"
> can be verified how long it's been running... I've seen just the "Last
> parsed"
> statements and i want to get the date/time it's been runnning...
>
> Is there a way to get the date/time?
>
> thanks and regards,
>
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
--00163613a32862868a0491359688
Thanks Art.. Sad to say, I can't connect directly into our environment using a client..i do most of the tasks whatever utility is available in the DB itself. Anyways, thanks for your inputs...
Jack,
I believe you are interpreting the "Last Parsed SQL" incorrectly If
there is not a "Current SQL" then no SQL is running for this session.
A session can be processing a request, or the application can be
processing the data sent back with the last request, or application can be
waiting on user input.
In systems I have seen. the majority of time a single session is connected
is spent in a "net norm wait" state, or waiting for an application request.
I mostly deal with OLTP system and I believe this is normally the case with
OLTP systems.
If you have the proper tuning for CPU VP and AIO VP then
Trust the first flag of the onstat -u .
If you wish to find out when traffic was last going to the DB or from the
DB check out onstat -g ntt
If you really want to know how long SQL is running then the other have
given several ideas and ways to get that information. I prefer SQLTRACE
because there is no license and it can be turned off and on with the system
up, but depending on how big you make you traces you may need to adjust
SHMVIRT.
George.
From: "JACK PAPA" <informix2009@gmail.com>
To: ids@iiug.org
Date: 09/26/2010 10:35 PM
Subject: How to verify SQL statements execution date/time [21468]
Sent by: ids-bounces@iiug.org
Hi All,
I would like to ask if there's a way to check if the "onstat -g sql
sessioid"
can be verified how long it's been running... I've seen just the "Last
parsed"
statements and i want to get the date/time it's been runnning...
Is there a way to get the date/time?
thanks and regards,
*******************************************************************************
Forum Note: Use "Reply" to post a response in the discussion forum.
Related threads
- Posting from the Informix-list
- Migrating from IDS 9.40.UC6 to 11.50.UC3
- Ip for a network session
- questions onstat -g