create partition table + partition + Partition Table category + Create range partition Table + query partition data

Source: Internet
Author: User

Partitioning
1 is suitable for processing large amount of data, such as TB class
2 to improve reading and writing and query speed of mega database
3 users can create tables by applying partitioning techniques to save data in a partitioned form
4 partitioning is the separation of large tables or indexes into relatively small, independently managed parts. The partitioned table does not differ from the unpartitioned table in the execution of the DML statement.
5 When partitioning a table, you must specify the partition that belongs to each record in the table, and which partition is determined by the partition table's matching field for that record.
A 6 partition field can be a field or a combination of multiple fields.
7 when the partition table determines that the user inserts an update or deletes the partition table, Oracle automatically chooses the storage access based on the value of the partition field.
8 When you create a partitioned table, you do not specify a partition name, and Oracle automatically names the partition.

Classification of partitioned Tables
Range Partitioning: Partitioning a range of values for a data table, using the partition by range clause.
Hash partition:
List partitions:
Combine range hash Partition:
Combine range list partitions:

create a range partition Table
CREATE TABLE Student_partition (
Sno VARCHAR2 (10),
Sname varchar2 (20),
Sage Number (2),
Score Number (2)
) partition by range (score) – Range partition table
(
Partition part1 values less than tablespace myspace,
Partition Part2 values less than tablespace myspace,
Partition Part3 values less than (MaxValue) tablespace users
);

INSERT into student_partition values (' 1 ', ' My name is Division 1 ', 12,55);
INSERT into student_partition values (' 2 ', ' My name is Division 1 ', 12,56);

INSERT into student_partition values (' 3 ', ' My name is Division 2 ', 12,76);
INSERT into student_partition values (' 4 ', ' My name is Division 3 ', 12,86);

Explain:
Partition by range (score) – Range partition table
Range (Score): Partitioning by socre column
Part1: Name of partition
Tablespace MySpace: Specify the storage table space for the part1 partition

query the data within the partition
SELECT * from Student_partition partition (part1);
SELECT * from Student_partition partition (part2);
SELECT * from Student_partition partition (PART3);

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.