DB2 LUW: Find out database size

There are two queries you can run, as below, to find out DB size:

$ db2

db2 => connect to fp6

Database Connection Information

Database server = DB2/LINUXX8664 10.5.7
SQL authorization ID = DB2INST1
Local database alias = FP6

Query1:

db2 => SELECT db_size, db_capacity FROM systools.stmg_dbsize_info

DB_SIZE       DB_CAPACITY
——–      ———— ——————–
126603264     5179437056

1 record(s) selected.

Note: DB_SIZE in bytes.

Query2:

db2 => call get_dbsize_info (? , ? , ?, -1)

Value of output parameters
————————–
Parameter Name : SNAPSHOTTIMESTAMP
Parameter Value : 2016-06-04-01.21.17.718397

Parameter Name : DATABASESIZE
Parameter Value : 126603264

Parameter Name : DATABASECAPACITY
Parameter Value : 5179437056

Return Status = 0

Note: DATABASESIZE is in bytes.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: