WEB开发网
开发学院数据库DB2 DB2数据库日常实用操作 阅读

DB2数据库日常实用操作

 2007-11-03 14:58:09 来源:WEB开发网   
核心提示:1、Load 方法装入数据:export to tempfile of del select * from TABLENAME where not 清理条件;load from tempfile of del modified by delprioritychar replace into TABLENAME nonr

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.

SQL1025N The database manager was not stopped because databases are still active.

需要使用如下命令可以解决这个问题: db2stop force

08/03/2005 21:47:49  0 0 SQL1064N DB2STOP processing was successful.

SQL1064N DB2STOP processing was successful.

然后启动数据库db2start,连接数据库db2s后,重新进行bind即可。

1 2 3  下一页

Tags:DB 数据库 日常

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接