Learn to prepare tasty,quality south indian, north indian, vegeterian,non-vegeterian,thai,tiffin,idli,dosa,vada,sambar.
Oracle Clustered Tables
As an effort towards saving data block storage space clusters can be used to store two or more tables together where related columns of tables are stored together.
1) Create a cluster before creating constituent tables
sql>create cluster clustername (common-column datatype) tablespace tablespace-name;
In case of hash clusters issue the following command:
sql>create cluster cluster-name(common-column datatype)tablespace tablespace-name hash is hashkeys value;
2) Create the constituent tables. Create the parent table first and dependent table next.
sql> create table table-name(col datatype) cluster cluster_name;
sql> create table tablename(col datatypE references parent-col)cluster clustername;
To drop a cluster first drop the constituent tables and then drop the cluster.
sql>drop table tablename;
sql>drop cluster clustername;
Note: If we try to drop a non-empty cluster we will get error.
The view used to obtain information about cluster is dba_clusters.