Finding Containers associated with one specific Tablespace in DB2.
- Jha Chandan

- Jan 15, 2022
- 2 min read
Well all tablespaces are associated with one or more containers. In this blog we will see how to list out containers which are associated with one specific tablespace. Lets find out containers by using below two commands"
db2pd
1. You need to connect your database first.
db2 connect to <db_name>
MITHILA is the database name in my case.
2. Type below command to find out the specific tablespace id for which you want to list out associated containers.
db2 list tablespaces show detail |egrep -i "id|name"
3. Now use below db2pd command to find out associated containers.
db2pd -d MITHILA -tablespaces tbs 2The number 2 above, is the tablespaceid.

Here you can see the containers at the last part of the output once you execute the above command.
Continer: /home/db2inst1/db2data2/MITHILA/db2inst1/NODE0000/MITHILA/T0000002/C0000000.LRG
Also you can get a lot of info from a specific tablespace, such as PageSize - ExtentSize - Prefetch - TotPages - UsablePgs - UsedPgs
db2 list tablespaces
1. You need to connect your database first.
db2 connect to <db_name>
MITHILA is the database name in my case.
2. Type below command to find out the specific tablespace id for which you want to list out associated containers.
db2 list tablespaces show detail |egrep -i "id|name"
3. Now use below db2 list tablespace command to find out associated containers.
db2 list tablespace containers for 2 show detailThe number 2 above, is the tablespaceid.

Here you can see the containers at the last part of the output once you execute the above command.
Continer: /home/db2inst1/db2data2/MITHILA/db2inst1/NODE0000/MITHILA/T0000002/C0000000.LRG
Also you can get a lot of info from a container , such as Total pages, Useable pages and accessible.
That's all in this post. If you liked this blog and interested in knowing more about IBM Db2. Please Like, Follow, Share & Subscribe to www.ImJhaChandan.com.











Comments