Re: dbspace of non-fragmented tables
Posted in 1999
Topics: Storage & Space Management, SQL Development & Query Writing
> How can I determine the dbspace in which a certain table is allocated if
> this table is not fragmented.
To get the number of the dbspace:
select tabname, trunc(partnum / 1048576)
from systables
where tabname = "table name";
If you want the dbspace name, you have to join with sysdbspaces:
select t.tabname, d.name
from systables t,
sysmaster:sysdbspaces d
where t.tabname = "table name"
and d.dbsnum = trunc(t.partnum / 1048576);
To do this join, your database must be logged.
Mark Collins
mcollins@us.dhl.com
The problem lies in how easily and dangerously we forget that
manipulating things is not the same as understanding them.
In article <7g7ts9$s8l$1@news.xmission.com>,
Mark Collins <mcollins@us.dhl.com> wrote:
>
> > How can I determine the dbspace in which a certain table is allocated if
> > this table is not fragmented.
>
> To get the number of the dbspace:
>
> select tabname, trunc(partnum / 1048576)
> from systables
> where tabname = "table name";>
> If you want the dbspace name, you have to join with sysdbspaces:
>
> select t.tabname, d.name
> from systables t,
> sysmaster:sysdbspaces d
> where t.tabname = "table name"
> and d.dbsnum = trunc(t.partnum / 1048576);>
> To do this join, your database must be logged.
>
> Mark Collins
> mcollins@us.dhl.com
>
> The problem lies in how easily and dangerously we forget that
> manipulating things is not the same as understanding them.
>
>
It doesn't matter whether the database is logged or not. Even
though sysmaster shows up as "U" (unbuffered logging), it's not
a "real" database and may be joined with non-logging ones as well.
--
Gabor Heppes
IBM Global Services
gaborh@au1.ibm.com
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own