11.07.2015 Views

Oracle Database 11 g - Online Public Access Catalog

Oracle Database 11 g - Online Public Access Catalog

Oracle Database 11 g - Online Public Access Catalog

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

554 CHAPTER 12 ■ DATA WAREHOUSINGSQL> create table docs_list_list2 (document_id number,3 document_category varchar2(10),4 organization_id number,5 creation_date date,6 blob_content blob ) lob (blob_content) store as securefile7 partition by list (organization_id)8 subpartition by range (creation_date)9 ( partition org1 values (1)10 ( subpartition p1_cat_2007q1values less than (to_date('01-APR-2007','dd-MON-yyyy')),<strong>11</strong> subpartition p1_cat_2007q2values less than (to_date('01-JUL-2007','dd-MON-yyyy')) ),12 partition org2 values (2)13 ( subpartition p2_cat_2007q1values less than (to_date('01-APR-2007','dd-MON-yyyy')),14 subpartition p2_cat_2007q2values less than (to_date('01-JUL-2007','dd-MON-yyyy')) )15* )SQL> /Table created.Composite Range-Range PartitioningOne common implementation of composite range-range partitions is on two date columns.Let’s create a range-range partitioned table against the ALERT_NOTIFICATIONS table. In this particularinstance, the data volume for this table is expected to be enormous because thousands ofsystems and databases are monitored for thousands of companies. We will create a compositerange-range partition based on when the alert was generated and when the alert was actuallyclosed. The following create table syntax shows you how to create a composite range-rangepartition partitioned by CREATION_DATE and subpartitioned by CLOSED_DATE:SQL> CREATE TABLE alerts_range_range2 (alert_notification_id number,3 subject varchar2(2000),4 hostname varchar2(55),5 database_name varchar2(55),6 severity varchar2(1),7 alert_log_id number,8 message varchar2(4000),9 creation_date date default sysdate,10 created_by varchar2(55),<strong>11</strong> modification_date date default sysdate,12 modified_by varchar2(55),13 closed_date date)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!