Database Reference
In-Depth Information
Figure 21.7
CREATE TABLE
Syntax for a
Cluster.
Note: The CREATE TABLE and CREATE CLUSTER system privileges
are required.
CREATE CLUSTER SALESCLU (SALES_ID NUMBER);
CREATE INDEX XSALESCLU ON CLUSTER SALESCLU;
Now we add two dimension tables to the fact cluster:
CREATE TABLE CONTINENT_SALESCLU CLUSTER
SALESCLU(CONTINENT_ID)
AS SELECT * FROM CONTINENT;
CREATE TABLE COUNTRY_SALESCLU CLUSTER SALESCLU(COUNTRY_ID)
AS SELECT * FROM COUNTRY;
We could add a join to the cluster. Because the structure of the cluster
is being altered, we need to drop the tables already added to the cluster
and drop and re-create the cluster, because of the table content of the
join. This cluster joins two dimensions, continent and country, to the
SALES fact table.
DROP TABLE CONTINENT_SALESCLU;
DROP TABLE COUNTRY_SALESCLU;
DROP CLUSTER SALESCLU;
CREATE CLUSTER SALESCLU (CONTINENT_ID NUMBER
, COUNTRY_ID NUMBER, CUSTOMER_ID NUMBER
Search WWH ::




Custom Search