If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > Sizing a database

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-29-04, 11:47
NigelF NigelF is offline
Registered User
 
Join Date: Apr 2004
Posts: 7
Sizing a database

Quick easy question ... I presume....

We are looking to migrate a database from one server to another - what is the easiest way to determine the size of the current database? Is it as simple as 'onstat -d', adding up the number of pages for each chunk & multiply by the page size?

Thanks in advance
Reply With Quote
  #2 (permalink)  
Old 04-29-04, 11:58
Aroui Aroui is offline
Registered User
 
Join Date: Feb 2004
Location: Tunisia
Posts: 17
Hi,

u can run the SQL script :
select

sum(chksize) chsize

from syschunks,

sysdbspaces

where syschunks.dbsnum = sysdbspaces.dbsnum

and name ="<dbs_name>"

where <dbs_name> is the name of dbspace
where is stored your database

* chsize in pages
Reply With Quote
  #3 (permalink)  
Old 04-29-04, 12:10
Aroui Aroui is offline
Registered User
 
Join Date: Feb 2004
Location: Tunisia
Posts: 17
of course u must query the sysmaster database
Reply With Quote
  #4 (permalink)  
Old 05-17-04, 17:12
philionel36 philionel36 is offline
Registered User
 
Join Date: May 2004
Posts: 1
Measure the size of a database

Keep in mind that, if you use blobspaces, their page sizes are probably different from your normal page size.
Here's a query to report the actual size (in GB) of each dbspace on your server, including blobspaces. The script assumes your page size is 2K. If not, just change the 2048's to the correct size for your platform.

select a.name as dbspace,
round(sum(b.chksize)/512000,2) as total_gb,
decode(b.is_blobchunk, 1,
round(sum(b.nfree)/(512000 / (a.bpagesize / 2048)), 2),
round(sum(b.nfree)/512000,2)
) as free_gb,
decode(b.is_blobchunk, 1,
round((sum(b.nfree) * (a.bpagesize / 2048))/sum(b.chksize) * 100, 2),
round(sum(b.nfree)/sum(b.chksize) *100,2)
) as percent_free
from sysdbstab a,
syschunks b
where a.dbsnum = b.dbsnum
group by a.name, a.bpagesize, b.is_blobchunk
order by 1,4
Reply With Quote
  #5 (permalink)  
Old 05-18-04, 02:12
jh1213 jh1213 is offline
Registered User
 
Join Date: Jul 2003
Location: Beijing China
Posts: 36
DATABASE sysmaster;
SELECT stn.dbsname db_name,
SUM
(
sti.ti_npused *
(
select sh_pagesize from sysshmvals
)/1024/1024
) mb_used,

SUM
(
sti.ti_nptotal *
(
select sh_pagesize from sysshmvals
)/1024/1024
) mb_total
FROM systabnames stn, systabinfo sti, sysdatabases sdb
WHERE stn.partnum = sti.ti_partnum
AND stn.dbsname = sdb.name
GROUP BY stn.dbsname;
__________________
MSN:jianghua1213@hotmail.com
Beijing China
http://www.91talk.net
http://www.91talk.com
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On