-- Create table 創建表
create table TestTable
(
ID INTEGER not null,
Name nvarchar2(100) not null,
InsertedTime date not null
)
--同時創建分區表
partition by range (InsertedTime)
(
partition TestTable_PART1201 values less than (TO_DATE('2012-1-1','YYYY-MM-DD')) tablespace TestTableSpace,
partition TestTable_PART1204 values less than (TO_DATE('2012-4-1','YYYY-MM-DD')) tablespace TestTableSpace,
partition TestTable_PART1207 values less than (TO_DATE('2012-7-1','YYYY-MM-DD')) tablespace TestTableSpace,
partition TestTable_PART1210 values less than (TO_DATE('2012-10-1','YYYY-MM-DD')) tablespace TestTableSpace
)
--TestTableSpace 表空間,必須提前已經建好 將多個分區表歸屬到這個TestTableSpace空間,也可以歸屬到不同的表空間
-- 創建分區表,對於一個表的數據迅速增加的系統,為了提高數據操縱的效率,可以將一個表分成多個部分
按時間,也可以按照數據的大小
有時候,可能引起出入數據數據錯誤[未將關鍵字映射到任何表分區]