查看: 10941|回复: 4

[精华] db2move import dbname 时这几个表导不进数据。有什么简单的方法能恢复数据吗?

[复制链接]
论坛徽章:
20
IT宝贝
日期:2010-04-13 14:05:252014年新春福章
日期:2014-02-18 16:42:02马上有房
日期:2014-02-18 16:42:02暖羊羊
日期:2015-03-04 14:50:372015年新春福章
日期:2015-03-06 11:57:31天枰座
日期:2016-03-28 08:29:37狮子座
日期:2016-06-14 15:43:52妮可·罗宾
日期:2016-08-02 14:22:10马自达
日期:2014-02-13 22:13:47奔驰
日期:2013-12-11 23:39:54
跳转到指定楼层
1#
发表于 2006-7-5 03:01 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
db2move import dbname 时这几个表导不进数据。有什么简单的方法能恢复数据吗?


"BH" INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (
            START WITH +1
            INCREMENT BY +1
            MINVALUE +1
            MAXVALUE +999999999
            CYCLE
            NO CACHE
            ORDER ),

都是有identity字段的表

同时我忘了做del格式的export ,并且已经把原始库drop了
招聘 : c/c++研发
论坛徽章:
45
技术图书徽章
日期:2014-03-10 14:09:192012新春纪念徽章
日期:2012-02-13 15:12:092012新春纪念徽章
日期:2012-02-13 15:12:092012新春纪念徽章
日期:2012-01-04 11:51:22ITPUB十周年纪念徽章
日期:2011-11-01 16:21:15现任管理团队成员
日期:2011-05-07 01:45:082011新春纪念徽章
日期:2011-01-25 15:42:562011新春纪念徽章
日期:2011-01-25 15:42:332011新春纪念徽章
日期:2011-01-25 15:42:152011新春纪念徽章
日期:2011-01-25 15:41:50
2#
发表于 2006-7-5 03:25 | 只看该作者
(panipuri)/home/taoewang->db2 "create table t5 (c1 integer, c2 integer not null generated always as identity (start with +1 increment by +1 minvalue +1 maxvalue +9999999 cycle no cache order))"
DB20000I  The SQL command completed successfully.
(panipuri)/home/taoewang->db2 "insert into t5 values (1)"
DB21034E  The command was processed as an SQL statement because it was not a
valid Command Line Processor command.  During SQL processing it returned:
SQL0117N  The number of values assigned is not the same as the number of
specified or implied columns.  SQLSTATE=42802
(panipuri)/home/taoewang->db2 "insert into t5 c1 values (1)"
DB21034E  The command was processed as an SQL statement because it was not a
valid Command Line Processor command.  During SQL processing it returned:
SQL0104N  An unexpected token "c1 values" was found following "insert into T5
".  Expected tokens may include:  "<values>".  SQLSTATE=42601
(panipuri)/home/taoewang->db2 "insert into t5 (c1) values (1)"
DB20000I  The SQL command completed successfully.
(panipuri)/home/taoewang->db2 "insert into t5 (c1) values (2)"
DB20000I  The SQL command completed successfully.
(panipuri)/home/taoewang->db2 "insert into t5 (c1) values (3)"
DB20000I  The SQL command completed successfully.
(panipuri)/home/taoewang->db2 "select * from t5"

C1          C2
----------- -----------
          1           1
          2           2
          3           3

  3 record(s) selected.

(panipuri)/home/taoewang->db2move sample export -tn TAOEWANG.T5

*****  DB2MOVE  *****

Action:      EXPORT

Start time:  Tue Jul  4 15:11:46 2006


All table names matching:  TAOEWANG.T5;

Connecting to database SAMPLE ... successful!  Server: DB2 Common Server V8.2.3

Binding package automatically ...
Bind file: /home/taoewang/sqllib/bnd/db2move.bnd

Bind was successful!


Disconnecting from database ... successful!

End time:  Tue Jul  4 15:11:48 2006

(panipuri)/home/taoewang->db2 drop table t5
DB20000I  The SQL command completed successfully.
(panipuri)/home/taoewang->db2 "create table t5 (c1 integer, c2 integer not null generated always as identity (start with +1 increment by +1 minvalue +1 maxvalue +9999999 cycle no cache order))"
DB20000I  The SQL command completed successfully.
(panipuri)/home/taoewang->db2 "import from tab1.ixf of ixf method P(1) replace into t5 (c1)"
SQL3150N  The H record in the PC/IXF file has product "DB2    02.00", date
"20060704", and time "151354".

SQL3153N  The T record in the PC/IXF file has name "tab1.ixf", qualifier "",
and source "            ".

SQL3109N  The utility is beginning to load data from file "tab1.ixf".

SQL3110N  The utility has completed processing.  "3" rows were read from the
input file.

SQL3221W  ...Begin COMMIT WORK. Input Record Count = "3".

SQL3222W  ...COMMIT of any database changes was successful.

SQL3149N  "3" rows were processed from the input file.  "3" rows were
successfully inserted into the table.  "0" rows were rejected.


Number of rows read         = 3
Number of rows skipped      = 0
Number of rows inserted     = 3
Number of rows updated      = 0
Number of rows rejected     = 0
Number of rows committed    = 3

(panipuri)/home/taoewang->db2 "select * from t5"

C1          C2
----------- -----------
          1           1
          2           2
          3           3

  3 record(s) selected.

(panipuri)/home/taoewang->

使用道具 举报

回复
论坛徽章:
71
马上加薪
日期:2014-02-19 11:55:14ITPUB十周年纪念徽章
日期:2011-11-01 16:19:412010广州亚运会纪念徽章:橄榄球
日期:2011-05-22 10:54:33管理团队成员
日期:2011-05-07 01:45:082011新春纪念徽章
日期:2011-01-25 15:42:562011新春纪念徽章
日期:2011-01-25 15:42:332011新春纪念徽章
日期:2011-01-25 15:42:152011新春纪念徽章
日期:2011-01-25 15:41:502011新春纪念徽章
日期:2011-01-25 15:41:012010年世界杯参赛球队:丹麦
日期:2010-04-06 10:23:36
3#
发表于 2006-7-5 07:24 | 只看该作者
“select tabschema, tabname, status, const_checked from syscat.tables where status='C'”查看所有表的状态是否为pengding状态,如果有状态为pengding的表,则通过“set integrity for TABSCHEMA.TABNAME immediate checked”命令解决pengding问题。

使用道具 举报

回复
论坛徽章:
1
授权会员
日期:2006-06-22 16:16:05
4#
发表于 2006-7-5 09:14 | 只看该作者
IDENTITY字段重新导入的时候会变掉,如果有外键约束的话, 估计很难导入

使用道具 举报

回复
论坛徽章:
1
会员2007贡献徽章
日期:2007-09-26 18:42:10
5#
发表于 2006-7-5 10:04 | 只看该作者
generated by default的字段可以import默认或者db2move进去。不过在后续的insert动作可能会报错803。指定参数人工import是最好的办法。使用IDENTITYMISSING, IDENTITYIGNORE参数。

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表