日期:2014-05-16  浏览次数:20444 次

oracle创建表分区(001)
[color=red]create table par_tab(data_date varchar2(8),col_n varchar2(20))partition by range(data_date)(partition part_201000 values less[/color] than ('201001') tablespace tab_201000,partition part_201001 values less than ('201002') tablespace tab_201003,partition part_201002 values less than ('201003') tablespace tab_201003,partition part_201003 values less than ('201004') tablespace tab_201003,partition part_201004 values less than ('201005') tablespace tab_201006,partition part_201005 values less than ('201006') tablespace tab_201006,partition part_201006 values less than ('201007') tablespace tab_201006,partition part_201007 values less than ('201008') tablespace tab_201009,partition part_201008 values less than ('201009') tablespace tab_201009,partition part_201009 values less than ('201010') tablespace tab_201009,partition part_201010 values less than ('201011') tablespace tab_201012,partition part_201011 values less than ('201012') tablespace tab_201012,partition part_201012 values less than ('201013') tablespace tab_201012,partition part_201099 values less than ('201099') tablespace tab_201099,partition part_201100 values less than ('201001') tablespace tab_201000,partition part_201101 values less than ('201002') tablespace tab_201003,partition part_201102 values less than ('201003') tablespace tab_201003,partition part_201103 values less than ('201004') tablespace tab_201003,partition part_201104 values less than ('201005') tablespace tab_201006,partition part_201105 values less than ('201006') tablespace tab_201006,partition part_201106 values less than ('201007') tablespace tab_201006,partition part_201107 values less than ('201008') tablespace tab_201009,partition part_201108 values less than ('201009') tablespace tab_201009,partition part_201109 values less than ('201010') tablespace tab_201009,partition part_201110 values less than ('201011') tablespace tab_201012,partition part_201111 values less than ('201012') tablespace tab_201012,partition part_201112 values less than ('201013') tablespace tab_201012,partition part_201199 values less than ('201099') tablespace tab_201099);--- [b][color=red]201101 的时候就这样迁移数据mkfifo 3.dmpexp user/pasword rows=y indexes=n TRIGGERS=n DIRECT=y file=3.dmp GRANTS=n log=log/exp_3.log buffer=4096000 tables=par_tab:part_201001  &imp user/pasword fromuser=user touser=user file=3.dmp ignore=y COMMIT=y buffer=4096000 log=log/imp_3.logrm 3.dmp--- 201102 的时候就这样迁移数据mkfifo 3.dmpexp user/pasword rows=y indexes=n TRIGGERS=n DIRECT=y file=3.dmp GRANTS=n log=log/exp_3.log buffer=4096000 tables=par_tab:part_201002  &imp user/pasword fromuser=user touser=user file=3.dmp ignore=y COMMIT=y buffer=4096000 log=log/imp_3.logrm 3.dmp依次类推, 迁移完 drop 分区[/color][/b]