Databases sizes in an instance
Posted in 2005
Topics: General Discussion
Is there a script which will give us the sizes of each databases in any particular instance. Thanks and Regards VAIDYANATHAN KRISHNAN (GANESH)
Sql to run against sysmaster select dbsname[1,10], round(sum(ti_nptotal * 2 / 1000), 2) Alloc_Mb, round(sum(ti_npused * 2 / 1000), 2) Used, round(sum(ti_npdata * 2 / 1000), 2) Data from systabnames, systabinfo where partnum = ti_partnum group by 1 order by 1 MW > -----Original Message----- > From: forum.subscriber@iiug.org > [mailto:forum.subscriber@iiug.org] On Behalf Of Vaidyanatha.... > Sent: Saturday, 16 July 2005 12:34 a.m. > To: ids@iiug.org > Subject: Databases sizes in an instance [5438] > > Is there a script which will give us the sizes of each > databases in any particular instance. > > > Thanks and Regards > VAIDYANATHAN KRISHNAN > (GANESH) > > > > >
Hi,
Just a quick addition to this answer. This query is good for the machine
based on 2K pages like HP, SUN, UNIXWARE, SCO, DG UX, LINUX. On AIX boxes or
Windows , the page size is 4K, so you should use the following query
PAGE_SIZE=2 or 4 depending ont the page size.
dbaccess sysmaster - <<EOF
select dbsname[1,18],
round(sum(ti_nptotal * $PAGE_SIZE / 1000), 2) Alloc_Mb,
round(sum(ti_npused * $PAGE_SIZE/ 1000), 2) Used,
round(sum(ti_npdata * $PAGE_SIZE / 1000), 2) Data
from systabnames, systabinfo
where
partnum = ti_partnum
group by 1
order by 1
EOF
I also extended the database size to 18 characters since this is the max
lenght in version 7, but you should probably change it in version 9 since
the database name length has been modified to char(128).
Regards,
Khaled Bentebal
Directeur Général - ConsultiX
Tél: 33 (0) 1 39 12 18 00
Fax: 33 (0) 1 39 12 18 18
Mobile: 33 (0) 6 07 78 41 97
Email: khaled.bentebal@consult-ix.fr
Site Web: http://www.consult-ix.fr
----- Original Message -----
From: "Murray Wood...." <ifxmaillist@quanta.co.nz>
To: <ids@iiug.org>
Sent: Sunday, July 17, 2005 10:49 PM
Subject: RE: Databases sizes in an instance [5454]
> Sql to run against sysmaster
>
> select dbsname[1,10],
> round(sum(ti_nptotal * 2 / 1000), 2) Alloc_Mb,
> round(sum(ti_npused * 2 / 1000), 2) Used,
> round(sum(ti_npdata * 2 / 1000), 2) Data
> from systabnames, systabinfo
> where
> partnum = ti_partnum
> group by 1
> order by 1
>
> MW
>
> > -----Original Message-----
> > From: forum.subscriber@iiug.org
> > [mailto:forum.subscriber@iiug.org] On Behalf Of Vaidyanatha....
> > Sent: Saturday, 16 July 2005 12:34 a.m.
> > To: ids@iiug.org
> > Subject: Databases sizes in an instance [5438]
> >
> > Is there a script which will give us the sizes of each
> > databases in any particular instance.
> >
> >
> > Thanks and Regards
> > VAIDYANATHAN KRISHNAN
> > (GANESH)
> >
> >
> >
> >
> >
>
>
>
>