Re: database space info (fwd)
Posted in 1997
Topics: Storage & Space Management, Stored Procedures & SPL
This is a multi-part message in MIME format.
--------------481CF8FB0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Nilanjan Sarkar wrote:
>
> I need to know the easiest/simple way to find out the total Physical
> Space used by a database.
> I have a number of databases in the particular instance of
> Informix-Online DSS version7.13, and each of the databases spans across
> a number of dbspaces.
How about:
-----------------------(snip)----------------------------
# Get the page size
set `tbstat -b`
for i
do
if [ "X$2" = "Xbuffer" -a "X$3" = "Xsize" ]
then
BUFFSIZE=$1
break
fi
shift
done
# Get the extent sizes
a=0
for i in `tbcheck -pe|grep "database_name:" |awk '{print $3}'`
do
a=`expr $a + $i`
done
# Display the total
echo "`expr $a \\* $BUFFSIZE` Bytes"
echo "`expr $a \\* $BUFFSIZE / 1024` KBytes"
-----------------------(snip)----------------------------
This is off the top of my head and is probably not accurate. Also
beware that tbcheck (oncheck) locks tables, so not a command to run at
peak times. ;-)
Any command that begins tb... can be replaced with on... if your version
is 6.x or higher. This obviously does not do any checking like whether
OnLine is up and running. You could also accept a parameter for the
database name, but you get the idea.
Hope that helps,
--
--------------481CF8FB0
Content-Type: text/plain; charset=us-ascii; name="ATT_SIG.TXT"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="ATT_SIG.TXT"
Mark.
+------------------------------------------------------------------+
|Mark D. Stock - The West Solutions Group http://www.west.co.za |
| The Informix FAQ is at http://www.iiug.org |
|mailto:marks@west.co.za +-----------------------------------------+
|Tel: +27 11 803 2151 |If it doesn't work, force it! |
|Fax: +27 11 803 2189 |If it breaks, it needed replacing anyway!|
|Cell: +27 83 250 2325 |Well, that's how I code anyway! |
+------------------------+-----------------------------------------+
--------------481CF8FB0--