Oracle clusters and cluster tables

Source: Internet
Author: User

Oracle clusters and cluster tables

A cluster consists of multiple tables that share the same data block. It stores the related rows of these tables in the same data block, which can reduce the disk read volume required to query data. After creating a cluster, you can create tables in the cluster. These tables become cluster tables.

For example, the scott user has an employee information table (emp) and a department information table (dept). The two tables share the Department number (deptno) column. After the emp and dept tables are clustered, Oracle physically stores all employee information and Department Information rows in the emp and dept tables for each department in the same data block. Because clusters store related rows of different tables in the same data block, the rational use of clusters can help reduce the disk read volume required for data query. Instead of using clusters for tables that are often used separately.

Create a cluster
The syntax for creating a cluster is as follows:

Create cluster cluster_name (COLUMN date_type [, COLUMN date_type]...)
[PCTUSED 40 | INTEGER]
[PCTFREE 10 | INTEGER]
[Size integer]
[INITRANS 1 | INTEGER]
[MAXTRANS 255 | INTEGER]
[TABLESPACE tablespace_name]
[STORAGE storage] 1
Example 1:
Log On As SYSDBA and grant related permissions to the user:

Grant alter any cluster to siege; 1

Then create a cluster:

Create cluster cluster_student (sid NUMBER)
PCTUSED 40
PCTFREE 10
SIZE 1024
STORAGE (
Initialize 128 k
NEXT 128 k
MINEXTENTS 2
MAXEXTENTS 20
) TABLESPACE learning;

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.