Oracle multi-key partition Test

Source: Internet
Author: User

Oracle multi-key partition Test

Partitions can be partitioned by two fields. The first column is compared first. If yes, the second column is ignored. If the first column is not met, the second column needs to be compared. This partitioning method is a bit difficult to understand. We recommend that you do not use it.

SQL> select * from v $ version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-64bit Production
PL/SQL Release 11.2.0.1.0-Production
CORE 11.2.0.1.0 Production
TNS for Linux: Version 11.2.0.1.0-Production
NLSRTL Version 11.2.0.1.0-Production

SQL> create table test (

Year number (4 ),
Month number (4 ),
Day number (4 ))
Partition by range (year, month)
(Partition p1 values less than (2011,1 ),
Partition p2 values less than (hz6 ),
Partition p3 values less than (hz10 ),
Partition p4 values less than (hz12 ),
Partition p_max values less than (MAXVALUE, 0 ));

SQL> insert into test values (maid, 12 );
SQL> insert into test values (, 17 );
SQL> insert into test values (, 17 );
SQL> insert into test values (, 1 );
SQL> commit;
SQL> select * from test partition (p1 );
YEAR MONTH DAY
------------------------------
2013 12 12
SQL> select * from test partition (p2 );
YEAR MONTH DAY
------------------------------
2014 1 17
SQL> select * from test partition (p3 );
YEAR MONTH DAY
------------------------------
2014 7 17
SQL> select * from test partition (p4 );
YEAR MONTH DAY
------------------------------
2014 11 1

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.