• Arun Kumar

Oracle Table and Tables Cluster

Let us create an index cluster on employees and department table under scott user


Create Cluster Table


CREATE CLUSTER employees_departments_cluster
(department_id NUMBER(2));


Create Index on Cluster Table


Without create an index on cluster table, you cannot proceed. This is an Index Cluster


CREATE INDEX idx_emp_dept_cluster ON CLUSTER employees_departments_cluster;


Create Tables Inside Cluster


Create tables inside cluster based on cluster key column


CREATE TABLE EMP_CLUST 
CLUSTER employees_departments_cluster (deptno)
as select * from emp;


CREATE TABLE DEPT_CLUST 
CLUSTER employees_departments_cluster (deptno)
as select * from dept;


Drop Table Inside Cluster


DROP TABLE EMP_CLUST;
DROP TABLE DEPT_CLUST;


Drop Cluster


DROP CLUSTER employees_departments_cluster


68 views

Recent Posts

See All

Oracle 12c to 19c Database Upgrade

In this article we will be looking at two most commonly used methods of upgrading Oracle database from 12c to 19c Pre-upgrade tasks Upgrade using DBUA Upgrade using Manual Method You can perform a dir