Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1142425
  • 博文数量: 231
  • 博客积分: 2500
  • 博客等级: 少校
  • 技术积分: 2662
  • 用 户 组: 普通用户
  • 注册时间: 2009-11-03 16:35
个人简介

学无止境

文章分类

全部博文(231)

文章存档

2014年(7)

2013年(103)

2011年(11)

2010年(53)

2009年(57)

分类: Oracle

2010-05-27 11:35:24

分区表脚本
CREATE TABLE ldy.sales
(
invoice_no NUMBER,
sale_year INT NOT NULL,
sale_month INT NOT NULL,
sale_day INT NOT NULL
)
PARTITION BY RANGE (sale_year, sale_month, sale_day)
(
PARTITION sales_q1 VALUES LESS THAN (1990,1,1) TABLESPACE ldy,       
PARTITION sales_q2 VALUES LESS THAN (1990,2,1) TABLESPACE ldy,       
PARTITION sales_q3 VALUES LESS THAN (1990,3,1) TABLESPACE ldy,       
PARTITION sales_q4 VALUES LESS THAN (1990,4,1) TABLESPACE ldy,       
PARTITION sales_q5 VALUES LESS THAN (1990,5,1) TABLESPACE ldy,       
PARTITION sales_q6 VALUES LESS THAN (1990,6,1) TABLESPACE ldy,       
PARTITION sales_q7 VALUES LESS THAN (1990,7,1) TABLESPACE ldy,       
PARTITION sales_q8 VALUES LESS THAN (1990,8,1) TABLESPACE ldy,       
PARTITION sales_q9 VALUES LESS THAN (1990,9,1) TABLESPACE ldy,       
PARTITION sales_q10 VALUES LESS THAN (1990,10,1) TABLESPACE ldy,     
PARTITION sales_q11 VALUES LESS THAN (1990,11,1) TABLESPACE ldy,     
PARTITION sales_q12 VALUES LESS THAN (1990,12,1) TABLESPACE ldy,     
PARTITION sales_q13 VALUES LESS THAN (1991,1,1) TABLESPACE ldy,      
PARTITION sales_q14 VALUES LESS THAN (1991,2,1) TABLESPACE ldy,      
PARTITION sales_q15 VALUES LESS THAN (1991,3,1) TABLESPACE ldy,      
PARTITION sales_q16 VALUES LESS THAN (1991,4,1) TABLESPACE ldy,      
PARTITION sales_q17 VALUES LESS THAN (1991,5,1) TABLESPACE ldy,      
PARTITION sales_q18 VALUES LESS THAN (1991,6,1) TABLESPACE ldy,      
PARTITION sales_q19 VALUES LESS THAN (1991,7,1) TABLESPACE ldy,      
PARTITION sales_q20 VALUES LESS THAN (1991,8,1) TABLESPACE ldy,      
PARTITION sales_q21 VALUES LESS THAN (1991,9,1) TABLESPACE ldy,      
PARTITION sales_q22 VALUES LESS THAN (1991,10,1) TABLESPACE ldy,     
PARTITION sales_q23 VALUES LESS THAN (1991,11,1) TABLESPACE ldy,     
PARTITION sales_q24 VALUES LESS THAN (1991,12,1) TABLESPACE ldy,     
PARTITION sales_q25 VALUES LESS THAN (1992,1,1) TABLESPACE ldy,      
PARTITION sales_q26 VALUES LESS THAN (1992,2,1) TABLESPACE ldy,      
PARTITION sales_q27 VALUES LESS THAN (1992,3,1) TABLESPACE ldy,      
PARTITION sales_q28 VALUES LESS THAN (1992,4,1) TABLESPACE ldy,      
PARTITION sales_q29 VALUES LESS THAN (1992,5,1) TABLESPACE ldy,      
PARTITION sales_q30 VALUES LESS THAN (1992,6,1) TABLESPACE ldy,      
PARTITION sales_q31 VALUES LESS THAN (1992,7,1) TABLESPACE ldy,      
PARTITION sales_q32 VALUES LESS THAN (1992,8,1) TABLESPACE ldy,      
PARTITION sales_q33 VALUES LESS THAN (1992,9,1) TABLESPACE ldy,      
PARTITION sales_q34 VALUES LESS THAN (1992,10,1) TABLESPACE ldy,     
PARTITION sales_q35 VALUES LESS THAN (1992,11,1) TABLESPACE ldy,     
PARTITION sales_q36 VALUES LESS THAN (1992,12,1) TABLESPACE ldy,     
PARTITION sales_q37 VALUES LESS THAN (1993,1,1) TABLESPACE ldy,      
PARTITION sales_q38 VALUES LESS THAN (1993,2,1) TABLESPACE ldy,      
PARTITION sales_q39 VALUES LESS THAN (1993,3,1) TABLESPACE ldy,      
PARTITION sales_q40 VALUES LESS THAN (1993,4,1) TABLESPACE ldy,      
PARTITION sales_q41 VALUES LESS THAN (1993,5,1) TABLESPACE ldy,      
PARTITION sales_q42 VALUES LESS THAN (1993,6,1) TABLESPACE ldy,      
PARTITION sales_q43 VALUES LESS THAN (1993,7,1) TABLESPACE ldy,      
PARTITION sales_q44 VALUES LESS THAN (1993,8,1) TABLESPACE ldy,      
PARTITION sales_q45 VALUES LESS THAN (1993,9,1) TABLESPACE ldy,      
PARTITION sales_q46 VALUES LESS THAN (1993,10,1) TABLESPACE ldy,     
PARTITION sales_q47 VALUES LESS THAN (1993,11,1) TABLESPACE ldy,     
PARTITION sales_q48 VALUES LESS THAN (1993,12,1) TABLESPACE ldy,     
PARTITION sales_q49 VALUES LESS THAN (1994,1,1) TABLESPACE ldy,      
PARTITION sales_q50 VALUES LESS THAN (1994,2,1) TABLESPACE ldy,      
PARTITION sales_q51 VALUES LESS THAN (1994,3,1) TABLESPACE ldy,      
PARTITION sales_q52 VALUES LESS THAN (1994,4,1) TABLESPACE ldy,      
PARTITION sales_q53 VALUES LESS THAN (1994,5,1) TABLESPACE ldy,      
PARTITION sales_q54 VALUES LESS THAN (1994,6,1) TABLESPACE ldy,      
PARTITION sales_q55 VALUES LESS THAN (1994,7,1) TABLESPACE ldy,      
PARTITION sales_q56 VALUES LESS THAN (1994,8,1) TABLESPACE ldy,      
PARTITION sales_q57 VALUES LESS THAN (1994,9,1) TABLESPACE ldy,      
PARTITION sales_q58 VALUES LESS THAN (1994,10,1) TABLESPACE ldy,     
PARTITION sales_q59 VALUES LESS THAN (1994,11,1) TABLESPACE ldy,     
PARTITION sales_q60 VALUES LESS THAN (1994,12,1) TABLESPACE ldy,     
PARTITION sales_q61 VALUES LESS THAN (1995,1,1) TABLESPACE ldy,      
PARTITION sales_q62 VALUES LESS THAN (1995,2,1) TABLESPACE ldy,      
PARTITION sales_q63 VALUES LESS THAN (1995,3,1) TABLESPACE ldy,      
PARTITION sales_q64 VALUES LESS THAN (1995,4,1) TABLESPACE ldy,      
PARTITION sales_q65 VALUES LESS THAN (1995,5,1) TABLESPACE ldy,      
PARTITION sales_q66 VALUES LESS THAN (1995,6,1) TABLESPACE ldy,      
PARTITION sales_q67 VALUES LESS THAN (1995,7,1) TABLESPACE ldy,      
PARTITION sales_q68 VALUES LESS THAN (1995,8,1) TABLESPACE ldy,      
PARTITION sales_q69 VALUES LESS THAN (1995,9,1) TABLESPACE ldy,      
PARTITION sales_q70 VALUES LESS THAN (1995,10,1) TABLESPACE ldy,     
PARTITION sales_q71 VALUES LESS THAN (1995,11,1) TABLESPACE ldy,     
PARTITION sales_q72 VALUES LESS THAN (1995,12,1) TABLESPACE ldy,     
PARTITION sales_q73 VALUES LESS THAN (1996,1,1) TABLESPACE ldy,      
PARTITION sales_q74 VALUES LESS THAN (1996,2,1) TABLESPACE ldy,      
PARTITION sales_q75 VALUES LESS THAN (1996,3,1) TABLESPACE ldy,      
PARTITION sales_q76 VALUES LESS THAN (1996,4,1) TABLESPACE ldy,      
PARTITION sales_q77 VALUES LESS THAN (1996,5,1) TABLESPACE ldy,      
PARTITION sales_q78 VALUES LESS THAN (1996,6,1) TABLESPACE ldy,      
PARTITION sales_q79 VALUES LESS THAN (1996,7,1) TABLESPACE ldy,      
PARTITION sales_q80 VALUES LESS THAN (1996,8,1) TABLESPACE ldy,      
PARTITION sales_q81 VALUES LESS THAN (1996,9,1) TABLESPACE ldy,      
PARTITION sales_q82 VALUES LESS THAN (1996,10,1) TABLESPACE ldy,     
PARTITION sales_q83 VALUES LESS THAN (1996,11,1) TABLESPACE ldy,     
PARTITION sales_q84 VALUES LESS THAN (1996,12,1) TABLESPACE ldy,     
PARTITION sales_q85 VALUES LESS THAN (1997,1,1) TABLESPACE ldy,      
PARTITION sales_q86 VALUES LESS THAN (1997,2,1) TABLESPACE ldy,      
PARTITION sales_q87 VALUES LESS THAN (1997,3,1) TABLESPACE ldy,      
PARTITION sales_q88 VALUES LESS THAN (1997,4,1) TABLESPACE ldy,      
PARTITION sales_q89 VALUES LESS THAN (1997,5,1) TABLESPACE ldy,      
PARTITION sales_q90 VALUES LESS THAN (1997,6,1) TABLESPACE ldy,      
PARTITION sales_q91 VALUES LESS THAN (1997,7,1) TABLESPACE ldy,      
PARTITION sales_q92 VALUES LESS THAN (1997,8,1) TABLESPACE ldy,      
PARTITION sales_q93 VALUES LESS THAN (1997,9,1) TABLESPACE ldy,      
PARTITION sales_q94 VALUES LESS THAN (1997,10,1) TABLESPACE ldy,     
PARTITION sales_q95 VALUES LESS THAN (1997,11,1) TABLESPACE ldy,     
PARTITION sales_q96 VALUES LESS THAN (1997,12,1) TABLESPACE ldy,     
PARTITION sales_q97 VALUES LESS THAN (1998,1,1) TABLESPACE ldy,      
PARTITION sales_q98 VALUES LESS THAN (1998,2,1) TABLESPACE ldy,      
PARTITION sales_q99 VALUES LESS THAN (1998,3,1) TABLESPACE ldy,      
PARTITION sales_q100 VALUES LESS THAN (1998,4,1) TABLESPACE ldy,     
PARTITION sales_q101 VALUES LESS THAN (1998,5,1) TABLESPACE ldy,     
PARTITION sales_q102 VALUES LESS THAN (1998,6,1) TABLESPACE ldy,     
PARTITION sales_q103 VALUES LESS THAN (1998,7,1) TABLESPACE ldy,     
PARTITION sales_q104 VALUES LESS THAN (1998,8,1) TABLESPACE ldy,     
PARTITION sales_q105 VALUES LESS THAN (1998,9,1) TABLESPACE ldy,     
PARTITION sales_q106 VALUES LESS THAN (1998,10,1) TABLESPACE ldy,    
PARTITION sales_q107 VALUES LESS THAN (1998,11,1) TABLESPACE ldy,    
PARTITION sales_q108 VALUES LESS THAN (1998,12,1) TABLESPACE ldy,    
PARTITION sales_q109 VALUES LESS THAN (1999,1,1) TABLESPACE ldy,     
PARTITION sales_q110 VALUES LESS THAN (1999,2,1) TABLESPACE ldy,     
PARTITION sales_q111 VALUES LESS THAN (1999,3,1) TABLESPACE ldy,     
PARTITION sales_q112 VALUES LESS THAN (1999,4,1) TABLESPACE ldy,     
PARTITION sales_q113 VALUES LESS THAN (1999,5,1) TABLESPACE ldy,     
PARTITION sales_q114 VALUES LESS THAN (1999,6,1) TABLESPACE ldy,     
PARTITION sales_q115 VALUES LESS THAN (1999,7,1) TABLESPACE ldy,     
PARTITION sales_q116 VALUES LESS THAN (1999,8,1) TABLESPACE ldy,     
PARTITION sales_q117 VALUES LESS THAN (1999,9,1) TABLESPACE ldy,     
PARTITION sales_q118 VALUES LESS THAN (1999,10,1) TABLESPACE ldy,    
PARTITION sales_q119 VALUES LESS THAN (1999,11,1) TABLESPACE ldy,    
PARTITION sales_q120 VALUES LESS THAN (1999,12,1) TABLESPACE ldy,    
PARTITION sales_q121 VALUES LESS THAN (2000,1,1) TABLESPACE ldy,     
PARTITION sales_q122 VALUES LESS THAN (2000,2,1) TABLESPACE ldy,     
PARTITION sales_q123 VALUES LESS THAN (2000,3,1) TABLESPACE ldy,     
PARTITION sales_q124 VALUES LESS THAN (2000,4,1) TABLESPACE ldy,     
PARTITION sales_q125 VALUES LESS THAN (2000,5,1) TABLESPACE ldy,     
PARTITION sales_q126 VALUES LESS THAN (2000,6,1) TABLESPACE ldy,     
PARTITION sales_q127 VALUES LESS THAN (2000,7,1) TABLESPACE ldy,     
PARTITION sales_q128 VALUES LESS THAN (2000,8,1) TABLESPACE ldy,     
PARTITION sales_q129 VALUES LESS THAN (2000,9,1) TABLESPACE ldy,     
PARTITION sales_q130 VALUES LESS THAN (2000,10,1) TABLESPACE ldy,    
PARTITION sales_q131 VALUES LESS THAN (2000,11,1) TABLESPACE ldy,    
PARTITION sales_q132 VALUES LESS THAN (2000,12,1) TABLESPACE ldy,    
PARTITION sales_q133 VALUES LESS THAN (2001,1,1) TABLESPACE ldy,     
PARTITION sales_q134 VALUES LESS THAN (2001,2,1) TABLESPACE ldy,     
PARTITION sales_q135 VALUES LESS THAN (2001,3,1) TABLESPACE ldy,     
PARTITION sales_q136 VALUES LESS THAN (2001,4,1) TABLESPACE ldy,     
PARTITION sales_q137 VALUES LESS THAN (2001,5,1) TABLESPACE ldy,     
PARTITION sales_q138 VALUES LESS THAN (2001,6,1) TABLESPACE ldy,     
PARTITION sales_q139 VALUES LESS THAN (2001,7,1) TABLESPACE ldy,     
PARTITION sales_q140 VALUES LESS THAN (2001,8,1) TABLESPACE ldy,     
PARTITION sales_q141 VALUES LESS THAN (2001,9,1) TABLESPACE ldy,     
PARTITION sales_q142 VALUES LESS THAN (2001,10,1) TABLESPACE ldy,    
PARTITION sales_q143 VALUES LESS THAN (2001,11,1) TABLESPACE ldy,    
PARTITION sales_q144 VALUES LESS THAN (2001,12,1) TABLESPACE ldy,    
PARTITION sales_q145 VALUES LESS THAN (2002,1,1) TABLESPACE ldy,     
PARTITION sales_q146 VALUES LESS THAN (2002,2,1) TABLESPACE ldy,     
PARTITION sales_q147 VALUES LESS THAN (2002,3,1) TABLESPACE ldy,     
PARTITION sales_q148 VALUES LESS THAN (2002,4,1) TABLESPACE ldy,     
PARTITION sales_q149 VALUES LESS THAN (2002,5,1) TABLESPACE ldy,     
PARTITION sales_q150 VALUES LESS THAN (2002,6,1) TABLESPACE ldy,     
PARTITION sales_q151 VALUES LESS THAN (2002,7,1) TABLESPACE ldy,     
PARTITION sales_q152 VALUES LESS THAN (2002,8,1) TABLESPACE ldy,     
PARTITION sales_q153 VALUES LESS THAN (2002,9,1) TABLESPACE ldy,     
PARTITION sales_q154 VALUES LESS THAN (2002,10,1) TABLESPACE ldy,    
PARTITION sales_q155 VALUES LESS THAN (2002,11,1) TABLESPACE ldy,    
PARTITION sales_q156 VALUES LESS THAN (2002,12,1) TABLESPACE ldy,    
PARTITION sales_q157 VALUES LESS THAN (2003,1,1) TABLESPACE ldy,     
PARTITION sales_q158 VALUES LESS THAN (2003,2,1) TABLESPACE ldy,     
PARTITION sales_q159 VALUES LESS THAN (2003,3,1) TABLESPACE ldy,     
PARTITION sales_q160 VALUES LESS THAN (2003,4,1) TABLESPACE ldy,     
PARTITION sales_q161 VALUES LESS THAN (2003,5,1) TABLESPACE ldy,     
PARTITION sales_q162 VALUES LESS THAN (2003,6,1) TABLESPACE ldy,     
PARTITION sales_q163 VALUES LESS THAN (2003,7,1) TABLESPACE ldy,     
PARTITION sales_q164 VALUES LESS THAN (2003,8,1) TABLESPACE ldy,     
PARTITION sales_q165 VALUES LESS THAN (2003,9,1) TABLESPACE ldy,     
PARTITION sales_q166 VALUES LESS THAN (2003,10,1) TABLESPACE ldy,    
PARTITION sales_q167 VALUES LESS THAN (2003,11,1) TABLESPACE ldy,    
PARTITION sales_q168 VALUES LESS THAN (2003,12,1) TABLESPACE ldy,    
PARTITION sales_q169 VALUES LESS THAN (2004,1,1) TABLESPACE ldy,     
PARTITION sales_q170 VALUES LESS THAN (2004,2,1) TABLESPACE ldy,     
PARTITION sales_q171 VALUES LESS THAN (2004,3,1) TABLESPACE ldy,     
PARTITION sales_q172 VALUES LESS THAN (2004,4,1) TABLESPACE ldy,     
PARTITION sales_q173 VALUES LESS THAN (2004,5,1) TABLESPACE ldy,     
PARTITION sales_q174 VALUES LESS THAN (2004,6,1) TABLESPACE ldy,     
PARTITION sales_q175 VALUES LESS THAN (2004,7,1) TABLESPACE ldy,     
PARTITION sales_q176 VALUES LESS THAN (2004,8,1) TABLESPACE ldy,     
PARTITION sales_q177 VALUES LESS THAN (2004,9,1) TABLESPACE ldy,     
PARTITION sales_q178 VALUES LESS THAN (2004,10,1) TABLESPACE ldy,    
PARTITION sales_q179 VALUES LESS THAN (2004,11,1) TABLESPACE ldy,    
PARTITION sales_q180 VALUES LESS THAN (2004,12,1) TABLESPACE ldy,    
PARTITION sales_q181 VALUES LESS THAN (2005,1,1) TABLESPACE ldy,     
PARTITION sales_q182 VALUES LESS THAN (2005,2,1) TABLESPACE ldy,     
PARTITION sales_q183 VALUES LESS THAN (2005,3,1) TABLESPACE ldy,     
PARTITION sales_q184 VALUES LESS THAN (2005,4,1) TABLESPACE ldy,     
PARTITION sales_q185 VALUES LESS THAN (2005,5,1) TABLESPACE ldy,     
PARTITION sales_q186 VALUES LESS THAN (2005,6,1) TABLESPACE ldy,     
PARTITION sales_q187 VALUES LESS THAN (2005,7,1) TABLESPACE ldy,     
PARTITION sales_q188 VALUES LESS THAN (2005,8,1) TABLESPACE ldy,     
PARTITION sales_q189 VALUES LESS THAN (2005,9,1) TABLESPACE ldy,     
PARTITION sales_q190 VALUES LESS THAN (2005,10,1) TABLESPACE ldy,    
PARTITION sales_q191 VALUES LESS THAN (2005,11,1) TABLESPACE ldy,    
PARTITION sales_q192 VALUES LESS THAN (2005,12,1) TABLESPACE ldy,    
PARTITION sales_q193 VALUES LESS THAN (2006,1,1) TABLESPACE ldy,     
PARTITION sales_q194 VALUES LESS THAN (2006,2,1) TABLESPACE ldy,     
PARTITION sales_q195 VALUES LESS THAN (2006,3,1) TABLESPACE ldy,     
PARTITION sales_q196 VALUES LESS THAN (2006,4,1) TABLESPACE ldy,     
PARTITION sales_q197 VALUES LESS THAN (2006,5,1) TABLESPACE ldy,     
PARTITION sales_q198 VALUES LESS THAN (2006,6,1) TABLESPACE ldy,     
PARTITION sales_q199 VALUES LESS THAN (2006,7,1) TABLESPACE ldy,     
PARTITION sales_q200 VALUES LESS THAN (2006,8,1) TABLESPACE ldy,     
PARTITION sales_q201 VALUES LESS THAN (2006,9,1) TABLESPACE ldy,     
PARTITION sales_q202 VALUES LESS THAN (2006,10,1) TABLESPACE ldy,    
PARTITION sales_q203 VALUES LESS THAN (2006,11,1) TABLESPACE ldy,    
PARTITION sales_q204 VALUES LESS THAN (2006,12,1) TABLESPACE ldy,    
PARTITION sales_q205 VALUES LESS THAN (2007,1,1) TABLESPACE ldy,     
PARTITION sales_q206 VALUES LESS THAN (2007,2,1) TABLESPACE ldy,     
PARTITION sales_q207 VALUES LESS THAN (2007,3,1) TABLESPACE ldy,     
PARTITION sales_q208 VALUES LESS THAN (2007,4,1) TABLESPACE ldy,     
PARTITION sales_q209 VALUES LESS THAN (2007,5,1) TABLESPACE ldy,     
PARTITION sales_q210 VALUES LESS THAN (2007,6,1) TABLESPACE ldy,     
PARTITION sales_q211 VALUES LESS THAN (2007,7,1) TABLESPACE ldy,     
PARTITION sales_q212 VALUES LESS THAN (2007,8,1) TABLESPACE ldy,     
PARTITION sales_q213 VALUES LESS THAN (2007,9,1) TABLESPACE ldy,     
PARTITION sales_q214 VALUES LESS THAN (2007,10,1) TABLESPACE ldy,    
PARTITION sales_q215 VALUES LESS THAN (2007,11,1) TABLESPACE ldy,    
PARTITION sales_q216 VALUES LESS THAN (2007,12,1) TABLESPACE ldy,    
PARTITION sales_q217 VALUES LESS THAN (2008,1,1) TABLESPACE ldy,     
PARTITION sales_q218 VALUES LESS THAN (2008,2,1) TABLESPACE ldy,     
PARTITION sales_q219 VALUES LESS THAN (2008,3,1) TABLESPACE ldy,     
PARTITION sales_q220 VALUES LESS THAN (2008,4,1) TABLESPACE ldy,     
PARTITION sales_q221 VALUES LESS THAN (2008,5,1) TABLESPACE ldy,     
PARTITION sales_q222 VALUES LESS THAN (2008,6,1) TABLESPACE ldy,     
PARTITION sales_q223 VALUES LESS THAN (2008,7,1) TABLESPACE ldy,     
PARTITION sales_q224 VALUES LESS THAN (2008,8,1) TABLESPACE ldy,     
PARTITION sales_q225 VALUES LESS THAN (2008,9,1) TABLESPACE ldy,     
PARTITION sales_q226 VALUES LESS THAN (2008,10,1) TABLESPACE ldy,    
PARTITION sales_q227 VALUES LESS THAN (2008,11,1) TABLESPACE ldy,    
PARTITION sales_q228 VALUES LESS THAN (2008,12,1) TABLESPACE ldy,    
PARTITION sales_q229 VALUES LESS THAN (2009,1,1) TABLESPACE ldy,     
PARTITION sales_q230 VALUES LESS THAN (2009,2,1) TABLESPACE ldy,     
PARTITION sales_q231 VALUES LESS THAN (2009,3,1) TABLESPACE ldy,     
PARTITION sales_q232 VALUES LESS THAN (2009,4,1) TABLESPACE ldy,     
PARTITION sales_q233 VALUES LESS THAN (2009,5,1) TABLESPACE ldy,     
PARTITION sales_q234 VALUES LESS THAN (2009,6,1) TABLESPACE ldy,     
PARTITION sales_q235 VALUES LESS THAN (2009,7,1) TABLESPACE ldy,     
PARTITION sales_q236 VALUES LESS THAN (2009,8,1) TABLESPACE ldy,     
PARTITION sales_q237 VALUES LESS THAN (2009,9,1) TABLESPACE ldy,     
PARTITION sales_q238 VALUES LESS THAN (2009,10,1) TABLESPACE ldy,    
PARTITION sales_q239 VALUES LESS THAN (2009,11,1) TABLESPACE ldy,    
PARTITION sales_q240 VALUES LESS THAN (2009,12,1) TABLESPACE ldy,    
PARTITION sales_q241 VALUES LESS THAN (2010,1,1) TABLESPACE ldy,     
PARTITION sales_q242 VALUES LESS THAN (2010,2,1) TABLESPACE ldy,     
PARTITION sales_q243 VALUES LESS THAN (2010,3,1) TABLESPACE ldy,     
PARTITION sales_q244 VALUES LESS THAN (2010,4,1) TABLESPACE ldy,     
PARTITION sales_q245 VALUES LESS THAN (2010,5,1) TABLESPACE ldy,     
PARTITION sales_q246 VALUES LESS THAN (2010,6,1) TABLESPACE ldy,     
PARTITION sales_q247 VALUES LESS THAN (2010,7,1) TABLESPACE ldy,     
PARTITION sales_q248 VALUES LESS THAN (2010,8,1) TABLESPACE ldy,     
PARTITION sales_q249 VALUES LESS THAN (2010,9,1) TABLESPACE ldy,     
PARTITION sales_q250 VALUES LESS THAN (2010,10,1) TABLESPACE ldy,    
PARTITION sales_q251 VALUES LESS THAN (2010,11,1) TABLESPACE ldy,    
PARTITION sales_q252 VALUES LESS THAN (2010,12,1) TABLESPACE ldy,    
PARTITION sales_q253 VALUES LESS THAN (2011,1,1) TABLESPACE ldy,     
PARTITION sales_q254 VALUES LESS THAN (2011,2,1) TABLESPACE ldy,     
PARTITION sales_q255 VALUES LESS THAN (2011,3,1) TABLESPACE ldy,     
PARTITION sales_q256 VALUES LESS THAN (2011,4,1) TABLESPACE ldy,     
PARTITION sales_q257 VALUES LESS THAN (2011,5,1) TABLESPACE ldy,     
PARTITION sales_q258 VALUES LESS THAN (2011,6,1) TABLESPACE ldy,     
PARTITION sales_q259 VALUES LESS THAN (2011,7,1) TABLESPACE ldy,     
PARTITION sales_q260 VALUES LESS THAN (2011,8,1) TABLESPACE ldy,     
PARTITION sales_q261 VALUES LESS THAN (2011,9,1) TABLESPACE ldy,     
PARTITION sales_q262 VALUES LESS THAN (2011,10,1) TABLESPACE ldy,    
PARTITION sales_q263 VALUES LESS THAN (2011,11,1) TABLESPACE ldy,    
PARTITION sales_q264 VALUES LESS THAN (2011,12,1) TABLESPACE ldy,    
PARTITION sales_q265 VALUES LESS THAN (2012,1,1) TABLESPACE ldy,     
PARTITION sales_q266 VALUES LESS THAN (2012,2,1) TABLESPACE ldy,     
PARTITION sales_q267 VALUES LESS THAN (2012,3,1) TABLESPACE ldy,     
PARTITION sales_q268 VALUES LESS THAN (2012,4,1) TABLESPACE ldy,     
PARTITION sales_q269 VALUES LESS THAN (2012,5,1) TABLESPACE ldy,     
PARTITION sales_q270 VALUES LESS THAN (2012,6,1) TABLESPACE ldy,     
PARTITION sales_q271 VALUES LESS THAN (2012,7,1) TABLESPACE ldy,     
PARTITION sales_q272 VALUES LESS THAN (2012,8,1) TABLESPACE ldy,     
PARTITION sales_q273 VALUES LESS THAN (2012,9,1) TABLESPACE ldy,     
PARTITION sales_q274 VALUES LESS THAN (2012,10,1) TABLESPACE ldy,    
PARTITION sales_q275 VALUES LESS THAN (2012,11,1) TABLESPACE ldy,    
PARTITION sales_q276 VALUES LESS THAN (2012,12,1) TABLESPACE ldy
);

