DB2数据库部分日常实用操作

豆豆网   技术应用频道   2007年05月20日  【字号: 收藏本文

本文详细介绍DB2数据库部分日常实用操作

  DB2数据库

  1、Load 方法装入数据:

  export to tempfile of del select * from TABLENAME where not 清理条件;

  load from tempfile of del modified by delprioritychar replace into TABLENAME nonrecoverable;

  说明:

  在不相关的数据表export数据时,可以采取并发的形式,以提高效率;

  TABLENAME指待清理table的名称;

  modified by delprioritychar防止数据库记录中存在换行符,导致数据无法装入的情况;

  replace into对现数据库中的内容进行替换,即将现行的数据记录清理,替换为数据文件内容;

  nonrecoverable无日志方式装入;

  2、查找当前的应用:

  db2 list application |grep BTPDBS;

  3、删除当前正在使用的application:

  db2 "force application (Id1,Id2,Id3)"

  Id1,Id2,Id3 是List显示的应用号;

  4、查看当前应用号的执行状态:

  db2 get snapshot for application agentid 299 |grep Row

  5、查看数据库参数:

  db2 get db cfg for  //当前数据库可以省略

  6、修改数据库的Log数据:

  db2 update db cfg using <参数名> <参数值>

  7、Db2Stop Force的用法:

  在进行Bind的时候出现如下错误:

    SQL0082C An error has occurred which has terminated processing.

    SQL0092N No package was created because of previous errors.

    SQL0091N Binding was ended with "3" errors and "0" warnings.

  主要是表文件被加锁,不能继续使用;

  在进行stop的时候报错:db2stop

  8/03/2005 21:46:53 0 0 SQL1025N The database manager was not stopped because databases are still active.

责编:豆豆技术应用

正在加载评论...