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 > database size

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-03-04, 02:11
guesr guesr is offline
Registered User
 
Join Date: Apr 2004
Posts: 3
Talking database size

How would one find the informix database size
Reply With Quote
  #2 (permalink)  
Old 04-03-04, 12:03
RobP RobP is offline
Registered User
 
Join Date: Mar 2004
Location: Netherlands
Posts: 183
You could do the following:

select dbsname, sum(npused), sum(npdata)
from sysmaster:sysextents
where dbsname = '<put name of database here>'
group by 1

The forst one will give you the amount of pages allocated for this database, the second one (npdata) gives you the number of data pages.

Hope this helps,

Rob Prop
Reply With Quote
  #3 (permalink)  
Old 04-05-04, 01:38
guesr guesr is offline
Registered User
 
Join Date: Apr 2004
Posts: 3
Question Re: database size

Quote:
Originally posted by guesr
How would one find the informix database size
The query suggested is returning column not found .So can I have any other method to the same
Reply With Quote
  #4 (permalink)  
Old 04-05-04, 02:40
lloydnwo lloydnwo is offline
Registered User
 
Join Date: Aug 2003
Location: India
Posts: 262
Re: database size

Quote:
Originally posted by guesr
The query suggested is returning column not found .So can I have any other method to the same
Hi,

database sysmaster;
select sum(ti_nptotal) Total, sum(ti_npused) Used
from systabnames, systabinfo
where partnum = ti_partnum
order by 1
Reply With Quote
  #5 (permalink)  
Old 04-05-04, 15:47
RobP RobP is offline
Registered User
 
Join Date: Mar 2004
Location: Netherlands
Posts: 183
Sorry for the first answer I gave, but I messed up two SQL's.

First one:

SELECT sum(size)
FROM sysextents
WHERE dbsname = "<databasename>"

This will give you the space on disk of this database in pages. (All allocated pages)

Second one:
SELECT sum(nptotal), sum(npused),sum(npdata)
FROM sysptnhdr
WHERE partnum IN (SELECT partnum FROM systabname
WHERE dbsname = "<name of database>")

The firts column will give pages allocated, the second one pages used (data+indexes+blob+bitmap, etc), the third column will give the total amount of data pages.

I hope this will be helpfull,

Rob Prop
Reply With Quote
  #6 (permalink)  
Old 04-07-04, 00:18
guesr guesr is offline
Registered User
 
Join Date: Apr 2004
Posts: 3
Smile

Thanks for the reply. This query has been helpfull. Now can u give the size of Page size in KBs
Reply With Quote
  #7 (permalink)  
Old 04-07-04, 02:39
RobP RobP is offline
Registered User
 
Join Date: Mar 2004
Location: Netherlands
Posts: 183
Hi,

The page size is 4kb or 2kb.

4KB: MS-Windows platforms & IBM AIX
2KB: All unix and linux versions except AIX

Hope this helps,


Rob Prop
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