Database Reference
In-Depth Information
Note: There is a new type of global partition index called a hash
partitioned global index. A hash algorithm allows for an even spread of
index values.
18.3.6.2
CREATE TABLE Partition Syntax
The syntax diagrams listed in this section on Oracle Partitioning do not
contain all available table creation partitioning syntax. There is simply too
much detail to include in this topic. Examples will suffice to get you started
syntactically. Refer to Oracle documentation for more information.
Note: CREATE TABLE partition syntax is shown in Figures 18.13 to
18.17. These syntax diagrams are cumulative with respect to annotations.
In other words, annotations present in Figure 18.13 may still apply to Fig-
ure 18.17 but may not be present in Figure 18.17 for the sake of avoiding
diagrams being just too cluttered.
18.3.6.2.1
CREATE TABLE Range Partition Syntax
The following script creates a very simple range partition using a subquery
from the SALES table:
CREATE TABLE SALESRANGE PARTITION BY RANGE(SALE_DATE)(
PARTITION S2001 VALUES LESS THAN
(TO_DATE('2002-01-01','YYYY-MM-DD'))
, PARTITION S2002 VALUES LESS THAN
(TO_DATE('2003-01-01','YYYY-MM-DD'))
, PARTITION S2003 VALUES LESS THAN(MAXVALUE))
AS SELECT * FROM SALES;
We could also create a partition index where indexing is local to each
partition, but this is a little advanced for this topic.
CREATE INDEX LK_SALESRANGE_1 ON SALESRANGE
(SALE_DATE, CONTINENT_ID, COUNTRY_ID) LOCAL;
18.3.6.2.2
CREATE TABLE List Partition Syntax
The following script creates a simple list partition using a subquery from
the SALES table:
 
Search WWH ::




Custom Search