Cluster

An Oracle objects that allows one to store related rows from different tables in the same data block. A cluster can contain a maximum of 32 tables.

SQL> create cluster teacher_student(t_id number)

tablespace users;

Cluster created.

SQL> create index teacher_student_ind on cluster teacher_student;

Index created.

SQL> create table teacher(t_id number,t_name varchar2(10),room number)

cluster teacher_student(t_id);

Table created.

SQL> create table student(s_id number,s_name varchar2(10),t_id number)

cluster teacher_student(t_id);

Table created.

SQL> select object_name,object_type

from user_objects

where object_name='TEACHER_STuDENT';

no rows selected

SQL> column object_name format a25

SQL> column object_type format a25

SQL> select object_name,object_type

from user_objects

where object_name='TEACHER_STUDENT';

OBJECT_NAME OBJECT_TYPE

--------------------------------- ------------------------------------------------------

TEACHER_STUDENT CLUSTER

Giving Creating Cluster Permission to another User:

SQL> grant create cluster to scott;

Grant succeeded.