运行 sql file:
db2 -tvf ttt.sql
db2 -td@ -f filename // @为分隔符
db2 list command options
Some of the options that you can control are:
- The auto-commit of each statement that you can define using the
c
flag. - An an input file that provides the DB2 commands and SQL statements which you can define using the
f
flag. - The end-of-statement termination character (the default character is
;
), defined by thet
flag.
delete database :
db2 force applications all;
db2 terminate ;
db2 drop database databasename;
remove database后恢复:db2 catalog db yourdbname on E:
无法creagte db : db2 uncatalog db yourdbname
db2relocatedb
- Changing a database name
- Changing the path/drive that a database was created on
- Changing one or more table space containers
- Changing the log path associated with the database
- Changing the instance associated with a database
- Copying/moving a database to the same (or different) machine and making one or more of the above changes
http://www.ibm.com/developerworks/data/library/techarticle/dm-0407schlamb/
http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.udb.doc/core/r0004500.htm
Fast _delete _ all data
EXPORT TO C:/TABLE.IXF OF IXF SELECT *FROM HOMEPAGE."SR_INDEX_DOCS" WHERE 1=2
import from C:/TABLE.IXF of ixf replace into HOMEPAGE."SR_INDEX_DOCS"