DB2 Useful Commands
SYNTAX Description
Db2Start
|
To Start an Instance
|
Db2Stop
|
To Stop an Instance
|
Db2 Connect to <DB>
|
connect to database
|
Db2Stop Force
|
To stop the database manager instance forcefully
|
Db2cc
|
start the db2 control center
|
Db2 List Db Directory
|
To list all databases in an instance
|
Db2 List Tables
|
To list all tables in the connected Database
|
Db2 List Applications
|
List all Applications Connected
|
Db2 get db Cfg
|
Displays the configuration of a connected Database
|
Db2 get db cfg for databasename
|
Displays the configuration of a database Mentioned
|
Db2 get DBM Cfg
|
Displays the database level Configuration settings
|
Db2Terminate
|
Ends the Process & drops all resources
|
Db2licm -l
|
Displays the licence details
|
Db2 activate db
|
Activate the database
|
Db2level
|
Version of db2
|
Db2 call get_dbsize_info(?,?,?,-1)
|
To get size of database
|
Db2 connection reset
|
Stops the connection to database
|
Db2 create database databasename
|
To create database
|
Db2 Backup database databasename
|
Backup database using Offline
|
Db2 list tableSpaces
|
List all TableSpaces in the connected Database
|
Db2 Tables Under Schema
|
Db2 list tables for schema <schemaname>
|
Db2 Schemas
|
Db2 select schemaname from syscat.schemata
|
Db2 Values Current Schema
|
Gets the current Schema
|
Syscat.TabConst
|
TableConstraints
|
Syscat.checks
|
column checks
|
Syscat.colchecks
|
Column Constraints
|
Syscat.References
|
Referential Constaints
|
db2 get db cfg | grep -i log
|
Log file size
|
db2 get db cfg | grep -i hadr
|
Hadr Status
|
db2 get dbm cfg | grep -i SVCENAME
|
ServiceName
|
cat /etc/services | grep -i DB2_db2inst2
|
Instance Port Number
|
cat /etc/services
|
All Port Numbers
|
cat /etc/passwd
|
Showing All Instances
|
db2pd -db dbname -hadr
|
Hadr Status
|
db2 takeover hadr on db <dbname>
|
Swap roles of primary and standby
|
db2 takeover hadr on db <dbname> by force
|
Takeover
Primary operation on the standby db when the original primary is down
|
Comments
Post a Comment