今天同事问db2命令安装问题,不知道我这个合不合他要求。其实很简单,在你图形化安装db2的最后可以把配置文件保存起来,以后安装的时候根据这个配置文件,不用下一步下一步的点了 :
有了安装配置文件再编写个bat文件就可以了,下面是bat文件(setup.bat)(其中 /U 指定响应文件的位置,而 echo %ERRORLEVEL% 指定您想要批处理进程显示安装返回码。 ):
"E:\DB2 8.2\setup.exe" /U "C:\Documents and Settings\zhanyan\My Documents\PROD_ESE.rsp"
echo %ERRORLEVEL%
下面是我的配置文件(PROD_ESE.rsp):
PROD=ENTERPRISE_SERVER_EDITION
LIC_AGREEMENT=ACCEPT
FILE=D:\Program Files\IBM\SQLLIB\ //(这个是数据库的安装目录)
INSTALL_TYPE=CUSTOM
COMP=SPATIAL_EXTENDER_SAMPLES
COMP=INFORMATION_CATALOG_SAMPLES
COMP=JDBC_SUPPORT
COMP=IBM_JDK
COMP=IBM_JRE
COMP=LDAP_EXPLOITATION
COMP=ODBC_SUPPORT
COMP=OLE_DB_SUPPORT
COMP=DB2_SAMPLE_APPLICATIONS
COMP=DB2_SAMPLE_DATABASE
COMP=WAREHOUSE_SAMPLE_DATABASE
COMP=SQLJ_SUPPORT
COMP=SQLJ_APPLICATION_DEVELOPMENT_TOOLS
COMP=SQLJ_SAMPLES
COMP=DB2_WEB_TOOLS
COMP=XML_EXTENDER
COMP=XML_EXTENDER_SAMPLES
COMP=APPC_DB2_CLIENT_SUPPORT
COMP=DATA_WAREHOUSE_CENTER
COMP=DATA_WAREHOUSE_SERVER
COMP=INFORMATION_CATALOG_CENTER
COMP=INFORMATION_CATALOG_CENTER_WEB
COMP=APPLICATION_DEVELOPMENT_TOOLS
COMP=REPLICATION_APPLY
COMP=BASE_CLIENT
COMP=SYSTEM_BIND_FILES
COMP=REPLICATION_CAPTURE
COMP=CONTROL_CENTER
COMP=CLIENT_TOOLS
COMP=COMMAND_CENTER
COMP=CONFIGURATION_ASSISTANT
COMP=CONNECT_SUPPORT
COMP=SATELLITE_CONTROL_SERVER
COMP=DATABASE_TOOLS
COMP=DEVELOPMENT_CENTER
COMP=INFORMIX_DATA_SOURCE_SUPPORT
COMP=WAREHOUSE_SAMPLES
COMP=EVENT_ANALYZER
COMP=FIRST_STEPS
COMP=SPATIAL_EXTENDER_CLIENT_SUPPORT
COMP=NETBIOS_DB2_CLIENT_SUPPORT
COMP=NETBIOS_DB2_LISTENER_SUPPORT
COMP=NPIPE_DB2_CLIENT_SUPPORT
COMP=NPIPE_DB2_LISTENER_SUPPORT
COMP=TCPIP_DB2_CLIENT_SUPPORT
COMP=TCPIP_DB2_LISTENER_SUPPORT
LANG=EN
LANG=CN
DAS_CONTACT_LIST=LOCAL
DATABASE=MD_DB
TOOLS_CATALOG_DATABASE=MD_DB
TOOLS_CATALOG_SCHEMA=SYSTOOLS
WAREHOUSE_CONTROL_DATABASE=MD_DB
WAREHOUSE_SCHEMA=IWH
MD_DB.DATABASE_NAME=DWCTRLDB
INSTANCE=DB2
INSTANCE=DB2CTLSV
MD_DB.INSTANCE=DB2
MD_DB.LOCATION=LOCAL
DB2.NAME=DB2
DB2CTLSV.NAME=DB2CTLSV
DEFAULT_INSTANCE=DB2
CTLSRV_INSTANCE=DB2CTLSV
DB2.SVCENAME=db2c_DB2
DB2CTLSV.SVCENAME=db2c_DB2CTLSV
DB2.DB2COMM=TCPIP
DB2CTLSV.DB2COMM=TCPIP
DB2.PORT_NUMBER=50000
DB2CTLSV.PORT_NUMBER=50001
DB2.FEDERATED=YES
DB2.AUTOSTART=YES
DB2CTLSV.AUTOSTART=YES
DB2.USERNAME=ies //(数据库密码)
DB2CTLSV.USERNAME=ies
MD_DB.USERNAME=ies
DB2.PASSWORD=235263359 //(密码,这里就不太明白了,这个密码怎么搞倒不会,我原来不是这个,是字母的)
ENCRYPTED=DB2.PASSWORD
DB2CTLSV.PASSWORD=235263359
ENCRYPTED=DB2CTLSV.PASSWORD
MD_DB.PASSWORD=235263359
ENCRYPTED=MD_DB.PASSWORD
DAS_USERNAME=ies
DAS_PASSWORD=235263359
ENCRYPTED=DAS_PASSWORD
DB2_EXTSECURITY=YES
DB2_USERSGROUP_NAME=DB2USERS
DB2_ADMINGROUP_NAME=DB2ADMNS
-----补注:在PROD_ESE.rsp文件中 //这里补注的内容在安装的时候需要去掉