Raghu On Tech

Pro tips on managing data at scale

How To Measure Tablespace Utilization In DB2 ?

by | Mar 31, 2019 | 0 comments

Problem:

You would like to find out quickly how much space your tablespaces are utilizing and how much space is being wasted below the high watermark with in a tablespace, how would you look for it ? While there are multiple ways to pull out that information but ever since MON_GET functions were introduced I rarely have to look past them.

Enough with the talk, lets take a look at the SQL…

Solution:

Simply running below SQL will provide you with high level tablespace utilization and space wastage report for top 20 of the tablespaces with in your database.

 

Running the above SQL will provide you with an output that looks something like below. Note that here I am only asking for the top 20 tablespaces based on the space utilization. You could ask for more or less depending on what you need. Also don’t think that we are crazy by naming all the tablespaces as TABLESPACE* 🙂 I am just trying to be safe by not disclosing any of my employers business related information.

As you can see from the above output, there are a few tablespaces where space could be reclaimed from them. Depending on the type of tablespace you may be able to reclaim all of the wasted storage. If you would like to know how to reclaim the unused storage from a tablespace, please take a look at the below blog post.

How To Reclaim Wasted Storage From A DMS/AS Tablespace

Hope you enjoyed this short blog post from me, I will try to blog more frequently as I am getting more requests from the readers.

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Shares
Share This