top of page

Finding Containers associated with one specific Tablespace in DB2.

  • Writer: Jha Chandan
    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 2

The 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 detail

The 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


jc_logo.png

Hi, thanks for stopping by!

Welcome to my “Muse & Learn” blog!
Muse a little, learn a lot.✌️

 

Here you’ll find practical SQL queries, troubleshooting tips with fixes, and step-by-step guidance for common database activities. And of course, don’t forget to pause and muse with us along the way. 🙂
 

I share insights on:​​

  • Db2

  • MySQL

  • SQL Server

  • Linux/UNIX/AIX

  • HTML …and more to come!
     

Whether you’re just starting out or looking to sharpen your DBA skills, there’s something here for you.

Let the posts
come to you.

Thanks for submitting!

  • Instagram
  • Facebook
  • X
2020-2025 © TechWithJC

Subscribe to Our Newsletter

Thanks for submitting!

  • Facebook
  • Instagram
  • X

2020-2025 © TechWithJC

bottom of page