How to find really big objects in AS400 (IBMi Power System) using SQL

List Objects taking a lot of space in a specific library such as MYLIB

SELECT A.OBJNAME AS OBJECT,                                  
           CAST(A.OBJLONGSCHEMA AS CHAR(10)) AS LIBRARY,     
           A.OBJATTRIBUTE AS ATTRIBUTE,                      
           A.OBJSIZE AS SIZE,                                
           CAST(A.LAST_USED_TIMESTAMP AS DATE) AS LAST_DATE  
      FROM TABLE(QSYS2.OBJECT_STATISTICS('MYLIB','ALL')) A     
      ORDER BY A.OBJSIZE DESC     

List Objects taking a lot of space in a your library list

SELECT A.OBJNAME AS OBJECT,                                  
           CAST(A.OBJLONGSCHEMA AS CHAR(10)) AS LIBRARY,     
           A.OBJATTRIBUTE AS ATTRIBUTE,                      
           A.OBJSIZE AS SIZE,                                
           CAST(A.LAST_USED_TIMESTAMP AS DATE) AS LAST_DATE  
      FROM TABLE(QSYS2.OBJECT_STATISTICS('*USRLIBL','ALL')) A     
      ORDER BY A.OBJSIZE DESC     

No comments:

Post a Comment

NO JUNK, Please try to keep this clean and related to the topic at hand.
Comments are for users to ask questions, collaborate or improve on existing.