用来生成分区脚本内容:
set line 70
set serveroutput on
set serveroutput on size 100000
spool d:\par.txt
declare
pno INTEGER;
begin
for y in 1990..2012 loop
for m in 1..12 loop
select LDY.PNO_ID.nextval into pno from dual;
dbms_output.put_line('PARTITION sales_q'||pno||' VALUES LESS THAN ('||y||','||m||',1) TABLESPACE ldy,');
end loop;
end loop;
end;
/
spool off

插入数据:
begin
for y in 1..100000 loop
execute immediate 'insert into ldy.sales values (LDY.PNO_ID.nextval,trunc(dbms_random.value(1990,2012)),trunc(dbms_random.value(1,12)),trunc(dbms_random.value(1,21)))';
if y mod 1000=0 then
commit;
end if;
end loop;
end;
/

创建普通表,数据内容与分区表相同。
CREATE TABLE ldy.sales_nopart
(
invoice_no NUMBER,
sale_year INT NOT NULL,
sale_month INT NOT NULL,
sale_day INT NOT NULL
);
insert into ldy.sales_nopart select * from ldy.sales;

sales              表大小17.25 MB
sales_nopart       表大小3 MB
两张表数据量相同,都是110002行。
但分区表大,普通表小。

exp file=d:\sales.dmp tables=(sales)
导出花费10s
dump文件大小:2.7 MB
exp
file=d:\sales_nopart.dmp tables=(sales_nopart)
导出花费2s
dump文件大小:2.19 MB

imp file=d:\sales.dmp buffer=1048576 FROMUSER=ldy touser=eagle tables=(sales)
导入花费25s
imp
file=d:\sales_nopart.dmp buffer=1048576 FROMUSER=ldy touser=eagle tables=(sales_nopart)
导入花费2s
由此可见,导入导出相同数据量的表,分区表会比普通表慢很多。
阅读(1702) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~