When I start to use a new Database Relational System like IBM DB2, first thing I think is "I need to learn how to do this...", so, here is a set of commands I hope you find very useful. If you want to obtain a more complete list of commands, please visit: How to list DB2 commands.
Changing number of concurrent databases
If you receive and error like this:
Run following command:
Starting and stopping DB2
Before restarting any IBM DB2 server, I would recommend to display all applications and users that are connected to the specific database that you want to stop. To ensure that no vital or critical applications are running.
Following command list all applications
If you change any configuration parameter, you will probably need to restart, so, stop database server with:
Now, for starting IBM DB2 again, run following command:
Working with schemas
Creating a new schema
If you want to list schema users, just run following command:
As you can see part of the information about schemas and users is stored in syscat.schemata.
Getting information about databases and tables
Connect to the database
List information about tables
List all tables:
To list all tables in selected schema, use:
To describe a table, type:
List information about databases
If you just want the database names, without the titles, use: