IT Community - Software Programming, Web Development and Technical Support

Oracle Cluster - Create and Alter Basic Syntax

This is a discussion on Oracle Cluster - Create and Alter Basic Syntax within the Database Support forums, part of the Web Development category; Oracle Clusters  General Information  Data Dictionary Objects  System Privileges  Clustering By Hash  Clustering By Index &#...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > Database Support

Register FAQ Members List Calendar Mark Forums Read
  2 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 07-11-2007, 12:23 AM
Murali Murali is offline
D-Web Master
 
Join Date: Feb 2007
Location: India-Chennai.
Posts: 386
Murali is on a distinguished road
Send a message via AIM to Murali
Default Oracle Cluster - Create and Alter Basic Syntax

Oracle Clusters

 General Information
 Data Dictionary Objects
 System Privileges
 Clustering By Hash
 Clustering By Index
 Size Calculation

Create Cluster

• Create Simple Cluster With Cluster Index
• Create Simple Hash Cluster
• Sorted Hash Cluster
• Create Hash Cluster With Hash Expression
• Single Table Hash Cluster
• Create Index Cluster

Alter Cluster

• INITRANS
• MAXTRANS
• PCTFREE
• PCTUSED

Drop Cluster

• Drop Cluster

Data Dictionary Objects

• DBA
o dba_clusters
o dba_clu_columns
o dba_cluster_hash _expressions
o dba_all_tables
• ALL
o all_clusters
o all_clu_columns
o all_cluster_hash _expressions
o all_all_tables
• USER
o user_clusters
o user_clu_columns
o user_cluster_hash _expressions
o user_all_tables

System Privileges

o alter any cluster
o create any cluster
o create cluster
o drop any cluster

Clustering By Hash

Data is co-located within a single block based on a hash key and a hash function.

Clustering By Index
Data is co-located within a single block based on a common column index.

Size Calculation

