Chinaunix首页 | 论坛 | 博客
  • 博客访问: 5175684
  • 博文数量: 1004
  • 博客积分: 8199
  • 博客等级: 中将
  • 技术积分: 13042
  • 用 户 组: 普通用户
  • 注册时间: 2010-05-25 20:19
个人简介

脚踏实地、勇往直前!

文章分类

全部博文(1004)

文章存档

2020年(1)

2019年(93)

2018年(208)

2017年(81)

2016年(49)

2015年(50)

2014年(170)

2013年(52)

2012年(177)

2011年(93)

2010年(30)

分类: Oracle

2011-10-21 10:23:36

1.普通表(未分区)
  1. SQL> Alter Table tb_hxl_id Compress;

  2. Table altered.

  3. SQL> Alter Table tb_hxl_id Move Compress;

  4. Table altered.

  5. SQL> Alter Table tb_hxl_id Add c Varchar2(2);

  6. Table altered.

  7. SQL> Alter Table tb_hxl_id Drop Column c;
  8. Alter Table tb_hxl_id Drop Column c
  9.                                   *
  10. ERROR at line 1:
  11. ORA-39726: unsupported add/drop column operation on compressed tables


  12. SQL> Alter Table tb_hxl_id Move Nocompress; -- 需要进行解压缩后才能删除字段


  13. Table altered.

  14. SQL> Alter Table tb_hxl_id Drop Column c;

  15. Table altered.

 

2.分区表

 

  1. SQL> Select aa.table_name,aa.partitioning_type
  2.   2 From dba_part_tables aa
  3.   3 Where aa.table_name = 'TB_HXL_LIST';

  4. TABLE_NAME PARTITION
  5. ------------------------------ ---------

  6. TB_HXL_LIST LIST

  7. SQL> Select
  8.   2 aa.compression,
  9.   3 aa.partition_name
  10.   4 From dba_tab_partitions aa
  11.   5 Where aa.table_name = 'TB_HXL_LIST';

  12. COMPRESS PARTITION_NAME
  13. -------- ------------------------------

  14. ENABLED P_L1
  15. ENABLED P_L2
  16. ENABLED P_L3
  17. ENABLED P_L4

  18. SQL> Alter Table tb_hxl_list compress;

  19. Table altered.

  20. SQL> Alter Table TB_HXL_LIST
  21.   2 Move Partition P_L1 compress;

  22. Table altered.

  23. SQL> Alter Table TB_HXL_LIST Add b Varchar2(2);

  24. Table altered.

  25. SQL> Alter Table TB_HXL_LIST Drop Column b;
  26. Alter Table TB_HXL_LIST Drop Column b
  27.                                     *
  28. ERROR at line 1:
  29. ORA-39726: unsupported add/drop column operation on compressed tables


  30. SQL> Alter Table TB_HXL_LIST
  31.   2 Move Partition P_L1 Nocompress;

  32. Table altered.

  33. SQL> Alter Table TB_HXL_LIST Drop Column b;
  34. Alter Table TB_HXL_LIST Drop Column b
  35.                                     *
  36. ERROR at line 1:
  37. ORA-39726: unsupported add/drop column operation on compressed tables

  38. SQL> alter table TB_HXL_LIST set unused column b; -- 压缩的分区表不能删除字段,只能设置unused


  39. Table altered.

ORA-39726: unsupported add/drop column operation on compressed tables
Cause: An unsupported add/drop column operation for compressed table was attemped.
 Action: When adding a column, do not specify a default value. DROP column is only supported in the form of SET UNUSED column (meta-data drop column).
 

 

阅读(5592) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~