The SQE Plan Cache stores the access plans and additional information for any SQL statement executed since the last IPL.
As long as the plans are not manually removed (from the plan cache or by executing the CLEAR_PLAN_CACHE stored procedure the information keeps available.
Since Release 7.1 the SQE Plan Cache is increased automatically, so older access plans are no longer removed.
The SQE Plan Cache can keep up to 3 access plans of the same query.

I you only want to know what queries are preformed, the last time, the plan cache may provide enough information.

If you want to track the queries, if you know what jobs, what users or what libraries to be observed, database monitors are the right choice.
If you do not have this information, i.e. if you cannot restrict the data to be gathered ... gathering information over all jobs on your machine will exhaust you memory faster as you can think.

Mit freundlichen Grüßen / Best regards

Birgitta Hauser

"Shoot for the moon, even if you miss, you'll land among the stars." (Les Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them and keeping them!"
„Train people well enough so they can leave, treat them well enough so they don't want to.“ (Richard Branson)


-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Charles Wilt
Sent: Freitag, 11. August 2017 20:24
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Subject: Re: Logging of SQL statements

I don't think it's really want you want...

The plan cache is just that, a cache. Meaning, as new statements are added, older ones are removed.

So if you want _every_ statement issued by a user, you're going to need another solution.

Diego's suggestion of using an exit point is probably the best way to log the statements.

You'll want to use QIBM_QZDA_SQL1 or QIBM_QZDA_SQL2. Here's an article about writing such as exit point.
https://www.itjungle.com/2006/11/08/fhg110806-story01/

HTH,
Charles




On Fri, Aug 11, 2017 at 10:53 AM, Cyndi Bradberry <CyndiB@xxxxxxxx> wrote:

Thanks Birgitta ! That is awesome and just what we are looking for. I
wonder if there is a way to save that information.

Cyndi

-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of
Birgitta Hauser
Sent: Monday, August 7, 2017 10:48 PM
To: 'Midrange Systems Technical Discussion' <midrange-l@xxxxxxxxxxxx>
Subject: RE: Logging of SQL statements

Just have a look into the SQE Plan Cache (with the Client Access or
ACS Analysis Tools).
Each SQL Statement needs an Access Plan. All Access Plans are stored
in the SQE Plan Cache.
You can analyze the access plans and also can get the SQL statement
(including the variable values set by host variables).
The access plans exist as long as no IPL is performed or the plan
cache is manually cleared.

Mit freundlichen Grüßen / Best regards

Birgitta Hauser

"Shoot for the moon, even if you miss, you'll land among the stars."
(Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training
them and keeping them!"
"Train people well enough so they can leave, treat them well enough so
they don't want to." (Richard Branson)


-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of
Cyndi Bradberry
Sent: Montag, 7. August 2017 23:05
To: midrange-l@xxxxxxxxxxxx
Subject: RE: Logging of SQL statements

We have C# running on Microsoft IIS handling our web services. They
have found they are vulnerable to SQL injection attacks. They are
working on programming their sites to not allow it, but we would like
to have a belt and suspenders approach.

The files are journaled, but they really want to capture the entire
SQL string if possible. I will look into the QIBM_QZDA_SQL1 and
database monitoring.

Thanks for the suggestions.

Cyndi B.
Boise, ID


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take
a moment to review the archives at http://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link:
http://amzn.to/2dEadiD

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take
a moment to review the archives at http://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take
a moment to review the archives at
http://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: http://amzn.to/2dEadiD


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.