DB2数据库命令简介1.启动数据库db2start2.停止数据库db2stop3.连接数据库db2 connect to o_yd user db2 using pwd4.读数据库管理程序配置db2 get dbm cfg5.写数据库管理程序配置db2 update dbm cfg using 参数名 参数值6.读数据库的配置db2 connect to o_yd user db2 using pwddb2 get db cfg for o_yd7.写数据库的配置db2 connect to o_yd user db2 using pwddb2 update db cfg for o_yd using 参数名 参数值8.关闭所有应用连接db2 force application alldb2 force application ID1,ID2,,,Idn MODE ASYNC(db2 list application for db o_yd show detail)9.备份数据库db2 force application alldb2 backup db o_yd to d:(db2 initialize tape on \. ape0)(db2 rewind tape on \. ape0)db2 backup db o_yd to \. ape010.恢复数据库db2 restore db o_yd from d: to d:db2 restore db o_yd from \. ape0 to d:11.绑定存储过程db2 connect to o_yd user db2 using pwddb2 bind c:dfplus.bnd拷贝存储过程到服务器上的C:sqllibfunction目录中12.整理表db2 connect to o_yd user db2 using pwddb2 reorg table ydddb2 runstats on table ydd with distribution and indexes all13.导出表数据db2 export to c:dftz.txt of del select * from dftzdb2 export to c:dftz.ixf of ixf select * from dftz14.导入表数据import from c:123.txt of del insert into ylbx.czyxxdb2 import to c:dftz.txt of del commitcount 5000 messages c:dftz.msg insert into dftzdb2 import to c:dftz.ixf of ixf commitcount 5000 messages c:dftz.msg insert into dftzdb2 import to c:dftz.ixf of ixf commitcount 5000 insert into dftzdb2 import to c:dftz.ixf of ixf commitcount 5000 insert_update into dftzdb2 import to c:dftz.ixf of ixf commitcount 5000 replace into dftzdb2 import to c:dftz.ixf of ixf commitcount 5000 create into dftz (仅IXF)db2 import to c:dftz.ixf of ixf commitcount 5000 replace_create into dftz (仅IXF)15.执行一个批处理文件db2 -tf 批处理文件名(文件中每一条命令用 ;结束)16.自动生成批处理文件建文本文件:temp.sqlselect "runstats on table DB2." || tabname || "with distribution and detailed indexes all;"from syscat.tables where tabschema="DB2" and type="T";db2 -tf temp.sql>runstats.sql17.自动生成建表(视图)语句在服务器上:C:sqllibmisc目录中db2 connect to o_yd user db2 using pwddb2look -d o_yd -u db2 -e -p -c c:o_yd.txt18.其他命令grant dbadm on database to user bb19select * from czyxx fetch first 1 rows only20db2look -d ylbx -u db2admin -w -asd -a -e -o a.txt21. 显示当前用户所有表 list tables22.列出所有的系统表 list tables for system23.查看表结构 db2 describe select * from user.tablesOracle SQL最佳实践Linux下64位MySQL安装部署过程相关资讯 Linux知识
- 时光总是太匆匆!Linux已经诞生23 (08/29/2014 14:12:03)
- Linux虚拟文件系统之文件打开(sys (02/14/2012 11:41:54)
- 2012 年 Linux 峰会时间表 (02/14/2012 06:47:27)
| - 报告称当前 Linux 人才抢手 高薪也 (02/15/2012 06:35:56)
- 解析企业为何选择Linux及其特别之 (02/14/2012 08:17:59)
- Linux禁用字符闪烁的方法 (11/02/2011 10:28:25)
|
本文评论 查看全部评论 (0)