DB2: Databases Cheat Sheet

Creating non-restrictive database

db2 create database <database name>

Creating restrictive database

db2 create database <db_name> restrictive 

Creating database with different user defined location

db2 create database '<db_name>' on '<data location>' dbpath on '<db_path_location>'  

Viewing local or system database directory files

db2 list database directory 

Activating database

db2 activate db <db_name> 

Deactivating database

db2 deactivate db <db_name>

Connecting to database

db2 connect to <database name> 

Verifying if database is restrictive

db2 get db cfg for <db_name> | grep -i restrict 

Configuring the database manager and the database

  • Database Manager Configuration Parameters

Get the information of Instance Database manager

db2 get database manager configuration   

Update instance database manager

db2 update database manager configuration   

Reset previous configurations

db2 reset database manager configuration  
  • Database Configuration Parameters

Get the information of Database

db2 get database configuration   

Update the database configuration

db2 update database configuration    

Reset the previously configured values in database configuration

db2 reset database configuration     

Dropping Database

db2 drop database <db_name>

Leave a Reply

Your email address will not be published. Required fields are marked *