2017/04/13

Some DB2 commands

Switch to db2inst1 user

su - db2inst1

Start and stop DB. All db2 commands should be between these two

db2start

db2 ...

db2stop

List all databases in the instance

db2 LIST DATABASE DIRECTORY

Connect to a certain database

db2 connect to MY_DATABASE_NAME

List all tables in all schemas

db2 list tables for all

List tables in a certain schema

db2 list tables for schema DB2INST1

Do a SQL Query

db2 "select * from MY_TABLE"

0 comments :