码迷,mamicode.com
首页 > 数据库 > 详细

[转]DB2中需要REORG操作的几种情况

时间:2017-09-25 09:42:04      阅读:265      评论:0      收藏:0      [点我收藏+]

标签:immediate   iat   reload   and   nbsp   trunc   one   数据   been   

问题: 在DB2数据库中,修改完表的结构时,是否需要对表做一个reorg操作才能使表的状态恢复正常?

答:有以下4种操作,需要对表做reorg操作

1. SET DATA TYPE altered-data-type 

    但有以下两种情况是例外,不需要reorg:
          1). Increasing the length of a VARCHAR or VARGRAPHIC column
          2). Decreasing the length of a VARCHAR or VARGRAPHIC column without truncating trailing blanks from existing data
2. SET NOT NULL
3. DROP NOT NULL
4. DROP COLUMN
其他的操作,理论上都不需要REORG,但有些操作,是需要REORG之后才能实际生效的,比如"ALTER TABLE ... COMPRESS YES",语法上不需要REORG操作,也不会影响表的增删改查操作,但只有REORG之后,才能真正开启压缩:
After a table has been altered to enable row compression, all rows in the table can be compressed immediately by performing one of the following actions:
        1. REORG command
        2. Online table move
        3. Data unload and reload

[转]DB2中需要REORG操作的几种情况

标签:immediate   iat   reload   and   nbsp   trunc   one   数据   been   

原文地址:http://www.cnblogs.com/atai/p/7590329.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!