author:skatetime:2009/05/12 最近公司有一个优化项目,为了提高系统的整体性能,我对数据库从表的底层开始优化,首先是表的存储参数的优化下面是在优化期间,把普通......
author:skate time :2009/05/12
最近公司有一个优化项目,为了提高系统的整体性能,我对数据库从表的底层开始优化,首先是表的存储参数的优化 下面是在优化期间,把普通表转换为分区表
操作过程:
创建中间表:
create table d_batch_detail_his storage(initial 10m next 10m ) partition by range(ware_id) (partition d_batch_detail_31100 values less than (31100) tablespace yytickets, partition d_batch_detail_31600 values less than (31600) tablespace yytickets, partition d_batch_detail_32100 values less than (32100) tablespace yytickets, partition d_batch_detail_32600 values less than (32600) tablespace yytickets, partition d_batch_detail_33100 values less than (33100) tablespace yytickets, partition d_batch_detail_33600 values less than (33600) tablespace yytickets, partition d_batch_detail_34100 values less than (34100) tablespace yytickets, partition d_batch_detail_34600 values less than (34600) tablespace yytickets, partition d_batch_detail_35100 values less than (35100) tablespace yytickets, partition d_batch_detail_35600 values less than (35600) tablespace yytickets, partition d_batch_detail_36100 values less than (36100) tablespace yytickets, partition d_batch_detail_36600 values less than (36600) tablespace yytickets, partition d_batch_detail_37100 values less than (37100) tablespace yytickets ) as select * FROM d_batch_detail where 1=''
把普通表改变为分区表
SQL> exec dbms_redefinition.abort_redef_table('tickets','d_batch_detail','d_batch_detail_rep'); PL/SQL procedure successfully completed SQL> exec dbms_redefinition.can_redef_table('tickets','d_batch_detail'); PL/SQL procedure successfully completed SQL> exec dbms_redefinition.start_redef_table('tickets','d_batch_detail','d_batch_detail_rep'); PL/SQL procedure successfully completed SQL> exec dbms_redefinition.sync_interim_table('tickets','d_batch_detail','d_batch_detail_rep'); PL/SQL procedure successfully completed
创建索引,约束,触发器等
create index IDXa_BATCH_DETAIL_ORDERDETAILI on d_batch_detail_rep(ORDER_DETAIL_ID)
1/6 1 2 3 4 5 6 下一页 尾页 |