Tuesday, April 26, 2011

Useful Commands in DB2

D:\>db2 connect to <databaseName> user db2admin using db2admin
db2 -tf <sample_sql_file.sql> -v
(above cmd will import the sample_sql_file.sql file to the connected database at once.)

table alteration
alter table tableName alter column columnName set data type VARCHAR(500)

Database export / import
db2move databaseName export -p db2admin -u db2admin

Database configuration Modification Command
db2 update db cfg for databaseName using LOGFILSIZ 5000

Catalog/Uncatalog
db2 catalog database TestDB as TstDB
db2 uncatalog database TstDB

No comments:

Post a Comment