Chinaunix首页 | 论坛 | 博客
  • 博客访问: 463646
  • 博文数量: 97
  • 博客积分: 3396
  • 博客等级: 中校
  • 技术积分: 996
  • 用 户 组: 普通用户
  • 注册时间: 2006-01-25 13:14
文章分类

全部博文(97)

文章存档

2014年(1)

2013年(2)

2012年(7)

2011年(13)

2010年(18)

2009年(7)

2007年(10)

2006年(39)

分类:

2006-04-06 18:20:22

The LOAD utility is significantly faster than the IMPORT utility
All phases of the LOAD process are part of one operation that is run
only after all three phases complete successfully. The three phases
are:
Load—data is written into the table
Build—indexes are created
Delete—rows that caused a unique constraint violation are removed from the table
 
db2 => load from /db2/db2export of del insert into rongke(下面的提示对LOAD的过程进行解析)             
SQL3501W  The table space(s) in which the table resides will not be placed in
backup pending state since forward recovery is disabled for the database.
SQL3109N  The utility is beginning to load data from file "/db2/db2export".
SQL3500W  The utility is beginning the "LOAD" phase at time "04/06/2006
13:55:26.637989".
SQL3519W  Begin Load Consistency Point. Input record count = "0".
SQL3520W  Load Consistency Point was successful.
SQL3110N  The utility has completed processing.  "4" rows were read from the
input file.
SQL3519W  Begin Load Consistency Point. Input record count = "4".
SQL3520W  Load Consistency Point was successful.
SQL3515W  The utility has finished the "LOAD" phase at time "04/06/2006
13:55:26.999497".
SQL3500W  The utility is beginning the "BUILD" phase at time "04/06/2006
13:55:27.025146".
SQL3213I  The indexing mode is "REBUILD".
SQL3515W  The utility has finished the "BUILD" phase at time "04/06/2006
13:55:27.345966".
SQL3500W  The utility is beginning the "DELETE" phase at time "04/06/2006
13:55:27.849378".
SQL3509W  The utility has deleted "4" rows from the table.
SQL3515W  The utility has finished the "DELETE" phase at time "04/06/2006
13:55:27.958359".
使用db2look
 
db2 connect   to  db2cert
导出建库表结构的SQL (相当于INFORMIX DBEXPORT的输出/DIR/DBNAME.EXP/dbname.sql备份成ASCII文件格式)
$ db2look -d db2cert -a -e -x -o /db2/db2move/my.sql
参数说明:
-a: Generate statistics for all creators
-e: Extract DDL file needed to duplicate database
-e: Extract DDL file needed to duplicate database
 -x: Generate Authorization statements DDL excluding the original definer of the object
使用DB2MOVE
$cd /db2/db2move/(MOVE的结果放在/DB2/db2move下)
$ db2move db2cert export
如要导入的数据库名与原数据库不同,要修改my.sql中CONNECT 项
vi my.sql
注意新库中的TABLESPACES是否对应DB2CERT的TABLESPACE
 
如果想改变的话,你可以先建表指定表空间然后再import!!
db2move  NEWDB  import
将数据导入新库中
在导入中可能因为种种原因发生中断,会使数据库暂挂
db2    list tablespaces   show   detail
db2 select tabname,tableid from syscat.tables where tableid=59
查看是哪张表挂起
表名知道后到db2move.lst(在db2move  YOURDB  export的目录中)中找到相应的.ixf文件
 db2 load from tab11.ixf of ixf terminate into db2admin.xxxxxxxxx
tab11.ixf对应的是xxxxxxxxx表
数据库会恢复正常,可再用db2 list tablespaces show detail查看

在做DB2MOVE其间,DB2_CERT容器莫名其妙的被删了,导致DB2_CERT起不来,没有备份,郁闷!!!
重建DB2_CERT及TABLES
又做了一遍DB2MOVE,成功! 
阅读(4433) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~