做DBA几年来,经常遇到项目到了维护期总是修改表的结构,原因很简单,就是随着数据量越来越大,对表的访问越来越慢。
故这次趁着割接,把这些表重新规划下。不过有个同事在进行划分分区表时,偏偏喜欢用状态字段做分区key,原因是每个月需要出报表,统计数据方便。
据我了解:
1)这个状态字段,根据业务变化,要经过从0到1,最终状态是3
2)而且从表的数据在这个状态字段上的分布了解到,最终状态3占到95%的数据
对partition key 进行update会报错,同时也会影响性能。这样的事情,费力不讨好,但是偏偏有人喜好。
I cannot reproduce, works as supposed for me...What version are you on ?
1 create table t (x number, y char(10))
2 partition by range (x) (
3 partition p1 values less than (100),
4 partition p2 values less than (maxvalue)
5* )
test@CENTRAL> /
Table created.
test@CENTRAL> select table_name, row_movement from user_tables where table_name='T';
TABLE_NAME ROW_MOVE
------------------------------ --------
T DISABLED
test@CENTRAL>
test@CENTRAL> insert into t values (10,'a');
1 row created.
test@CENTRAL> commit;
Commit complete.
test@CENTRAL> update t set x = 110 ;
update t set x = 110
*
ERROR at line 1:
ORA-14402: updating partition key column would cause a partition change
test@CENTRAL> alter table t enable row movement;
Table altered.
test@CENTRAL> update t set x = 110 ;
1 row updated.
test@CENTRAL> commit;
Commit complete.
test@CENTRAL> alter table t disable row movement;
Table altered.
test@CENTRAL> select table_name, row_movement from user_tables where table_name='T';
TABLE_NAME ROW_MOVE
------------------------------ --------
T DISABLED
test@CENTRAL> update t set x = 10;
update t set x = 10
*
ERROR at line 1:
ORA-14402: updating partition key column would cause a partition change
test@CENTRAL>
Stefan
On 5/2/06, hamid alavi <
[email protected]> wrote:
List,
I have partition table and I did alter table table_name enable rowmovement, then when I try to Disable row movement still when I update the partition key the record updated means the disable does not work & I can not disable row movement afte enableing it, any idea?