SQL

By kimot, 27 December, 2022
SELECT data_size, system_table_name, system_table_schema, number_rows, number_deleted_rows                                                 
FROM QSYS2.SYSTABLESTAT                                      
WHERE system_table_schema = 'some_library'                     
ORDER BY number_deleted_rows DESC  
By kimot, 27 December, 2022
SELECT object_schema, system_object_name, member_lock_type,
       lock_state, lock_scope, job_name
FROM QSYS2.OBJECT_LOCK_INFO
WHERE system_object_schema = 'some_library' ;
By kimot, 25 December, 2022
WITH objs AS (SELECT path_name 
   FROM TABLE (QSYS2.IFS_OBJECT_STATISTICS(START_PATH_NAME => '/usr'))) 
SELECT * FROM objs, TABLE(QSYS2.IFS_OBJECT_PRIVILEGES(PATH_NAME)) WHERE authorization_name = 'user';
By kimot, 25 December, 2022
SELECT OBJNAME, OBJLIB, OBJTYPE, OBJCREATED, CREATED_SYSTEM, OBJTEXT  
FROM TABLE (QSYS2.OBJECT_STATISTICS('QGPL ','*FILE' ) ) AS X
WHERE DAYS(CURRENT DATE) - DAYS(OBJCREATED) > 1;