Oracle. Table partition: Composite Partition

Source: Internet
Author: User

Combination of range partitions and hash partitions or list partitions

Syntax:

  1. PARTITIONBYRANGE (column_name1)
  2. SUBPARTITIONBYHASH (column_name2)
  3. SUBPARTITIONS number_of_partitions
  4. (
  5. PARTITION part1 value less than (range1 ),
  6. PARTITION part2 value less than (range2 ),
  7. ...
  8. PARTITION partN value less than (MAXVALUE)
  9. );
Example:
  1. CREATE TABLESALES
  2. (
  3. PRODUCT_ID VARCHAR2 (5 ),
  4. SALES_DATEDATE NOT NULL,
  5. SALES_COST NUMBER (10)
  6. )
  7. PARTITIONBYRANGE (SALES_DATE)
  8. SUBPARTITIONBYHASH (PRODUCT_ID)
  9. SUBPARTITIONS 5
  10. (
  11. PARTITION S1VALUESLess than (TO_DATE ('2014/1/2/0','DD/MON/YYYY ')),
  12. PARTITION S2VALUESLess than (TO_DATE ('2014/1/2/0','DD/MON/YYYY ')),
  13. PARTITION S3VALUESLess than (TO_DATE ('2014/1/2/0','DD/MON/YYYY ')),
  14. PARTITION S4VALUESLess than (MAXVALUE)
  15. );

For more information about Oracle, see Oracle topics page http://www.bkjia.com/topicnews.aspx? Tid = 12

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.