≡ Menu

db2

At the db2 prompt, use the command

list database directory

How to list all existing Schemas in a DB2 Database ?

Sometimes, you need to look at all the existing schemas in a db2 database. For example, when you try to connect to the database from your application, you might see a db2 exception stating that the database is not available. Once you confirm the database server is up and running, the next step is to check if the schemas you are using really exist. In this situation, listing all the schemas from a database server may be helpful.

First connect to the database via DB2 CLI (Command line interface) and then use the following query to list all the available schemas

First connect to the database vi DB2 CLI (Command line interface) and then use the following query to list all the available schemas

select schemaname from syscat.schemata