Results 1 to 7 of 7

Thread: database size

  1. #1
    Join Date
    Apr 2004
    Posts
    3

    Talking Unanswered: database size

    How would one find the informix database size

  2. #2
    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

  3. #3
    Join Date
    Apr 2004
    Posts
    3

    Question Re: database size

    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

  4. #4
    Join Date
    Aug 2003
    Location
    India
    Posts
    262

    Re: database size

    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

  5. #5
    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

  6. #6
    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

  7. #7
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •