How to get status of any utility ( reorg,backup,load) running on DB2.
SELECT
substr(char(UTILITY_START_TIME),1,19) as start_time /*==> TIMESTAMP 10,0 */
,u.DBPARTITIONNUM as dp#
,substr(u.UTILITY_TYPE,1,12) as UTILITY_TYPE
,u.UTILITY_STATE /*==> VARCHAR 16,0 */
,char(PROGRESS_DESCRIPTION,10) as prog /*==> VARCHAR 2048,0 */
,PROGRESS_TOTAL_UNITS as tot_units /*==> BIGINT 8,0 */
,PROGRESS_COMPLETED_UNITS as tot_comp_units /*==> BIGINT 8,0 */
,TIMESTAMPDIFF(4,CHAR(TIMESTAMP(current timestamp)-TIMESTAMP(PROGRESS_START_TIME))) AS elp_min
,substr(UTILITY_DESCRIPTION,1,120) as desc
FROM SYSIBMADM.SNAPUTIL u
LEFT OUTER JOIN SYSIBMADM.SNAPUTIL_PROGRESS up
on u.UTILITY_ID = up.UTILITY_ID
and u.DBPARTITIONNUM = up.DBPARTITIONNUM
order by u.DBPARTITIONNUM, u.UTILITY_TYPE, u.UTILITY_STATE
for fetch only with ur
SELECT
substr(char(UTILITY_START_TIME),1,19) as start_time /*==> TIMESTAMP 10,0 */
,u.DBPARTITIONNUM as dp#
,substr(u.UTILITY_TYPE,1,12) as UTILITY_TYPE
,u.UTILITY_STATE /*==> VARCHAR 16,0 */
,char(PROGRESS_DESCRIPTION,10) as prog /*==> VARCHAR 2048,0 */
,PROGRESS_TOTAL_UNITS as tot_units /*==> BIGINT 8,0 */
,PROGRESS_COMPLETED_UNITS as tot_comp_units /*==> BIGINT 8,0 */
,TIMESTAMPDIFF(4,CHAR(TIMESTAMP(current timestamp)-TIMESTAMP(PROGRESS_START_TIME))) AS elp_min
,substr(UTILITY_DESCRIPTION,1,120) as desc
FROM SYSIBMADM.SNAPUTIL u
LEFT OUTER JOIN SYSIBMADM.SNAPUTIL_PROGRESS up
on u.UTILITY_ID = up.UTILITY_ID
and u.DBPARTITIONNUM = up.DBPARTITIONNUM
order by u.DBPARTITIONNUM, u.UTILITY_TYPE, u.UTILITY_STATE
for fetch only with ur
No comments:
Post a Comment