Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Stephen F. Cawley wanted a script to show how full a table's extents were. John Carlson (WHSmith) gave sysmaster queries on sysptprof and sysptnhdr (7.2 or later) for nextns, npused, nptotal and npdata, and one joining sysextents for individual extents. Art S. Kagel recommended oncheck -pT database:table or his printfreeB.ec utility.
Auto-generated by Claude from the posts below — may be imperfect; read the full thread.
Stephen F. Cawley — — source: Informix-list mailing list archive (1991-1998)
I am trying to write a script to check not only total extents allocated to a
table, but how full they are. A table might be allocated 20K, but only have
3K of data. Is there a way to do this?
SC
↪ replying to Stephen F. Cawley
Carlson@WHSmith — — source: Informix-list mailing list archive (1991-1998)
If you're using version >= 7.2 then try this:
database sysmaster;select tabname, nextns, npused, nptotal, npdata
from sysmaster:sysptprof prof, sysmaster:sysptnhdr hdr
where dbsname = '<database name>'
and prof.partnum = hdr.partnum
tabname - table name within dbsname
nextns - number of extents for tabname
npused - total number of pages actually used for this table
nptotal - total number of pages allocated for this table
npdata - total number of data pages for this table (no indices incl.)
John Carlson
Informix DBA
WHSmith USA
Stephen F. Cawley wrote:
>
> I am trying to write a script to check not only total extents allocated to a
>
> table, but how full they are. A table might be allocated 20K, but only have
>
> 3K of data. Is there a way to do this?
>
> SC
↪ replying to Stephen F. Cawley
Art S. Kagel — — source: Informix-list mailing list archive (1991-1998)
Use:
oncheck -pT <database>:<table>
or get my printfreeB.ec utility. But the oncheck -pT works fine.
Art S. Kagel
"Stephen F. Cawley" wrote:
>
> I am trying to write a script to check not only total extents allocated to a
>
> table, but how full they are. A table might be allocated 20K, but only have
>
> 3K of data. Is there a way to do this?
>
> SC
↪ replying to Carlson@WHSmith
Carlson@WHSmith — — source: Informix-list mailing list archive (1991-1998)
Oops, forgot to show the individual extents for a table . . .
select prof.dbsname, prof.tabname, start, size
from sysptprof prof, sysextents ext
where prof.dbsname = ext.dbsname
and prof.tabname = ext.tabname
and prof.dbsname = '<database name>'
and prof.tabname = '<table name>'
Of course, oncheck -pT or oncheck -pe could probably do the trick also
John Carlson
Informix DBA
WHSmith USA
Carlson@WHSmith wrote:
>
> If you're using version >= 7.2 then try this:
>
> database sysmaster;>
> select tabname, nextns, npused, nptotal, npdata
> from sysmaster:sysptprof prof, sysmaster:sysptnhdr hdr
> where dbsname = '<database name>'
> and prof.partnum = hdr.partnum>
> tabname - table name within dbsname
> nextns - number of extents for tabname
> npused - total number of pages actually used for this table
> nptotal - total number of pages allocated for this table
> npdata - total number of data pages for this table (no indices incl.)
>
> John Carlson
> Informix DBA
> WHSmith USA
>
> Stephen F. Cawley wrote:
> >
> > I am trying to write a script to check not only total extents allocated to a
> >
> > table, but how full they are. A table might be allocated 20K, but only have
> >
> > 3K of data. Is there a way to do this?
> >
> > SC
Your privacy choices
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.