Oracle Partition Table and Index

Source: Internet
Author: User
Welcome to the Oracle community forum and interact with 2 million technical staff when to use partitions: 1. Large Data Tables, such as tables larger than 2 GB. On the one hand, a 2 GB file is an upper limit for 32-bit OS, and the backup time is long. 2. tables that contain historical data, such as the latest data, are placed in the latest partition. Typical Example: History Table, only when

Welcome to the Oracle community forum and interact with 2 million technical staff> when to use partitions: 1. Large Data Tables, such as tables larger than 2 GB. On the one hand, a 2 GB file is an upper limit for 32-bit OS, and the backup time is long. 2. tables that contain historical data, such as the latest data, are placed in the latest partition. Typical Example: History Table, only when

Welcome to the Oracle community forum and interact with 2 million technical staff> enter

  When to use partitions:

1. Large Data Tables, such as tables larger than 2 GB. On the one hand, a 2 GB file is an upper limit for 32-bit OS, and the backup time is long.

2. tables that contain historical data, such as the latest data, are placed in the latest partition. Typical Example: In a historical table, only the data of the current month can be modified, and only the read-only data of other months can be modified.

ORACLE only supports the following partitions: tables, indexes on tables, materialized views, and indexes on materialized views.

Partitions are transparent to SQL and DML (applications do not have to know that they have already been partitioned), but DDL can manage different partitions.

Different partitions must have the same logical attributes, such as common table names, column names, data types, and constraints;

However, they can have different physical attributes, such as pctfree, pctused, and tablespaces.

Partition independence: other partitions are still available even if some partitions are unavailable.

A maximum of 64000 partitions can be divided, but tables with LONG or long raw Columns cannot, but tables with CLOB or BLOB columns can.

You do not need the to_date function, for example:

Alter session set nls_date_format = 'Mm/dd/yyyy ';

Create table sales_range

(Salesman_id NUMBER (5 ),

Salesman_name VARCHAR2 (30 ),

Sales_amount NUMBER (10 ),

Sales_date DATE)

Partition by range (sales_date)

(

PARTITION sales_jan2000 values less than ('2017/123 '),

PARTITION sales_feb2000 values less than ('2014/1/123 '),

PARTITION sales_mar2000 values less than ('2017/123 '),

PARTITION sales_apr2000 values less than ('2017/123 ')

);

Partition Key: a maximum of 16 columns, which can be nullable

Non-Partitioned Tables can have partitioned or non-partitioned indexes;

Partitioned Tables can have partitioned or non-partitioned indexes;

  Partitioning Method:

Range Partitioning

List Partitioning

Hash Partitioning

Composite Partitioning

Composite Partitioning: combination, and range-hash and range-list composite partitioning

[1] [2] [3] [4]

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.