IBM Support

Finding SQL Objects That Are Consuming The Most DASD

Question & Answer


Question

My DASD is filling up. How can I identify which objects are taking up the most space so I can delete them?

Answer


The OBJECT_STATISTICS table function returns information about objects in a library.

The basic syntax for the command is OBJECT_STATISTICS(LIBRARY-NAME, OBJECT- TYPE-LIST).

This function can be used when the system is running out of storage and you need to find objects that are taking up a lot of DASD.

We sometimes find that journal receivers can account for a large portion of DASD used if a job is looping or if the journal receivers have not been deleted for some time. The following SQL statement can be run to give you list of journal receivers and the size of each receiver for all users libraries:
 
SELECT OBJSIZE, OBJNAME, OBJTYPE, OBJDEFINER
FROM table(QSYS2.OBJECT_STATISTICS('*ALLUSR','JRNRCV')) AS X 
order by OBJSIZE desc

This query can be run for other object types as well. Included but not limited to the following:
  • ALL
  • FILE
  • SRVPGM
  • PGM
  • JOBQ
  • OUTQ
  • JRN

More information about the function can be found at the URL below.

[{"Type":"MASTER","Line of Business":{"code":"LOB68","label":"Power HW"},"Business Unit":{"code":"BU070","label":"IBM Infrastructure"},"Product":{"code":"SWG60","label":"IBM i"},"Platform":[{"code":"PF012","label":"IBM i"}],"Version":"7.1.0"}]

Document Information

Modified date:
13 August 2024

UID

nas8N1021087