Size of the primary key of the parent + ((size of the primary key of the children) * # of children) - ((size of the primary key of the parent) * # of children).



For example:

If the parent is the employee table where the primary key is ssn (VARCHAR2(9)) and the child is table is pay where the primary key is ssn (VARCHAR2(9)) and date of payment (date datatype which is 7 bytes) ... on average if there are 300 children records then 9 + (300 * (9+7)) - (300 * 9) or 9 + (300 * 7) = 2,109.

Create Cluster

Create Simple Cluster With Cluster Index

CREATE CLUSTER <schema_name>. <cluster_name> (
<cluster_key_column_name> <data_type> <SORT>)
PCTFREE<integer>
PCTUSED <integer>
INITRANS <integer>
MAXTRANS <integer>
SIZE <integer><K | M | G | T>
TABLESPACE <tablespace_name>
INDEX
<SINGLE TABLE>
HASHKEYS <integer>
HASH IS <expression>
PARALLEL <integer>
<NOWROWDEPENDENCIES | ROWDEPENDENCIES>
<CACHE | NOCACHE>;

Create Simple Hash Cluster

CREATE CLUSTER <schema_name>.<cluster_name> (
<cluster_key_column_name> <data_type> <SORT>)
PCTFREE<integer>
PCTUSED <integer>
INITRANS <integer>
MAXTRANS <integer>
SIZE <integer><K | M | G | T>
TABLESPACE <tablespace_name>
INDEX
<SINGLE TABLE>
HASHKEYS <integer>
HASH IS <expression>
PARALLEL <integer>
<NOWROWDEPENDENCIES | ROWDEPENDENCIES>
<CACHE | NOCACHE>;


Sorted Hash Cluster

CREATE CLUSTER <schema_name>.<cluster_name> (
<cluster_key_column_name> <data_type> <SORT>)
PCTFREE<integer>
PCTUSED <integer>
INITRANS <integer>
MAXTRANS <integer>
SIZE <integer><K | M | G | T>
TABLESPACE <tablespace_name>
INDEX
<SINGLE TABLE>
HASHKEYS <integer>
HASH IS <expression>
PARALLEL <integer>
<NOWROWDEPENDENCIES | ROWDEPENDENCIES>
<CACHE | NOCACHE>;


Create Hash Cluster with Hash Expression

CREATE CLUSTER <cluster_name> (
column_name> <data_type>, <column_name> <data_type>
HASHKEYS <integer>
HASH IN <hash_expression>);

Single Table Hash Cluster

CREATE CLUSTER <cluster_name> (
column_name> <data_type>) SINGLE TABLE;

Create Index Cluster

CREATE CLUSTER <cluster_name>
(column_name> <data_type>);

This is very similar to creating a cluster created with cluster Index.

Alter Cluster

INITRANS

ALTER CLUSTER <cluster_name> INITRANS <integer>

MAXTRANS

ALTER CLUSTER <cluster_name> MAXTRANS <integer>

PCTFREE
ALTER CLUSTER <cluster_name> PCTFREE <integer>

PCTUSED

ALTER CLUSTER <cluster_name> PCTUSED <integer>

Drop Cluster
DROP CLUSTER <cluster_name>;

Note:
The word cluster in Oracle bears not relationship to its use in SQL Server and other RDBMS products.
__________________
-Murali..
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-11-2007, 03:24 AM
Gopisoft Gopisoft is offline
D-Web Sr.Programmer
 
Join Date: Feb 2007
Posts: 117
Gopisoft is on a distinguished road
Default Re: Oracle Cluster - Create and Alter Basic Syntax

Hi,

How to create the Multi-Table Cluster by Hash and Multi-Table Cluster by Index

-R.Gopi
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 07-11-2007, 06:40 AM
Murali Murali is offline
D-Web Master
 
Join Date: Feb 2007
Location: India-Chennai.
Posts: 386
Murali is on a distinguished road
Send a message via AIM to Murali
Default Re: Oracle Cluster - Create and Alter Basic Syntax

Here it is,

Multi-Table Cluster by Hash

CREATE CLUSTER <schema_name>.<cluster_name> (
<cluster_key_column_name> <data_type> <SORT>)
PCTFREE<integer>
PCTUSED <integer>
INITRANS <integer>
MAXTRANS <integer>
SIZE <integer><K | M | G | T>
TABLESPACE <tablespace_name>
INDEX
<SINGLE TABLE>
HASHKEYS <integer>
HASH IS <expression>
PARALLEL <integer>
<NOWROWDEPENDENCIES | ROWDEPENDENCIES>
<CACHE | NOCACHE>;

Multi-Table Cluster by Index


CREATE CLUSTER <schema_name>. <cluster_name> (
<cluster_key_column_name> <data_type> <SORT>)
PCTFREE<integer>
PCTUSED <integer>
INITRANS <integer>
MAXTRANS <integer>
SIZE <integer><K | M | G | T>
TABLESPACE <tablespace_name>
INDEX
<SINGLE TABLE>
HASHKEYS <integer>
HASH IS <expression>
PARALLEL <integer>
<NOWROWDEPENDENCIES | ROWDEPENDENCIES>
<CACHE | NOCACHE>;
__________________
-Murali..
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

LinkBacks (?)
LinkBack to this Thread: http://www.discussweb.com/database-support/1564-oracle-cluster-create-alter-basic-syntax.html
Posted By For Type Date
Oracle Cluster - Create and Alter Basic Syntax | Web Hosting This thread Refback 02-07-2008 02:30 PM
index syntax oracle This thread Trackback 08-29-2007 09:44 PM

Similar Threads
Thread Thread Starter Forum Replies Last Post
Php Basic Syntax of Regular Expressions senraj PHP Programming 12 02-08-2008 08:29 PM
Oracle server - create database write2ashokkumar Server Management 1 09-04-2007 04:00 AM
Row order in cluster & non-cluster index? prasath Database Support 1 08-08-2007 12:35 AM
What is a table called, if it does not have neither Cluster nor Non-cluster Index?.. Archer Database Support 2 07-19-2007 12:19 AM
cluster index in Oracle vigneshgets Database Support 1 07-10-2007 07:22 AM


All times are GMT -7. The time now is 01:23 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0