需要按照某个Column设定分区,它的格式类似这样:
ZYZC***
ZTBE***
……
即前四位可使得数据归入某个大类中,所以试图提取前四位做为分区键的规则,请问该如何建立分区表?谢谢!

解决方案 »

  1.   

    1、可以考虑使用hash(散列)分区 partition by hash(column)
    2、可以在表中新增一列如p_column,通过函数取前四位并存入新列中,然后可相应建立rang,list类型分区
      

  2.   

    谢谢47522341和tangren数据是从别的源ETL过来的,目前不太想去修改ETL规则并增加一个新的column。如果用hash分区的,大概该怎么建(SQL怎么写)?谢谢!
      

  3.   

    --例子,参考一下
    SQL> Create Table t(owner, object_name, subobject_name, object_id, data_object_id, object_type, created,
      2                 last_ddl_time, timestamp, status, temporary, generated, secondary)
      3    Partition By Hash(object_id)
      4    (Partition p_1 Tablespace users,
      5     Partition p_2 Tablespace users,
      6     Partition p_3 Tablespace users,
      7     Partition p_4 Tablespace users,
      8     Partition p_5 Tablespace users,
      9     Partition p_6 Tablespace users,
     10     Partition p_7 Tablespace users,
     11     Partition p_8 Tablespace users
     12     )