ORACLE8 Management of partitions

Source: Internet
Author: User

Absrtact: This article introduces the new features of Oracle databases-partitioning management and illustrates how to use them with examples.

I. Overview of partitions:

To simplify the management of database large tables, ORACLE8 has introduced partitioning options. Partitioning separates tables in a number of different tablespaces, using a divide-and-conquer approach to support large tables that are infinitely swollen, and to the manageability of large tables at the physical level. Splitting a large table into smaller partitions can improve the maintenance, backup, recovery, transaction, and query performance of the table. This option can be recommended for a large number of daily business data in the current social security and telecommunications industry, ORACLE8.

Second, the advantages of zoning:

1. Enhance usability: If one partition of a table is not usable due to system failure, the rest of the table can still be used;

2, reduce the shutdown time: If the system failure affects only part of the table partition, then only this part of the partition needs to be repaired, so can be repaired than the whole large table to spend less time;

3. Easy maintenance: If you need to rebuild the table, it is much easier to manage each partition independently than to manage a single large table;

4, balanced I/O: The table can be divided into different partitions to separate disk to balance I/O performance improvement;

5, improve performance: the large table query, add, modify and other operations can be decomposed into the table of different partitions to execute in parallel, can make running faster;

6, the partition is transparent to the user, the end user does not feel the existence of the partition.

Third, the management of the division:

1, the establishment of the partition table:

A company produces a huge annual sales record, and the DBA advises the company on quarterly data in one partition, following the company's 1999 data (assuming 30M of data per month), as follows:

STEP1, creating table spaces for each partition of the table:

CREATE tablespace ts_sale1999q1

DataFile '/u1/oradata/sales/sales1999_q1.dat '

SIZE 100M

DEFAULT STORAGE (INITIAL 30m NEXT 30m minextents 3 Pctincrease 0)

CREATE tablespace TS_SALE1999Q2

DataFile '/u1/oradata/sales/sales1999_q2.dat '

SIZE 100M

DEFAULT STORAGE (INITIAL 30m NEXT 30m minextents 3 Pctincrease 0)

CREATE tablespace ts_sale1999q3

DataFile '/u1/oradata/sales/sales1999_q3.dat '

SIZE 100M

DEFAULT STORAGE (INITIAL 30m NEXT 30m minextents 3 Pctincrease 0)

CREATE tablespace ts_sale1999q4

DataFile '/u1/oradata/sales/sales1999_q4.dat '

SIZE 100M

DEFAULT STORAGE (INITIAL 30m NEXT 30m minextents 3 Pctincrease 0)


STEP2, creating a partitioned table:

CREATE TABLE Sales

(Invoice_no number,

...

Sale_date date not NULL)

PARTITION by RANGE (sale_date)

(PARTITION sales1999_q1

VALUES less THAN (to_date (' 1999-04-01 ', ' yyyy-mm-dd ')

Tablespace ts_sale1999q1,

PARTITION SALES1999_Q2

VALUES less THAN (to_date (' 1999-07-01 ', ' yyyy-mm-dd ')

Tablespace TS_SALE1999Q2,

PARTITION sales1999_q3

VALUES less THAN (to_date (' 1999-10-01 ', ' yyyy-mm-dd ')

Tablespace ts_sale1999q3,

PARTITION Sales1999_q4

VALUES less THAN (to_date (' 2000-01-01 ', ' yyyy-mm-dd ')

Tablespace ts_sale1999q4);




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.