Re: Q: Another how to question
Posted in 1998
In article <35E5F139.2B5C4A6D@hotmail.com>,
June Tong <june_t@hotmail.com> wrote:
> Just want to clarify, ...
OK. I will try to go farther
>
> > > > select tabname,> > > > trunc(partnum/16777216) dbspace
> > > > from systables where tabid >100;
> > >
> > > As far as I know, it should be >99;
>
> Correct, this should be >99. This one works on OnLine 4.x and 5.x, but not on
> any higher versions.
>
> > > select tabname,
> > > dbinfo('dbspace', partnum) dbspace
> > > from systables
> > > where tabid > 99 and tabtype = 'T' and partnum != 0
> > > union all
> > > select tabname,
> > > dbspace dbspace
> > > from systables t, outer sysfragments f
> > > where t.tabid > 99 and
> > > tabtype = 'T' and
> > > partnum = 0 and
> > > t.tabid = f.tabid
> > > order by 1,2;> >
>
> Only works on versions 7 and above. Takes into account fragmented tables.
This one is good only for particular database.
To get info for all databases, you should write
some script (I have that).
>
> > database sysmaster;> >
> > select dbs.dbsnum, dbs.name, prof.dbsname,
> > prof.tabname, prof.partnum
> > from sysdbspaces dbs, outer sysptprof prof
> > where dbs.dbsnum = trunc(hex(prof.partnum)/1048576)
> > order by 1, 4;>
> Also only works on 6 & above (might be 7 & above), doesn't take into account
> fragmented tables. Incidentally, if you're dividing and truncating, you don't
> need to do the conversion to hex:
> where dbs.dbsnum = trunc(prof.partnum/1048576)
> should work.
>
I'd treated this sql just as base/draft when I saw first time.
It is really good, because you are working only with sysmaster database.
sysptprof contains row for each fragment of fragmented table.
Therefore (at least on my IDS 7.3 on NT) I have correct output.
> June
> --
> june_t@hotmail.com
> Lost in the wilds of Palo Alto, living on sushi
>
>
--
Vardan Aroustamian
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum