1、操作系统环境:windows(linux的方法我下面也会贴出来)1、首先在windows安装完DB2以后,打开DB2的命令行,然后依次执行下面代码.(下面有一句话脚本会提示你一个类似异常的信息,不予以理会,继续执行下面别的代码)[sql] viewplaincopy1.db2 "CREATE DB newhrcb using codeset UTF-8 territory cn" 2. 这一句执行非常慢,要耐心等待几分钟3.db2 "UPDATE DB CFG FOR newhrcb USING applheapsz 4096" 4. 5.db2 "U
2、PDATE DB CFG FOR newhrcb USING app_ctl_heap_sz 1024" 6. 7.db2 "UPDATE DB CFG FOR newhrcbUSING stmtheap 8192" 8. 9.db2 "UPDATE DB CFG FOR newhrcbUSING dbheap 2400" 10. 11.db2 "UPDATE DB CFG FOR newhrcbUSING locklist 1000" 12. 13.db2 "UPDATE DB CFG FOR newhrcbUSING logfilsiz 1
3、000" 14. 15.db2 "UPDATE DB CFG FOR newhrcbUSING logprimary 12" 16. 17.db2 "UPDATE DB CFG FOR newhrcbUSING logsecond 20" 18. 19.db2 "UPDATE DB CFG FOR newhrcbUSING logbufsz 32" 20. 21.db2 "UPDATE DB CFG FOR newhrcbUSING avg_appls 5" 22. 23.db2 "UPDATE DB CFG FOR newhrcbUSIN
4、G locktimeout 30" 24. 25.db2 CONNECT TO newhrcb26. 27.db2 "CREATE BUFFERPOOL newhrcbbuffer SIZE 1000 PAGESIZE 32K" -->创建缓冲区28. 29.db2 "CREATE TABLESPACE newhrcbspace PAGESIZE 32K MANAGED BY SYSTEM USING ('F:DB2sqlt0003.0') BUFFERPOOL newhrcbbuffer"(根据实际情况确定是否是D盘下的db2adminsql