Db2: db2look导出的表定义无法用于创建表-SQL1860N Reason code = “5“

问题描述:


使用db2look导出表定义,然后再使用该定义创建表报错 SQL1860N RC=5,导出的表定义如下:

db2 "CREATE TABLE mqs20201208 (
                  STORETIME DATE NOT NULL , 
                  IMAGEOBJECT BLOB(10485760) LOGGED NOT COMPACT NOT NULL , 
                  UUID VARCHAR(36) )   
                 PARTITION BY RANGE(STORETIME) 
                 (PART PART20140101 STARTING('2014-01-01') ENDING('2014-01-01') IN TSP_MIBSSE LONG IN TSP_BLOB,  
                 PART PART201704 STARTING('2017-04-13') ENDING('2017-04-30') IN TSP_MIBSSE LONG IN TSP_BLOB, 
                 PART PART202011 STARTING('2020-01-01') ENDING('2020-12-31') IN TSP_BLOB LONG IN TSP_BLOB) 
                 "


问题重现:


如果直接上面的表定义创建表,会报错 SQL1860N  Table space "TSP_BLOB" is not compatible with table space "TSP_BLOB". Reason code = "5".  SQLSTATE=42838


如果先创建表,只包含前两个分区:                 
db2 "CREATE TABLE  mqs20201208  (
                  STORETIME DATE NOT NULL , 
                  IMAGEOBJECT BLOB(10485760) LOGGED NOT COMPACT NOT NULL , 
                  UUID VARCHAR(36) )   
                 PARTITION BY RANGE(STORETIME) 
                 (PART PART20140101 STARTING('2014-01-01') ENDING('2014-01-01') IN TSP_MIBSSE LONG IN TSP_BLOB,  
                 PART PART201704 STARTING('2017-04-13') ENDING('2017-04-30') IN TSP_MIBSSE LONG IN TSP_BLOB)
                 "

然后再使用alter table语句增加一个分区,则是可行的
db2 "alter table mqs20201208 add partition  PART202011 STARTING('2020-01-01') ENDING('2020-12-31') IN TSP_BLOB LONG IN TSP_BLOB"


解决方案:


应该是DB2产品的缺陷,建议修改表的DDL之后重新执行

已标记关键词 清除标记
相关推荐
<p> <b><span style="background-color:#FFE500;">【超实用课程内容】</span></b> </p> <p> <br /> </p> <p> <br /> </p> <p> 本课程内容包含讲解<span>解读Nginx的基础知识,</span><span>解读Nginx的核心知识、带领学员进行</span>高并发环境下的Nginx性能优化实战,让学生能够快速将所学融合到企业应用中。 </p> <p> <br /> </p> <p style="font-family:Helvetica;color:#3A4151;font-size:14px;background-color:#FFFFFF;"> <b><br /> </b> </p> <p style="font-family:Helvetica;color:#3A4151;font-size:14px;background-color:#FFFFFF;"> <b><span style="background-color:#FFE500;">【课程如何观看?】</span></b> </p> <p style="font-family:Helvetica;color:#3A4151;font-size:14px;background-color:#FFFFFF;"> PC端:<a href="https://edu.csdn.net/course/detail/26277"><span id="__kindeditor_bookmark_start_21__"></span></a><a href="https://edu.csdn.net/course/detail/27216">https://edu.csdn.net/course/detail/27216</a> </p> <p style="font-family:Helvetica;color:#3A4151;font-size:14px;background-color:#FFFFFF;"> 移动端:CSDN 学院APP(注意不是CSDN APP哦) </p> <p style="font-family:Helvetica;color:#3A4151;font-size:14px;background-color:#FFFFFF;"> 本课程为录播课,课程永久有效观看时长,大家可以抓紧时间学习后一起讨论哦~ </p> <p style="font-family:"color:#3A4151;font-size:14px;background-color:#FFFFFF;"> <br /> </p> <p class="ql-long-24357476" style="font-family:"color:#3A4151;font-size:14px;background-color:#FFFFFF;"> <strong><span style="background-color:#FFE500;">【学员专享增值服务】</span></strong> </p> <p class="ql-long-24357476" style="font-family:"color:#3A4151;font-size:14px;background-color:#FFFFFF;"> <b>源码开放</b> </p> <p class="ql-long-24357476" style="font-family:"color:#3A4151;font-size:14px;background-color:#FFFFFF;"> 课件、课程案例代码完全开放给你,你可以根据所学知识,自行修改、优化 </p> <p class="ql-long-24357476" style="font-family:"color:#3A4151;font-size:14px;background-color:#FFFFFF;"> 下载方式:电脑登录<a href="https://edu.csdn.net/course/detail/26277"></a><a href="https://edu.csdn.net/course/detail/27216">https://edu.csdn.net/course/detail/27216</a>,播放页面右侧点击课件进行资料打包下载 </p> <p> <br /> </p> <p> <br /> </p> <p> <br /> </p>
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页