Professional Documents
Culture Documents
Freeing Up Disk On Your IBM I
Freeing Up Disk On Your IBM I
Freeing Up Disk On Your IBM I
By Rob Berendt
04/16/2010
Traditional items
• Spool files
• Ptf save files
RTVDSKINF
Your first line of attack
The Retrieve Disk Information (RTVDSKINF) command is used to collect disk space information. Disk space
information can then be printed using the Print Disk Information (PRTDSKINF) command. The collected
information is stored in a database file in library QUSRSYS. The file name depends on the auxiliary storage pool
(ASP) device for which disk space information is retrieved. If the information was retrieved from the system and
basic ASPs, the collected information will be stored in file QAEZDISK. If the information was retrieved from an
independent ASP device, the collected information will be stored in file QAEZnnnnn, where 'nnnnn' is the ASP
number of the independent ASP. The information will be stored in a data base file member named QCURRENT.
Each time this command is run, existing information in QCURRENT is written over. To save existing information in
member QCURRENT, rename file QAEZDISK or QAEZDnnnnn, or copy the member to another file.
Note: Do not rename member QCURRENT within file QAEZDISK or QAEZDnnnnn. If there is more than one
member in QAEZDISK or QAEZDnnnnn, the results of running this command can be unpredictable.
RTVDSKINF
more small print
Restrictions:
1. You must have all object (*ALLJOB) special authority to collect
disk space information.
2. You must be enrolled in the system distribution directory to
collect folder and document information. Use the Work with
Directory Entries (WRKDIRE) command to enroll.
PRTDSKINF *SYS
PRTDSKINF *SYS
Information collected . . . . . . . . . : 03/18/10 04:00:02
% of Size in
Description Disk 1,000,000 bytes
User libraries 54.74 178588.88
User directories 11.77 38393.65
Folders and documents .00 3.58
QSYS .77 2516.57
Other IBM libraries 2.88 9389.23
Licensed Internal Code 1.49 4855.48
Temporary space 2.71 8826.39
Unused space 25.20 82217.03
System internal objects .28 897.42
Objects not in a library .00 .00
TOTAL 99.84 325688.23
i5/OS items reported
% of Size in
Disk 1,000,000 bytes
i5/OS items reported:
History files .04 137.79
Journal receivers 50.04 163239.19
User profiles .03 104.44
Configuration information .00 3.77
System help (QHLPSYS) .01 44.03
Calendars .00 1.59
System directories .00 2.80
Document files .00 2.93
PRTDSKINF *LIB
After
% of Size in
Library Owner Disk 1000 bytes
QPFRD61001 QSYS .12 404222.0
QPFRD54001 QSYS .11 366313.5
They all had a text of “Down level files from library QMPGDATA”.
On his system they consumed 30% of his disk.
What about “User directories”?
% of Size in
Description Disk 1,000,000 bytes
User libraries 15.39 50200.09
User directories 11.84 38617.42
Folders and documents .00 3.58
QSYS .78 2557.05
Other IBM libraries 2.87 9375.59
Licensed Internal Code 1.49 4855.48
Temporary space 3.54 11543.27
Unused space 63.62 207540.71
System internal objects .32 1038.80
Objects not in a library .00 .00
TOTAL 99.85 325731.99
RTVDIRINF DIR('/') INFLIB(...)
WRKF QAEZD*
QAEZD0001D
QAEZD0001O
QAEZD0002D
QAEZD0002O
QAEZD0003D
QAEZD0003O
…
List of objects by biggest
directory
-- List of objects by biggest directory
With t1 as(
select distinct d.qezdirnam1 as ParentDirectory,
qezdiridx
from routines.QAEZD0058d d
where locate('/',d.qezdirnam1,2)=0
and d.qezdirnam1<>'/'
),
T2 as (
Select ParentDirectory, qezdirnam1,o.qezdtasize as size
from T1, routines.qaezd0058d d left outer join
routines.qaezd0058o o on d.qezdiridx=o.qezdiridx
where qezdirnam1 like trim(ParentDirectory) concat '%'
and (qezdirnam1 = ParentDirectory or
substr(qezdirnam1,1,max(locate('/',qezdirnam1,2)-1,1)) =
ParentDirectory)
)
select ParentDirectory, sum(size) as dirsize
From T2
Group by ParentDirectory
order by 2 desc;
List of objects by biggest
directory
Growth, by directory
-- List of objects by biggest directory
-- Compared to an earlier run to check growth on that directory.
With t1 as(
select distinct d.qezdirnam1 as ParentDirectory,
qezdiridx
from routines.QAEZD0058d d
where locate('/',d.qezdirnam1,2)=0
and d.qezdirnam1<>'/'
),
T2 as (
Select ParentDirectory, qezdirnam1,o.qezdtasize as size
from T1, routines.qaezd0058d d left outer join
routines.qaezd0058o o on d.qezdiridx=o.qezdiridx
where qezdirnam1 like trim(ParentDirectory) concat '%'
and (qezdirnam1 = ParentDirectory or
substr(qezdirnam1,1,max(locate('/',qezdirnam1,2)-1,1)) = ParentDirectory)
),
t3 as(
select distinct d.qezdirnam1 as ParentDirectory,
qezdiridx
from routines.QAEZD0057d d
where locate('/',d.qezdirnam1,2)=0
and d.qezdirnam1<>'/'
cont
T4 as (
Select ParentDirectory, qezdirnam1,o.qezdtasize as size
from T1, routines.qaezd0057d d left outer join
routines.qaezd0057o o on d.qezdiridx=o.qezdiridx
where qezdirnam1 like trim(ParentDirectory) concat '%'
and (qezdirnam1 = ParentDirectory or
substr(qezdirnam1,1,max(locate('/',qezdirnam1,2)-1,1)) = ParentDirectory)
),
T5 as (
select t2.ParentDirectory, sum(t2.size) as dirsize
From T2
Group by ParentDirectory
order by 2 desc
),
cont
T6 as (
select t4.ParentDirectory, sum(t4.size) as dirsize
From T4
Group by ParentDirectory
order by 2 desc
)
select t5.ParentDirectory, t5.dirsize, ifnull(t6.dirsize,0) as OldSize,
t5.dirsize - ifnull(t6.dirsize,0) as growth
from t5 left outer join t6 on t5.ParentDirectory = t6.ParentDirectory
order by growth desc
;
Results
Detailed
-- List of objects by biggest directory - Detailed
With t1 as(
select distinct d.qezdirnam1 as ParentDirectory,
qezdiridx
from routines.QAEZD0058d d
where locate('/',d.qezdirnam1,2)=0
and d.qezdirnam1<>'/'
),
T2 as (
Select ParentDirectory, qezdirnam1 as Dir, qezobjnam as
object,o.qezdtasize as size
from T1, routines.qaezd0058d d left outer join
routines.qaezd0058o o on d.qezdiridx=o.qezdiridx
where qezdirnam1 like trim(ParentDirectory) concat '%'
and (qezdirnam1 = ParentDirectory or
substr(qezdirnam1,1,max(locate('/',qezdirnam1,2)-1,1)) =
ParentDirectory)
)
select ParentDirectory, dir, object,size
From T2
where ParentDirectory like '/fixes%'
order by ParentDirectory, size desc
;
Detailed Results - fixes
Detailed Results – gdi01
Detailed Results - /QIBM
System 2
Total disk space on system in 1,000,000
bytes . . . . . . . . . . . . . . . . : 210990
% of Size in
Description Disk 1,000,000
bytes
User libraries 71.41 150657.68
User directories 3.72 7852.45
Folders and documents .12 262.48
QSYS 1.43 3008.61
Other IBM libraries 2.34 4935.92
Licensed Internal Code 1.83 3864.31
Temporary space 2.36 4977.59
Unused space 15.76 33243.50
System internal objects .35 743.61
Objects not in a library .00 1.37
TOTAL 99.32 209547.52
PRTDSKINF *LIB
% of Size in
Library Owner Disk 1000 bytes
EMIFILES QPGMR 15.06 31764607.0
AMAFILES QPGMR 4.82 10176118.8
LECFILES QPGMR 4.33 9132789.8
PMBDMART61 QPGMR 3.64 7689179.1
LEPFILES QPGMR 2.71 5718450.2
ERAFILES QPGMR 2.57 5414633.5
RBSPGMLIB RBTADMIN 2.46 5186822.1
PEPFILES QPGMR 2.38 5016404.0
SEAFILES QPGMR 2.29 4836237.3
PMBBS61 QPGMR 2.25 4739317.8
EPAFILES QPGMR 1.65 3491524.6
RJSTEMP QTMHHTP1 1.54 3244945.4
QSYS QSYS 1.42 2993903.1
QGPL QSYS 1.36 2865692.7
PMBPROD DTYNDALL 1.36 2863366.1
NCRFILES QPGMR 1.32 2791444.5
...
PRTDSKINF *LIB with obj
Library/ % of Size in
Object Type Owner Library 1000 bytes
EMIFILES *LIB QPGMR 31764607.0
DMFJRNHS *FILE QPGMR 21.45 6813753.3
DMRIJRNHS *FILE QPGMR 13.92 4420911.1
DMRJRNHS *FILE QPGMR 11.43 3629232.1
DMMJRNHS *FILE QPGMR 4.20 1332854.8
TRANS *FILE QPGMR 3.66 1161936.9
...
AMAFILES *LIB QPGMR 10176118.8
DMFJRNHS *FILE QPGMR 20.48 2083622.9
DMRIJRNHS *FILE QPGMR 13.79 1403105.3
DMRJRNHS *FILE QPGMR 11.64 1185001.5
...
Save files
SELECT DIOBLI AS LIBRARY, DIOBNM AS OBJECT,
DIOBAT AS ATTR, DIOBSZ AS SIZE
FROM QUSRSYS/QAEZDISK
WHERE DIOBAT='SAVF'
ORDER BY DIOBSZ DESC
TOTALSIZE
5,065,977,856
or 2.4% of 211GB
Other save files
SELECT DIOBLI AS LIBRARY, DIOBNM AS OBJECT,
cast(DIOBSZ as dec(9,0)) AS SIZE
FROM QUSRSYS/QAEZDISK
WHERE DIOBAT='SAVF'
AND not(DIOBLI LIKE 'Q%' AND DIOBNM LIKE 'Q%')
ORDER BY DIOBSZ DESC
/QIBM/UserData/OS400/MGTC/service
This directory can get quite sizable. You may have turned
on tracing at one time to help IBM help you with a
problem. If you have data in there see:
http://www-01.ibm.com/support/docview.wss?uid=nas1d1
cbd364ea28199b862573d20062e9cb
Or search ibm.com for 862573D20062E9CB
GO CLEANUP
Type choices below, then press Enter.