set DBPATH=c:
set DBNAME=EXPRESS2
set MEMORY=25
db2 CREATE DATABASE %DBNAME% ON %DBPATH% AUTOCONFIGURE USING
      MEM_PERCENT %MEMORY% APPLY DB AND DBM
db2 CONNECT TO %DBNAME% USER %1 USING %2
de1 schema.log triggers.log app_objects.log
db2 set schema EXPRESS
db2 -tvf schema.db2 -z schema.log
db2 -td@ -v -f triggers.db2 -z triggers.log
db2 -td@ -v -f functions.db2 -z functions.log

file dreat_database.bat

为了运行这段脚本,你可以在windows的命令行中输入下面的语句.
create_database.bat db2admin(user) ibmdb2(pass)