Results 1 to 7 of 7
  1. #1
    Join Date
    Aug 2003
    Posts
    7

    Question Unanswered: Size of a DB2 database

    Hello everybody!

    Does anyone know how to get the size of a database with a tool or something like that?
    I want to build a automaticly updated statistic.

    I'm using WIN NT 4

    Thanks a lot!

    Markus

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    Re: Size of a DB2 database

    The phrase 'size of a database' is too generic ...

    Tablespaces take up maximum amount of space ....

    You can obtain this info from the output of the db2 list tablespaces show detail command

    Tablespace ID = 2
    Name = USERSPACE1
    Type = System managed space
    Contents = Any data
    State = 0x0000
    Detailed explanation:
    Normal
    <b> Total pages = 584430</b>
    Useable pages = 584430
    <b> Used pages = 584430 </b>
    Free pages = Not applicable
    High water mark (pages) = Not applicable
    Page size (bytes) = 4096
    Extent size (pages) = 32
    Prefetch size (pages) = 32
    Number of containers = 1
    Minimum recovery time = 2003-03-25-12.03.30.000000

    You can script this to report

    Total used pages : Used Size : Gb
    Total alloc pages : Allocated Size : Gb

    When using this script, it has to be remembered that SMS tablespaces allocated space as and when required ... Your tempspaces (mostly SMS) will grow and shrink ...

    Apart from data, it is the log files which use disk space ...

    The others (like the control files etc) use negligible amount ...

    HTH

    Sathyaram


    Originally posted by pluto007
    Hello everybody!

    Does anyone know how to get the size of a database with a tool or something like that?
    I want to build a automaticly updated statistic.

    I'm using WIN NT 4

    Thanks a lot!

    Markus
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  3. #3
    Join Date
    Aug 2003
    Posts
    7

    Re: Size of a DB2 database

    Hello,

    thank you for the very fast answer. I know about the list tablespaces command, but I think it's a littlebit tricky to read the size out of this infos, because i have to write a perl script to connect to each database, look for the userspaces, collect the data and write it i a table...

    It would be enough to get one number of GB for all tablespaces.

    I don't know, if this is possible?

    (Like manually using the explorer and right click on the SQLxxx-Folder and then use Properties to see the size...)

    Thanks a lot.
    Markus

    Originally posted by sathyaram_s
    The phrase 'size of a database' is too generic ...

    Tablespaces take up maximum amount of space ....

    You can obtain this info from the output of the db2 list tablespaces show detail command

    Tablespace ID = 2
    Name = USERSPACE1
    Type = System managed space
    Contents = Any data
    State = 0x0000
    Detailed explanation:
    Normal
    <b> Total pages = 584430</b>
    Useable pages = 584430
    <b> Used pages = 584430 </b>
    Free pages = Not applicable
    High water mark (pages) = Not applicable
    Page size (bytes) = 4096
    Extent size (pages) = 32
    Prefetch size (pages) = 32
    Number of containers = 1
    Minimum recovery time = 2003-03-25-12.03.30.000000

    You can script this to report

    Total used pages : Used Size : Gb
    Total alloc pages : Allocated Size : Gb

    When using this script, it has to be remembered that SMS tablespaces allocated space as and when required ... Your tempspaces (mostly SMS) will grow and shrink ...

    Apart from data, it is the log files which use disk space ...

    The others (like the control files etc) use negligible amount ...

    HTH

    Sathyaram

  4. #4
    Join Date
    Jan 2003
    Posts
    1,605
    Hi,

    I don't know the perl scripts works, but maybe you can use the following Windows command:
    dir SQL00001 /s

    Then you can try with perl script get one before last line of data. This is the data you are looking for.

    Hope this helps,
    Grofaty

  5. #5
    Join Date
    Aug 2003
    Posts
    7
    Hello,

    yes I had this in mind, too, but the difficult thing is, that I don't know how to automatocally get to know which SQLxxx folder is for which database?

    Many Greets
    Markus

    Originally posted by grofaty
    Hi,

    I don't know the perl scripts works, but maybe you can use the following Windows command:
    dir SQL00001 /s

    Then you can try with perl script get one before last line of data. This is the data you are looking for.

    Hope this helps,
    Grofaty

  6. #6
    Join Date
    Jan 2003
    Posts
    1,605
    Hi,

    Do you have so many databases, that you can't simply manualy add the db_name in your perl script?

    Grofaty

  7. #7
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    HTH

    Sathyaram

    C:\Documents and Settings\Sathyaram>db2 list db directory

    System Database Directory

    Number of entries in the directory = 1

    Database 1 entry:

    Database alias = SAMPLE
    Database name = SAMPLE
    Database drive = C:\DB2
    Database release level = a.00
    Comment =
    Directory entry type = Indirect
    Catalog database partition number = 0


    C:\Documents and Settings\Sathyaram>db2 list db directory on C:\

    Local Database Directory on C:\

    Number of entries in the directory = 1

    Database 1 entry:

    Database alias = SAMPLE
    Database name = SAMPLE
    Database directory = SQL00001
    Database release level = a.00
    Comment =
    Directory entry type = Home
    Catalog database partition number = 0
    Database partition number = 0


    C:\Documents and Settings\Sathyaram>






    Originally posted by pluto007
    Hello,

    yes I had this in mind, too, but the difficult thing is, that I don't know how to automatocally get to know which SQLxxx folder is for which database?

    Many Greets
    Markus
    Visit the new-look IDUG Website , register to gain access to the excellent content.

Posting Permissions

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