Oracle's cluster and cluster tables

Source: Internet
Author: User

Oracle's cluster and cluster tables

A cluster consists of a group of tables that share the same data block, which stores the related rows of those tables in the same data block, which reduces the amount of disk reads required to query the data. After the cluster is created, users can create tables in the cluster that become cluster tables.

For example, the Scott user has an employee information sheet EMP, a Departmental Information table dept, and two tables that share the department number deptno column. When the EMP and Dept tables are clustered, the physical Oracle stores all employee information and department information lines for each department in the EMP and dept tables into the same data block. Because clusters store related rows of different tables in the same data block, proper use of clusters can help reduce the amount of disk reads required to query the data. For tables that are often used alone, you should not use clusters.

Create a cluster

The syntax for creating clusters is as follows:

CREATE CLUSTER cluster_name(COLUMN date_type[,COLUMN date_type]...40101255 | INTEGER][TABLESPACE tablespace_name][STORAGE storage]

Example 1:
Log in with the SYSDBA role and give the user the appropriate permissions:

GRANT  ALTER ANY CLUSTER TO siege;

Then create the cluster:

CREATE CLUSTER cluster_student(sid NUMBER)PCTUSED 40PCTFREE 10SIZE 1024STORAGE (        INITIAL 128k        NEXT 128k        MINEXTENTS 2        MAXEXTENTS 20)TABLESPACE learning;

Oracle's cluster and cluster tables

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.