On 17-Feb-2015 14:41 -0600, Dan wrote:
I've never noticed the object_statistics function before. I can't
remember how long I've been looking for a one-step method to get a
list of all of the source physical files on a system. (I.e.,
PF-SRC*)
Currently, I use DSPFD *MBR to an outfile, and select MBDTAT = 'S'.
That Display File Description request produces a row for every
database file member; seems potentially massive overkill if only a list
of all PF-SRC _files_ are of interest versus a list of all PF-SRC
_members_ is of interest.
The following DSPFD can significantly limit the output, yet the
likely large number of non-source physical files are included so further
selection is PHDTAT='S', but an extra record for every additional member
beyond a first is not generated [which as a list of /files/ would all be
ignored]:
DSPFD TYPE(*ATR) FILEATR(*PF) /* model file QAFDPHY in QSYS */
Any better options?
select * from QSYS/QADBXLFI where DBXTYP='S'
Note: Database [source] physical files in QTEMP libraries were never
tracked [and presumably still are not] by the System Database
Cross-Reference (DBXREF) feature that is responsible for populating
[most of] the QADB* files in QSYS. I named the logical file QADBXLFI in
the table-reference for the above SELECT query because that file is
publicly authorized. Either the creator of the logical VIEW over the
physical file QADBXREF in QSYS must have *ALLOBJ authority or the
program that accesses the data directly from that PF named as
table-reference must adopt that authority because there is no support to
modify the authorities of [or really to make _any_ changes to] the files
QADB* in QSYS.
The above query instead could use the SQL catalog VIEW SYSTABLES
[that is also publicly authorized], for which the DBXTYP field of
QADBXREF is exposed as FILE_TYPE or FILETYPE:
select * from QSYS2/SYSTABLES where FILE_TYPE='S' /* FILETYPE='S' */
If /member/ information is desired, the SYSPSTAT [partition status]
[or perhaps the table function used to implement that] VIEW may be
preferable.
As an Amazon Associate we earn from qualifying purchases.