DB2′s get_dbsize_info Function
db2 => connect to dd
Database Connection Information
Database server = DB2/LINUX 8.2.8
SQL authorization ID = DB2UDB
Local database alias = dd
SQL authorization ID = DB2UDB
Local database alias = dd
db2 => call get_dbsize_info(?,?,?,-1)
Value of output parameters
--------------------------
Parameter Name : SNAPSHOTTIMESTAMP
Parameter Value : 2014-08-10-15.53.40.550222
--------------------------
Parameter Name : SNAPSHOTTIMESTAMP
Parameter Value : 2014-08-10-15.53.40.550222
Parameter Name : DATABASESIZE
Parameter Value : 216819380224
Parameter Value : 216819380224
Parameter Name : DATABASECAPACITY
Parameter Value : 439644852736
Parameter Value : 439644852736
Return Status = 0
db2 =>
With a bit of math, we can see that the size of the database is 201.92 GB. These numbers include only used pages in the tablespace. This means that it essentially covers table data and index data and not much else. It also means that if you have DMS tablespaces with a large amount of free space, you may have more space actually taken up on disk than the value of DATABASESIZE as reported here.
The DATABASECAPACITY is calculated by adding up pages that have been allocated but not used in DMS tablespaces and filesystem free space for filesystems that hold SMS tablespaces. There are problems inherent in that, of course – you may have a lot of filesystem space where DMS containers reside that would not be reflected in DATABASECAPACITY until you extend the tablespace(s) to use them, and you may also have SMS tablespaces in a filesystem where you really shouldn’t use the filesystem up to 100%.
No comments:
Post a Comment