PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, October 19, 2022

[FIXED] How do I find the size of a DB2 (luw) database?

 October 19, 2022     admin, database, db2, db2-luw     No comments   

Issue

I know you can look at the size of an uncompressed backup, but that's not practical.

Is there a command to find the size of the database while it is online? (In Linux/Unix/windows)


Solution

When connected to a database as db2admin (or with similar permissions), use the following command:

 call get_dbsize_info(?,?,?,-1);

The first three parameters are output parameters:

Value of output parameters
--------------------------
Parameter Name  : SNAPSHOTTIMESTAMP
Parameter Value : 2014-06-17-13.59.55.049000

Parameter Name  : DATABASESIZE
Parameter Value : 334801764352

Parameter Name  : DATABASECAPACITY
Parameter Value : 1115940028416

Return Status = 0

The size is given in bytes, so divide by 1024^3 to get Gb.

The final parameter is how often the snapshot is refreshed. -1 is to use default settings.

Further reading...

Note: This command does not take into account logs, etc. - so, it may appear much larger on disk.



Answered By - ESP
Answer Checked By - Timothy Miller (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing