Author Topic: SQL for Last Load, Last Query and Last Retrieval of each Application Group  (Read 936 times)

Joe Wolken

  • Full Member
  • ***
  • Posts: 110
  • CMOD iSeries Consultant
    • View Profile
    • OAS Corp.
Within the Administration Client Application Group list there is now the ability to enable 'Document Activity Tracking (going forward) for the 'Last Load', 'Last Query' and 'Last Retrieve'.

Does anyone have and willing to share the SQL statements (I image one SQL each for Load, Query and Retrieve) to run that would result in a list of all of the Application Groups with their most recent dates for each.  I assume the data would come from the System Log.

I am looking for historical data.  For example, seeing if the most recent retrieval for some reports was 1 year ago, I would not have that if I just now turned on the Document Activity Tracking, since it only populates day forward.

#Installation #Upgrade #Migration #Administration #Integration #Customization #Training, and more!

Call: 512-402-1123


  • Full Member
  • ***
  • Posts: 117
    • View Profile

Once you enable this feature for an application group, the information begins to be tracked. You can see the data in the OD Administrator in the list of Application groups. You can't however retroactively get this info for an application group that doesn't have this enabled.

FYI - It is not advised to leave this turned on permanently as it does create overhead on the server.


Darrell Bryant

  • Full Member
  • ***
  • Posts: 102
  • Sed fugit interea fugit inreparabile tempus-Virgil
    • View Profile
Application group query information is captured in the system log only if it has been turned in the Application Group, the default is that query activity is not logged. The message numbers are 65 (before the query is run) and 226 (after the query is run, contains the number of hits returned).
Document retrieval information is logged by default, but can be turned off. The message number is 66.
All loading activity is logged. The message number is 87. This can also be determined from the System Load facility.

If this is a small customer with only one System Log table (SL2) then you can use SQL to analyze the activity. If they have multiple System Log tables then I think is easier to perform the analysis by searching the System Log using the client.

Using the client you could pick a date range, specify an In search for Msg Num with value 65 66 87, and a Like search for Message with value %<name of AG>%.

I don't know enough SQL to only return one row per AG per activity (query, retrieve, load), which is what you want.

As for leaving the Document Activity Tracking turned on in the AG permanently, I would say it depends on the existing workload on the system. Having the current information might be valuable to some customers, justifying the overhead.
#IBMi #iSeries #PDF #XML #400 Indexer #ASM