I got around 98 instances in a single AIX server. I need to list all the tablespaces, their path and usage. Is there a way I can do that without getting into each instance, connecting into the database etc?

  • It would help to know your Db2 version. If you really have 90+ instances, each one of them would presumably require different credentials to obtain this information
    – mustaccio
    Oct 2 '20 at 17:35

I don't have anywhere to test this at the moment, but either of these might work.

  1. If you have su privileges to all instance owner users:

    db2ilist | while read inst; do su - $inst db2pd -alldbs -tablespaces; done
  2. If you have sufficient privileges on all instances yourself:

    db2ilist | while read inst; do env DB2INSTANCE=$inst db2pd -alldbs -tablespaces; done

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.