普通表转换为分区表(oracle9i)

 以下为在一个项目中写的解决代码(数据库为oracle9i,在执行下面的代码时,系统需要停掉):

-- =====其他信息mt表======
create table t_other_mt_new
    partition by list(send_request_status)
     (
         partition part_no         values    (0),
         partition part_send_suc   values    (1),
         partition part_send_fail  values    (2),
         partition part_sending    values    (3),
         partition part_rcv_fail   values    (4),
         partition part_rcv_succ   values    (5),
         partition part_expt_stop  values    (8)
     )
 as select *
     from t_other_mt;
drop  table t_other_mt;
alter table t_other_mt_new rename  to t_other_mt;
alter table t_other_mt enable row movement;
-- 给表添加约束
alter table t_other_mt
  add constraint pk_other_mt primary key (mt_pk);
-- 给该表添加索引
create index i_other_mt_push_pk
    on t_other_mt(push_pk desc)
    tablespace kts_index local
;
create bitmap index i_other_mt_sendrequeststatus
    on t_other_mt(send_request_status)
    tablespace kts_index local
;
create bitmap index i_other_mt_sync_status
    on t_other_mt(sync_status)
    tablespace kts_index local
;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值