文档详情

DB2常用管理维护命令.doc

发布:2017-08-20约2.11万字共28页下载文档
文本预览下载声明
DB2常用管理维护命令 =========DB2常用的命令====================================== 启动数据库 db2start 停止数据库 db2stop 连接数据库 db2 connect to bgj0 user db2inst using password 读数据库管理程序配置 db2 get dbm cfg 写数据库管理程序配置 db2 update dbm cfg using 参数名 参数值 读数据库的配置 db2 connect to bgj0user db2 using pwd db2 get db cfg for bgj0 写数据库的配置 db2 connect to user db2 using pwd db2 update db cfg for bgj0 using 参数名 参数值 ===================================================================== 关闭所有应用连接 db2 force application all db2 force application(8) ===================================================================== 备份数据库 db2 force application all db2 backup db bgj0 to d: (db2 initialize tape on [url=file://\\.\tape0]\\.\tape0) (db2 rewind tape on [url=file://\\.\tape0]\\.\tape0) db2 backup db bgj0 to [url=file://\\.\tape0]\\.\tape0 恢复数据库 db2 restore db bgj0 from d: to d: db2 restore db bgj0 from [url=file://\\.\tape0]\\.\tape0 to d: 前滚数据库 db2 rollforward db db3test to end of logs and complete db2 rollforward db db3test to [timestamp] and complete db2 rollforward db db3test to [timestamp] using local time and complete ======================================================================== 如何查看数据库的存储过程? SELECT * FROM SYSCAT.PROCEDURES 绑定存储过程 db2 connect to bgj0 user db2 using pwd db2 bind c:\dfplus.bnd 拷贝存储过程到服务器上的C:\sqllib\function目录中 ======================================================================= 导出表数据 db2 export to c:\dftz.txt of del select * from dftz db2 export to c:\dftz.ixf of ixf select * from dftz 导入表数据 import from c:\123.txt of del insert into ylbx.czyxx(把123文件中的内容以DEL格式插入到ylbx模式下的czyxx表中,加至czyxx表中数据的后面) db2 import from c:\dftz.txt of del commitcount 5000 messages c:\dftz.msg insert into dftz(将c盘下dftz文件中的内容记录以del格式导至dftz表中,每5000条提交一次,并在dftz.msg文件中记录过程中的报警信息) db2 import from c:\dftz.ixf of ixf commitcount 5000 messages c:\dftz.msg insert into dftz(将c盘下dftz文件中的内容记录以ixf格式导至dftz表中,每5000条提交一次,并在dftz.msg文件中记录过程中的报警信息) db2 import from c:\
显示全部
相似文档