Re: Q: Another how to question
Posted in 1998
In article <6s3f42$dam$1@news.xmission.com>,
Guillermo Labatte <labatteg@frcu.utn.edu.ar> wrote:
>
> Susan,
> You can use this SQL sentence to know the dbspace number of each table.
>
> select tabname,> trunc(partnum/16777216) dbspace
> from systables where tabid >100;
As far as I know, it should be >99;
>
> (Sample output)
>
> tabname dbspace
>
> person_bas 4
> cabe_poli 4
> poli_auto_indi 3
> recibo_cheques 4
> socios 3
> clau_anex_poli 3
>
> To know the dbspace name you can use tbstat in the command line:
>
> rs2-informix /usr/informix>tbstat -d
>
> RSAM Version 5.07.UC2 -- On-Line -- Up 00:57:15 -- 1314 Kbytes
>
> Dbspaces
> address number flags fchunk nchunks flags owner name
> 30012ec0 1 1 1 1 N informix rootdbs
> 30012ef0 2 10 2 1 N B informix imagenes
> 30012f20 3 1 3 1 N informix dbspace2
> 30012f50 4 1 4 1 N informix dbspace3
> 30012f80 5 1 5 1 N informix maniobra
> 5 active, 8 total
>
> In the example person_bas, cabe_poli and recibo_cheques are in dbspace3
> and poli_auto_indi, socios and clau_anex_poli are in dbspace2.
>
> As you can see from the tbstat's output I'm using Online 5.07. I
> understand that in newer versions of Informix a table can span multiple
> dbspaces. So these commands could not be suitable for you.
>
You can use this:
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;
> Susan Elliott (ISG) wrote:
>
> > Howdy folks,
> >
> > I have a simple need to know the tabname and what dbspace name it is
> > in...
> >
> > I have pored over the sys tables, and I haven't spotted anything that
> > will tell me this. Does anyone have a simple query that will tell me
> > this... or able to lead me in the right direction....
> >
> > TIA
> >
> > Suze.
> >
>
>
--
Vardan Aroustamian
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum