Author Topic: Determine the active segment table being used  (Read 1696 times)

jsquizz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 576
    • View Profile
Determine the active segment table being used
« on: December 08, 2021, 02:25:16 PM »
Hi All,

wondering if anyone has a db2 query handy, or any suggestions on writing a query-  that will return the active app group segment table being loaded to.

Thanks!
#CMOD #DB2 #AFP2PDF #TSM #AIX #RHEL #AWS #AZURE #GCP #EVERYTHING

Greg Ira

  • Full Member
  • ***
  • Posts: 240
    • View Profile
Re: Determine the active segment table being used
« Reply #1 on: December 09, 2021, 06:29:32 AM »
Maybe this will help for starters.  This is for DB2 on z/OS and shows the open segments for all AGs.  shows us % used.

SELECT DATE(CURRENT DATE) AS RUN_DATE FROM ONDDB.ARSUSER     
WHERE USERID LIKE 'ADMIN';                                     
SELECT SUBSTR(A.NAME,1,10) AS APP_GROUP,                       
DECIMAL((DECIMAL(S.INS_ROWS,11,2))/                           
(DECIMAL(S.MAX_ROWS/100.00,11,2)),11,2) PCT_USED,             
SUBSTR(S.TABLE_NAME,1,10) AS TABLE_P,                       
S.AGID, INTEGER(S.MAX_ROWS)                                   
FROM ONDDB.ARSSEG S, ONDDB.ARSAG A                           
WHERE SUBSTR(S.TABLE_NAME,1,2) <> 'SL'                         
AND S.AGID        = A.AGID                                     
AND S.CLOSED_DATE = 0                                         
ORDER BY A.NAME, S.START_DATE DESC;                           

jsquizz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 576
    • View Profile
Re: Determine the active segment table being used
« Reply #2 on: December 10, 2021, 08:25:54 AM »
Thanks Greg!

the solution I came up with, was something along the lines of-

joining arsseg/arsag, pulling table_name based on where app_group=xyz order by table_name then a tail -1 on the results.

I think that will work. Still testing and reviewing with my colleagues..seems a bit too easy :)
#CMOD #DB2 #AFP2PDF #TSM #AIX #RHEL #AWS #AZURE #GCP #EVERYTHING

rjrussel

  • Full Member
  • ***
  • Posts: 141
    • View Profile
Re: Determine the active segment table being used
« Reply #3 on: December 12, 2021, 01:12:03 PM »
You can try this too:

arstblsp -a3 -h archive

This will show all the tables that are open for loading by application group.

jsquizz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 576
    • View Profile
Re: Determine the active segment table being used
« Reply #4 on: December 16, 2021, 01:18:52 PM »
You can try this too:

arstblsp -a3 -h archive

This will show all the tables that are open for loading by application group.

Makes sense that this would work,

however.

Code: [Select]
dev:bin# arstblsp -a 3 -I archive
ARS1107E An error occurred.  Contact your system administrator and/or consult the System Log.  File=, Line=
#CMOD #DB2 #AFP2PDF #TSM #AIX #RHEL #AWS #AZURE #GCP #EVERYTHING

Justin Derrick

  • IBM Content Manager OnDemand Consultant
  • Administrator
  • Hero Member
  • *****
  • Posts: 2229
  • CMOD Guru for hire...
    • View Profile
    • Tenacious Consulting
Re: Determine the active segment table being used
« Reply #5 on: December 16, 2021, 02:05:55 PM »
You have to tell it which Application Group you want the information for.  :)

-JD.
IBM CMOD Professional Services: http://TenaciousConsulting.com
Call:  +1-866-533-7742  or  eMail:  jd@justinderrick.com
IBM CMOD Wiki:  https://CMOD.wiki/
FREE IBM CMOD Education & Webinars:  https://CMOD.Training/

Interests: #AIX #Linux #Multiplatforms #DB2 #TSM #SP #Performance #Security #Audits #Customizing #Availability #HA #DR

Darrell Bryant

  • Full Member
  • ***
  • Posts: 104
  • Sed fugit interea fugit inreparabile tempus-Virgil
    • View Profile
Re: Determine the active segment table being used
« Reply #6 on: December 20, 2021, 05:45:54 AM »
Running arstblsp -a 3 without the AG name lists all AGs in the instance and the open table for each. For example:

arstblsp -a 3 -h QUSROND
ARS1304I Table still open for loading:  ApplGroup(Statements) Agid(243679) Table(CBCL1)           
ARS1304I Table still open for loading:  ApplGroup(REPORT1) Agid(243676) Table(BBCL1)             
ARS1304I Table still open for loading:  ApplGroup(ARSR1MST) Agid(225773) Table(DKKK1)             
ARS1304I Table still open for loading:  ApplGroup(TEGDB260) Agid(215817) Table(XTZJ1)   \
ARS1304I Table still open for loading:  ApplGroup(JOBLOG9LO) Agid(28417) Table(TVV1)
ARS1304I Table still open for loading:  ApplGroup(System Load) Agid(5011) Table(SA2)
ARS1304I Table still open for loading:  ApplGroup(System Log) Agid(5001) Table(SL2)
etc

If you specify the AG name then only that AG is listed. For example:

arstblsp -a 3 -g JOBLOG9LO -h QUSROND
ARS1304I Table still open for loading:  ApplGroup(JOBLOG9LO) Agid(28417) Table(TVV1)
#IBMi #iSeries #PDF #XML #400 Indexer #ASM

jsquizz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 576
    • View Profile
Re: Determine the active segment table being used
« Reply #7 on: December 27, 2021, 07:11:10 AM »
Thanks JD/Darrell, this will work. Haven't had to use this command but this will be a GREAT help! I am still however, getting the same error.

Code: [Select]
preProd:root# arstblsp -a3 -h archive
ARS1107E An error occurred.  Contact your system administrator and/or consult the System Log.  File=, Line=
« Last Edit: December 27, 2021, 07:17:38 AM by jsquizz »
#CMOD #DB2 #AFP2PDF #TSM #AIX #RHEL #AWS #AZURE #GCP #EVERYTHING

greghidalgo

  • Jr. Member
  • **
  • Posts: 11
    • View Profile
Re: Determine the active segment table being used
« Reply #8 on: December 30, 2021, 07:04:13 AM »
Is 'archive'   the name of your OD instance?     And I think make sure you have space between -a and the '3' .   But I can generate the same ARS1107E when I put in an instance name that does not exist on my system.
« Last Edit: December 30, 2021, 07:05:44 AM by greghidalgo »
#odiseries #iOS