DBSpace used by what?
Posted in 2003
Topics: High Availability & Replication, Storage & Space Management, SQL Development & Query Writing
> I have the following query:
>
> select syschktab.dbsnum, name, sum(chksize) * 4 total_size,
> sum(nfree) * 4 amt_free,
> trunc((sum(nfree) / sum(chksize)) * 100, 2) percent_free
> from syschktab, sysdbstab
> where syschktab.dbsnum = sysdbstab.dbsnum
> group by 1,2
> order by 1;>
> Which gives me all the dbspaces, their size, free space, and percent free.
> I have 1 dbspace that is a gig in size, has no tables in it yet has only
> 19% free space. How can I find out what is using this free space?
>
> I also have this query:
> select systabnames.tabname table_name,
> dbinfo( "DBSPACE" , systabnames.partnum ) dbspace,
> (nptotal * 4) allocated_space,
> ((nptotal - sysptnhdr.npused) * 4) free_space
> from systabnames, "cea":systables, sysptnhdr
> where "cea":systables.partnum = sysptnhdr.partnum and> "cea":systables.partnum = systabnames.partnum and
> tabid > 99 and tabtype = "T"
> group by 1,2,3,4
> order by 2,1;
>
> Which gives me all the tables and their associated dbspaces. None of these
> tables match up with the dbspace that I am looking at. Any ideas?
Try
running oncheck -pe (pipe to a file!).
You can see what is in the dbspaces and their sizes.