Useful Commands - DB2

The following commands operate on the current DB2 connection that you have open.

Description Command
Installs a DB2 bind (BND) file. Used on a production server or to rollback a test server. Note that the BND file name is case-sensitive. db2 bind FilePathAndName.bnd isolation UR
Export data to a text file db2 export to FilePathAndName.del of del SqlSelectStatement
Import data from a text file db2 import from FilePathAndName.del of del commitcount 100 insert into userid.TableName
Export data to a binary file db2 export to FilePathAndName.ixf of ixf SqlSelectStatement
Import data from a binary file db2 import from FilePathAndName.ixf of ixf commitcount 100 insert into userid.TableName
Start and/or end a transaction db2 commit
Rollback a transaction to the last commit command db2 rollback
Display info about a SQL error code db2 ? SQLnnnn where nnnn is the four-digit error code.