Skip Headers

Oracle® OLAP Application Developer's Guide
10g Release 1 (10.1)

Part Number B10333-02
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Feedback

Go to previous page
Previous
Go to next page
Next
View PDF

C Programs Used to Create GLOBALX

GLOBALX is a sample analytic workspace that is populated manually from sources other than a star schema, as described in Chapter 11. This appendix provides additional source code needed to replicate the examples in that chapter, but which are extraneous to the topics being discussed.

This appendix contains the following topics:

C.1 SQL Scripts for Defining Users and Tablespaces

Create the GLOBALX tablespace first, since it will be the default tablespace for both the GLOBALX and GLOBALX_AW users. Then create the GLOBALX user. Define the star schema before creating the GLOBALX_AW user.

Example C-1 Script for Creating the GLOBALX Tablespaces

CREATE TABLESPACE globalx LOGGING 
   DATAFILE '/users/oracle/global_data/globalx.dbf' 
   SIZE 5M REUSE AUTOEXTEND ON NEXT 5M MAXSIZE UNLIMITED
   EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;

CREATE TEMPORARY TABLESPACE glotempx
   TEMPFILE '/users/oracle/global_data/glotempx.tmp'
   SIZE 5M REUNE AUTOEXTEND ON NEXT 5M MAXSIZE UNLIMITED
   EXTENT MANAGEMENT LOCAL UNIFORM SIZE 256K; 

Example C-2 Script for Creating the GLOBALX User

/* Create the user and grant privileges */
CREATE USER globalx IDENTIFIED BY "globalx" 
    DEFAULT TABLESPACE globalx
    TEMPORARY TABLESPACE glotempx
    QUOTA UNLIMITED ON globalx
    QUOTA UNLIMITED ON glotempx
    ACCOUNT UNLOCK;
GRANT CONNECT TO globalx;
GRANT OLAP_USER TO globalx;
GRANT CREATE ANY TYPE TO globalx;
GRANT CREATE ANY DIRECTORY TO globalx;

/* Create a database directory*/
CREATE OR REPLACE DIRECTORY gx AS '/users/oracle/globalx_files'; 
GRANT ALL ON DIRECTORY gx TO PUBLIC;

Example C-3 Script for Creating the GLOBALX_AW User

/* Create the user and grant privileges */
CREATE USER globalx_aw IDENTIFIED BY globalx_aw
    DEFAULT TABLESPACE globalx
    TEMPORARY TABLESPACE glotempx
    QUOTA UNLIMITED ON globalx
    QUOTA UNLIMITED ON glotempx
    ACCOUNT UNLOCK;
GRANT CONNECT TO globalx_aw;
GRANT OLAP_USER TO globalx_aw;
GRANT CREATE ANY TYPE TO globalx_aw;
GRANT CREATE ANY DIRECTORY TO globalx_aw;

/* Grant access to GLOBALX star schema */
GRANT SELECT ON GLOBALX.CHANNEL_DUMMY to GLOBALX_AW;
GRANT SELECT ON GLOBALX.PROD_DUMMY to GLOBALX_AW;
GRANT SELECT ON GLOBALX.CUSTOM_DUMMY to GLOBALX_AW;
GRANT SELECT ON GLOBALX.TIME_DUMMY to GLOBALX_AW;
GRANT SELECT ON GLOBALX.UNITS_DUMMY to GLOBALX_AW;
GRANT SELECT ON GLOBALX.PRICE_AND_COST_DUMMY to GLOBALX_AW;

C.2 SQL Scripts for the GLOBALX Star Schema

Example C-4 shows the SQL script used to create the empty GLOBALX tables.

Example C-4 Script for Creating the Empty GLOBALX Tables

CREATE TABLE GLOBALX.CHANNEL_DUMMY
   (CHANNEL_ID            NUMBER(5),
    CHANNEL_DSC           VARCHAR2(15),
    ALL_CHANNELS_ID       NUMBER(5),
    ALL_CHANNELS_DSC      VARCHAR2(15),
    CONSTRAINT UK_ON_CHANNEL_ID PRIMARY KEY(CHANNEL_ID));   
 
CREATE TABLE GLOBALX.CUSTOM_DUMMY
   (SHIP_TO_ID            NUMBER(5),
    SHIP_TO_DSC           VARCHAR2(30),
    ACCOUNT_ID            NUMBER(5),
    ACCOUNT_DSC           VARCHAR2(30),
    MARKET_SEGMENT_ID     NUMBER(5),
    MARKET_SEGMENT_DSC    VARCHAR2(15),
    TOTAL_MARKET_ID       NUMBER(5),
    TOTAL_MARKET_DSC      VARCHAR2(15),
    WAREHOUSE_ID          NUMBER(5),
    WAREHOUSE_DSC         VARCHAR2(15),
    REGION_ID             NUMBER(5),
    REGION_DSC            VARCHAR(15),
    ALL_CUSTOMERS_ID      NUMBER(5),
    ALL_CUSTOMERS_DSC     VARCHAR2(15),
    CONSTRAINT UK_ON_SHIP_TO_ID PRIMARY KEY(SHIP_TO_ID));
    
CREATE TABLE GLOBALX.PROD_DUMMY
   (ITEM_ID               NUMBER(5),
    ITEM_DSC              VARCHAR2(31),
    ITEM_PACKAGE_ID       VARCHAR2(20),
    FAMILY_ID             NUMBER(5),
    FAMILY_DSC            VARCHAR2(20),
    CLASS_ID              NUMBER(5),
    CLASS_DSC             VARCHAR2(15),
    TOTAL_PRODUCT_ID      NUMBER(5),
    TOTAL_PRODUCT_DSC     VARCHAR2(15),
    CONSTRAINT UK_ON_ITEM_ID PRIMARY KEY(ITEM_ID));
    
CREATE TABLE GLOBALX.TIME_DUMMY
   (MONTH_ID              NUMBER(5),
    MONTH_DSC             VARCHAR2(10),
    QUARTER_ID            NUMBER(5),
    QUARTER_DSC           VARCHAR2(5),
    YEAR_ID               NUMBER(5),
    YEAR_DSC              VARCHAR2(5),
    MONTH_TIMESPAN        NUMBER(5),
    QUARTER_TIMESPAN      NUMBER(5),
    YEAR_TIMESPAN         NUMBER(5),
    MONTH_END_DATE        DATE,
    QUARTER_END_DATE      DATE,
    YEAR_END_DATE         DATE,
    CONSTRAINT UK_ON_MONTH_ID PRIMARY KEY(MONTH_ID));
 
CREATE TABLE GLOBALX.PRICE_AND_COST_DUMMY
   (ITEM_ID               NUMBER(5),
    MONTH_ID              NUMBER(5),
    UNIT_PRICE            NUMBER,
    UNIT_COST             NUMBER,
    CONSTRAINT FK_ON_ITEM_ID_01 FOREIGN KEY (ITEM_ID)
       REFERENCES PROD_DUMMY(ITEM_ID),
    CONSTRAINT FK_ON_MONTH_ID_01 FOREIGN KEY (MONTH_ID)
       REFERENCES TIME_DUMMY(MONTH_ID));   
 
CREATE TABLE GLOBALX.UNITS_DUMMY
   (CHANNEL_ID            NUMBER(5),
    ITEM_ID               NUMBER(5),
    SHIP_TO_ID            NUMBER(5),
    MONTH_ID              NUMBER(5),
    UNITS                 NUMBER,
    CONSTRAINT FK_ON_CHANNEL_ID_02 FOREIGN KEY (CHANNEL_ID)
       REFERENCES CHANNEL_DUMMY(CHANNEL_ID),
    CONSTRAINT FK_ON_ITEM_ID_02 FOREIGN KEY (ITEM_ID)
       REFERENCES PROD_DUMMY(ITEM_ID),
    CONSTRAINT FK_ON_SHIP_TO_ID_02 FOREIGN KEY (SHIP_TO_ID)
       REFERENCES CUSTOM_DUMMY(SHIP_TO_ID),
    CONSTRAINT FK_ON_MONTH_ID_02 FOREIGN KEY (MONTH_ID)
       REFERENCES TIME_DUMMY(MONTH_ID));

C.3 SQL Scripts for OLAP Catalog Metadata

Example C-5 through Example C-10 are the scripts that define OLAP Catalog metadata for the GLOBALX star schema. This metadata enables the Create Analytic Workspace wizard to define a database standard form analytic workspace.

Example C-5 Script for Creating CHANNEL Metadata

EXECUTE CWM2_OLAP_DIMENSION.DROP_DIMENSION('GLOBALX','CHANNEL');
EXECUTE CWM2_OLAP_DIMENSION.CREATE_DIMENSION('GLOBALX','CHANNEL','Channel','CHANNEL',
   'Channel','Channel',NULL);
EXECUTE cwm2_olap_dimension_attribute.create_dimension_attribute_2('GLOBALX','CHANNEL',
   'Long Description','Long Description','Long Description','Long Description',1);
EXECUTE cwm2_olap_dimension_attribute.create_dimension_attribute_2('GLOBALX','CHANNEL',
   'Short Description','Short Description','Short Description','Short Description',1);
EXECUTE cwm2_olap_hierarchy.create_hierarchy('GLOBALX','CHANNEL','CHANNEL_ROLLUP',
   'Channel Rollup','Channel Rollup','Channel Rollup','UNSOLVED LEVEL-BASED');
EXECUTE cwm2_olap_dimension.set_default_display_hierarchy('GLOBALX','CHANNEL',
   CHANNEL_ROLLUP');
EXECUTE cwm2_olap_level.create_level('GLOBALX','CHANNEL','ALL_CHANNELS','All Channels',
   'All Channels','All Channels','All Channels');
EXECUTE cwm2_olap_level.create_level('GLOBALX','CHANNEL','CHANNEL','Channel','Channel',
   'Channel','Channel');
EXECUTE cwm2_olap_level.add_level_to_hierarchy('GLOBALX','CHANNEL','CHANNEL_ROLLUP',
   'ALL_CHANNELS',NULL);
EXECUTE cwm2_olap_level.add_level_to_hierarchy('GLOBALX','CHANNEL','CHANNEL_ROLLUP',
   'CHANNEL', 'ALL_CHANNELS');
EXECUTE cwm2_olap_level_attribute.create_level_attribute_2('GLOBALX','CHANNEL',
   'Long Description','ALL_CHANNELS','Long Description','Long Description',
   'Long Description','Long Description',1);
EXECUTE cwm2_olap_level_attribute.create_level_attribute_2('GLOBALX','CHANNEL',
   'Long Description','CHANNEL','Long Description','Long Description','Long Description',
   'Long Description',1);
EXECUTE cwm2_olap_level_attribute.create_level_attribute_2('GLOBALX','CHANNEL',
   'Short Description','ALL_CHANNELS','Short Description','Short Description',
   'Short Description','Short Description',1);
EXECUTE cwm2_olap_level_attribute.create_level_attribute_2('GLOBALX','CHANNEL',
   'Short Description','CHANNEL','Short Description','Short Description',
   'Short Description','Short Description',1);
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVEL('GLOBALX','CHANNEL','CHANNEL_ROLLUP',
   'ALL_CHANNELS','GLOBALX','CHANNEL_DUMMY','ALL_CHANNELS_ID',NULL);
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVEL('GLOBALX','CHANNEL','CHANNEL_ROLLUP',
   'CHANNEL','GLOBALX','CHANNEL_DUMMY','CHANNEL_ID','ALL_CHANNELS_ID');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVELATTR('GLOBALX','CHANNEL',
   'Long Description','CHANNEL_ROLLUP','CHANNEL','Long Description','GLOBALX',
   'CHANNEL_DUMMY','CHANNEL_DSC');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVELATTR('GLOBALX','CHANNEL','Long Description',
   'CHANNEL_ROLLUP','ALL_CHANNELS','Long Description','GLOBALX', 'CHANNEL_DUMMY',
   'ALL_CHANNELS_DSC');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVELATTR('GLOBALX','CHANNEL','Short Description',
   'CHANNEL_ROLLUP','CHANNEL','Short Description','GLOBALX', 'CHANNEL_DUMMY','CHANNEL_DSC');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVELATTR('GLOBALX','CHANNEL','Short Description',
   'CHANNEL_ROLLUP','ALL_CHANNELS','Short Description', 'GLOBALX','CHANNEL_DUMMY',
   'ALL_CHANNELS_DSC');
EXECUTE cwm2_olap_validate.validate_dimension('GLOBALX', 'CHANNEL');

Example C-6 Script for Creating CUSTOMER Metadata

EXECUTE CWM2_OLAP_DIMENSION.DROP_DIMENSION('GLOBALX','CUSTOMER');
EXECUTE CWM2_OLAP_DIMENSION.CREATE_DIMENSION('GLOBALX','CUSTOMER','Customer','CUSTOMER',
   'Customer','Customer',NULL);
EXECUTE cwm2_olap_dimension_attribute.create_dimension_attribute_2('GLOBALX','CUSTOMER',
   'Long Description','Long Description','Long Description','Long Description',1);
EXECUTE cwm2_olap_dimension_attribute.create_dimension_attribute_2('GLOBALX','CUSTOMER',
   'Short Description','Short Description','Short Description','Short Description',1);
EXECUTE cwm2_olap_hierarchy.create_hierarchy('GLOBALX','CUSTOMER','MARKET_ROLLUP',
   'Market Rollup','Market Rollup','Market Rollup','UNSOLVED LEVEL-BASED');
EXECUTE cwm2_olap_hierarchy.create_hierarchy('GLOBALX','CUSTOMER','SHIPMENTS_ROLLUP',
   'Shipments Rollup','Shipments Rollup','Shipments Rollup','UNSOLVED LEVEL-BASED');
EXECUTE cwm2_olap_dimension.set_default_display_hierarchy('GLOBALX', 'CUSTOMER',
   'SHIPMENTS_ROLLUP');
EXECUTE cwm2_olap_level.create_level('GLOBALX','CUSTOMER','ALL_CUSTOMERS','All Customers',
   'All Customers','All Customers','All Customers');
EXECUTE cwm2_olap_level.create_level('GLOBALX','CUSTOMER','REGION','Region', 'Region','Region',
   'Region');
EXECUTE cwm2_olap_level.create_level('GLOBALX','CUSTOMER','WAREHOUSE', 'Warehouse','Warehouse',
   'Warehouse','Warehouse');
EXECUTE cwm2_olap_level.create_level('GLOBALX','CUSTOMER','TOTAL_MARKET','Total Market',
   'Total Market','Total Market','Total Market');
EXECUTE cwm2_olap_level.create_level('GLOBALX','CUSTOMER','MARKET_SEGMENT','Market Segment',
   'Market Segment','Market Segment','Market Segment');
EXECUTE cwm2_olap_level.create_level('GLOBALX','CUSTOMER','ACCOUNT', 'Account','Account',
   'Account','Account');
EXECUTE cwm2_olap_level.create_level('GLOBALX','CUSTOMER','SHIP_TO','Ship To','Ship To',
   'Ship To','Ship To');
EXECUTE cwm2_olap_level.add_level_to_hierarchy('GLOBALX','CUSTOMER', 'MARKET_ROLLUP',
   'TOTAL_MARKET',NULL);
EXECUTE cwm2_olap_level.add_level_to_hierarchy('GLOBALX','CUSTOMER', 'MARKET_ROLLUP',
   'MARKET_SEGMENT','TOTAL_MARKET');
EXECUTE cwm2_olap_level.add_level_to_hierarchy('GLOBALX','CUSTOMER','MARKET_ROLLUP',
   'ACCOUNT','MARKET_SEGMENT');
EXECUTE cwm2_olap_level.add_level_to_hierarchy('GLOBALX','CUSTOMER','MARKET_ROLLUP',
   'SHIP_TO','ACCOUNT');
EXECUTE cwm2_olap_level.add_level_to_hierarchy('GLOBALX','CUSTOMER','SHIPMENTS_ROLLUP',
   'ALL_CUSTOMERS',NULL);
EXECUTE cwm2_olap_level.add_level_to_hierarchy('GLOBALX','CUSTOMER','SHIPMENTS_ROLLUP',
   'REGION','ALL_CUSTOMERS');
EXECUTE cwm2_olap_level.add_level_to_hierarchy('GLOBALX','CUSTOMER','SHIPMENTS_ROLLUP',
   'WAREHOUSE','REGION');
EXECUTE cwm2_olap_level.add_level_to_hierarchy('GLOBALX','CUSTOMER','SHIPMENTS_ROLLUP',
   'SHIP_TO','WAREHOUSE');
EXECUTE cwm2_olap_level_attribute.create_level_attribute_2('GLOBALX','CUSTOMER',
   'Long Description','ALL_CUSTOMERS','Long Description','Long Description',
   'Long Description','Long Description',1);
EXECUTE cwm2_olap_level_attribute.create_level_attribute_2('GLOBALX','CUSTOMER',
   'Long Description','REGION','Long Description','Long Description','Long Description',
   'Long Description',1);
EXECUTE cwm2_olap_level_attribute.create_level_attribute_2('GLOBALX','CUSTOMER',
   'Long Description','WAREHOUSE','Long Description','Long Description','Long Description',
   'Long Description',1);
EXECUTE cwm2_olap_level_attribute.create_level_attribute_2('GLOBALX','CUSTOMER',
   'Long Description','TOTAL_MARKET','Long Description','Long Description','Long Description',
   'Long Description',1);
EXECUTE cwm2_olap_level_attribute.create_level_attribute_2('GLOBALX','CUSTOMER',
   'Long Description','MARKET_SEGMENT','Long Description','Long Description',
   'Long Description','Long Description',1) ;
EXECUTE cwm2_olap_level_attribute.create_level_attribute_2('GLOBALX','CUSTOMER',
   'Long Description','ACCOUNT','Long Description','Long Description','Long Description',
   'Long Description',1);
EXECUTE cwm2_olap_level_attribute.create_level_attribute_2('GLOBALX','CUSTOMER',
   'Long Description','SHIP_TO','Long Description','Long Description','Long Description',
   'Long Description',1);
EXECUTE cwm2_olap_level_attribute.create_level_attribute_2('GLOBALX','CUSTOMER',
   'Short Description','ALL_CUSTOMERS','Short Description','Short Description',
   'Short Description','Short Description',1);
EXECUTE cwm2_olap_level_attribute.create_level_attribute_2('GLOBALX','CUSTOMER',
   'Short Description','REGION','Short Description','Short Description','Short Description',
   'Short Description',1);
EXECUTE cwm2_olap_level_attribute.create_level_attribute_2('GLOBALX','CUSTOMER',
   'Short Description','WAREHOUSE','Short Description','Short Description','Short Description',
   'Short Description',1);
EXECUTE cwm2_olap_level_attribute.create_level_attribute_2('GLOBALX','CUSTOMER',
   'Short Description','TOTAL_MARKET','Short Description','Short Description',
   'Short Description','Short Description',1);
EXECUTE cwm2_olap_level_attribute.create_level_attribute_2('GLOBALX','CUSTOMER',
   'Short Description','MARKET_SEGMENT','Short Description','Short Description',
   'Short Description','Short Description',1);
EXECUTE cwm2_olap_level_attribute.create_level_attribute_2('GLOBALX','CUSTOMER',
   'Short Description','ACCOUNT','Short Description','Short Description',
   'Short Description','Short Description',1);
EXECUTE cwm2_olap_level_attribute.create_level_attribute_2('GLOBALX','CUSTOMER',
   'Short Description','SHIP_TO','Short Description','Short Description','Short Description',
   'Short Description',1);
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVEL('GLOBALX','CUSTOMER','MARKET_ROLLUP',
   'TOTAL_MARKET','GLOBALX','CUSTOM_DUMMY','ALL_CUSTOMERS_ID',NULL);
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVEL('GLOBALX','CUSTOMER','MARKET_ROLLUP',
   'MARKET_SEGMENT','GLOBALX','CUSTOM_DUMMY','MARKET_SEGMENT_ID','ALL_CUSTOMERS_ID');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVEL('GLOBALX','CUSTOMER','MARKET_ROLLUP',
   'ACCOUNT','GLOBALX','CUSTOM_DUMMY','ACCOUNT_ID','MARKET_SEGMENT_ID');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVEL('GLOBALX','CUSTOMER','MARKET_ROLLUP',
   'SHIP_TO','GLOBALX','CUSTOM_DUMMY','SHIP_TO_ID','ACCOUNT_ID');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVEL('GLOBALX','CUSTOMER','SHIPMENTS_ROLLUP',
   'ALL_CUSTOMERS','GLOBALX','CUSTOM_DUMMY','ALL_CUSTOMERS_ID',NULL);
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVEL('GLOBALX','CUSTOMER','SHIPMENTS_ROLLUP',
   'REGION','GLOBALX','CUSTOM_DUMMY','REGION_ID','ALL_CUSTOMERS_ID');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVEL('GLOBALX','CUSTOMER','SHIPMENTS_ROLLUP',
   'WAREHOUSE','GLOBALX','CUSTOM_DUMMY','WAREHOUSE_ID','REGION_ID');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVEL('GLOBALX','CUSTOMER','SHIPMENTS_ROLLUP',
   'SHIP_TO','GLOBALX','CUSTOM_DUMMY','SHIP_TO_ID','WAREHOUSE_ID');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVELATTR('GLOBALX','CUSTOMER','Long Description',
   'MARKET_ROLLUP','SHIP_TO','Long Description','GLOBALX', 'CUSTOM_DUMMY','SHIP_TO_DSC');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVELATTR('GLOBALX','CUSTOMER','Long Description',
   'MARKET_ROLLUP','ACCOUNT','Long Description','GLOBALX', 'CUSTOM_DUMMY','ACCOUNT_DSC');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVELATTR('GLOBALX','CUSTOMER','Long Description',
   'MARKET_ROLLUP','MARKET_SEGMENT','Long Description','GLOBALX', 'CUSTOM_DUMMY',
   'MARKET_SEGMENT_DSC');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVELATTR('GLOBALX','CUSTOMER','Long Description',
   'MARKET_ROLLUP','TOTAL_MARKET','Long Description','GLOBALX','CUSTOM_DUMMY',
   'TOTAL_MARKET_DSC');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVELATTR('GLOBALX','CUSTOMER','Long Description',
   'SHIPMENTS_ROLLUP','SHIP_TO','Long Description','GLOBALX', 'CUSTOM_DUMMY','SHIP_TO_DSC');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVELATTR('GLOBALX','CUSTOMER','Long Description',
   'SHIPMENTS_ROLLUP','WAREHOUSE','Long Description','GLOBALX', 'CUSTOM_DUMMY',
   'WAREHOUSE_DSC');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVELATTR('GLOBALX','CUSTOMER','Long Description',
   'SHIPMENTS_ROLLUP','REGION','Long Description','GLOBALX', 'CUSTOM_DUMMY','REGION_DSC');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVELATTR('GLOBALX','CUSTOMER','Long Description',
   'SHIPMENTS_ROLLUP','ALL_CUSTOMERS','Long Description','GLOBALX', 'CUSTOM_DUMMY',
   'ALL_CUSTOMERS_DSC');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVELATTR('GLOBALX','CUSTOMER','Short Description',
   'MARKET_ROLLUP','SHIP_TO','Short Description','GLOBALX', 'CUSTOM_DUMMY','SHIP_TO_DSC');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVELATTR('GLOBALX','CUSTOMER','Short Description',
   'MARKET_ROLLUP','ACCOUNT','Short Description','GLOBALX', 'CUSTOM_DUMMY','ACCOUNT_DSC');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVELATTR('GLOBALX','CUSTOMER',
   'Short Description','MARKET_ROLLUP','MARKET_SEGMENT','Short Description','GLOBALX',
   'CUSTOM_DUMMY','MARKET_SEGMENT_DSC');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVELATTR('GLOBALX','CUSTOMER',
   'Short Description','MARKET_ROLLUP','TOTAL_MARKET','Short Description','GLOBALX',
   'CUSTOM_DUMMY','TOTAL_MARKET_DSC');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVELATTR('GLOBALX','CUSTOMER',
   'Short Description','SHIPMENTS_ROLLUP','SHIP_TO','Short Description','GLOBALX',
   'CUSTOM_DUMMY','SHIP_TO_DSC');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVELATTR('GLOBALX','CUSTOMER',
   'Short Description','SHIPMENTS_ROLLUP','WAREHOUSE','Short Description','GLOBALX',
   'CUSTOM_DUMMY','WAREHOUSE_DSC');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVELATTR('GLOBALX','CUSTOMER',
   'Short Description','SHIPMENTS_ROLLUP','REGION','Short Description','GLOBALX',
   'CUSTOM_DUMMY','REGION_DSC');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVELATTR('GLOBALX','CUSTOMER',
   'Short Description','SHIPMENTS_ROLLUP','ALL_CUSTOMERS','Short Description','GLOBALX',
   'CUSTOM_DUMMY','ALL_CUSTOMERS_DSC');
EXECUTE cwm2_olap_validate.validate_dimension('GLOBALX', 'CUSTOMER');

Example C-7 Script for Creating PRODUCT Metadata

EXECUTE CWM2_OLAP_DIMENSION.DROP_DIMENSION('GLOBALX','PRODUCT');
EXECUTE CWM2_OLAP_DIMENSION.CREATE_DIMENSION('GLOBALX','PRODUCT','Product','PRODUCT',
   'Product','Product',NULL);
EXECUTE cwm2_olap_dimension_attribute.create_dimension_attribute_2('GLOBALX','PRODUCT',
   'Long Description','Long Description','Long Description','Long Description',1);
EXECUTE cwm2_olap_dimension_attribute.create_dimension_attribute_2('GLOBALX','PRODUCT',
   'Short Description','Short Description','Short Description','Short Description',1);
EXECUTE cwm2_olap_dimension_attribute.create_dimension_attribute_2('GLOBALX',
   'PRODUCT','Package', 'Package','Package','Package',0);
EXECUTE cwm2_olap_hierarchy.create_hierarchy('GLOBALX','PRODUCT','PRODUCT_ROLLUP',
   'Product Rollup','Product Rollup','Product Rollup','UNSOLVED LEVEL-BASED');
EXECUTE cwm2_olap_dimension.set_default_display_hierarchy('GLOBALX','PRODUCT',
   'PRODUCT_ROLLUP');
EXECUTE cwm2_olap_level.create_level('GLOBALX','PRODUCT','TOTAL_PRODUCT','Total Product',
   'Total Product','Total Product','Total Product');
EXECUTE cwm2_olap_level.create_level('GLOBALX','PRODUCT','CLASS', 'Class','Class',
   'Class','Class');
EXECUTE cwm2_olap_level.create_level('GLOBALX','PRODUCT','FAMILY', 'Family','Family',
   'Family','Family');
EXECUTE cwm2_olap_level.create_level('GLOBALX','PRODUCT','ITEM','Item','Item','Item','Item');
EXECUTE cwm2_olap_level.add_level_to_hierarchy('GLOBALX','PRODUCT','PRODUCT_ROLLUP',
   'TOTAL_PRODUCT',NULL);
EXECUTE cwm2_olap_level.add_level_to_hierarchy('GLOBALX','PRODUCT','PRODUCT_ROLLUP',
   'CLASS','TOTAL_PRODUCT');
EXECUTE cwm2_olap_level.add_level_to_hierarchy('GLOBALX','PRODUCT','PRODUCT_ROLLUP',
   'FAMILY','CLASS');
EXECUTE cwm2_olap_level.add_level_to_hierarchy('GLOBALX','PRODUCT','PRODUCT_ROLLUP',
   'ITEM','FAMILY');
EXECUTE cwm2_olap_level_attribute.create_level_attribute_2('GLOBALX','PRODUCT',
   'Long Description','TOTAL_PRODUCT','Long Description','Long Description',
   'Long Description','Long Description',1);
EXECUTE cwm2_olap_level_attribute.create_level_attribute_2('GLOBALX','PRODUCT',
   'Long Description','CLASS','Long Description','Long Description','Long Description',
   'Long Description',1);
EXECUTE cwm2_olap_level_attribute.create_level_attribute_2('GLOBALX','PRODUCT',
   'Long Description','FAMILY','Long Description','Long Description','Long Description',
   'Long Description',1);
EXECUTE cwm2_olap_level_attribute.create_level_attribute_2('GLOBALX','PRODUCT',
   'Long Description','ITEM','Long Description','Long Description','Long Description',
   'Long Description',1);
EXECUTE cwm2_olap_level_attribute.create_level_attribute_2('GLOBALX','PRODUCT',
   'Short Description','TOTAL_PRODUCT','Short Description','Short Description',
   'Short Description','Short Description',1);
EXECUTE cwm2_olap_level_attribute.create_level_attribute_2('GLOBALX','PRODUCT',
   'Short Description','CLASS','Short Description','Short Description','Short Description',
   'Short Description',1);
EXECUTE cwm2_olap_level_attribute.create_level_attribute_2('GLOBALX','PRODUCT',
   'Short Description','FAMILY','Short Description','Short Description','Short Description',
   'Short Description',1);
EXECUTE cwm2_olap_level_attribute.create_level_attribute_2('GLOBALX','PRODUCT',
   'Short Description','ITEM','Short Description','Short Description','Short Description',
   'Short Description',1);
EXECUTE cwm2_olap_level_attribute.create_level_attribute_2('GLOBALX','PRODUCT', 'Package',
   'ITEM','Package','Package','Package','Package',0);
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVEL('GLOBALX','PRODUCT','PRODUCT_ROLLUP',
   'TOTAL_PRODUCT','GLOBALX','PROD_DUMMY','TOTAL_PRODUCT_ID',NULL);
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVEL('GLOBALX','PRODUCT', 'PRODUCT_ROLLUP','CLASS',
   'GLOBALX','PROD_DUMMY','CLASS_ID','TOTAL_PRODUCT_ID');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVEL('GLOBALX','PRODUCT', 'PRODUCT_ROLLUP',
   'FAMILY', 'GLOBALX','PROD_DUMMY','FAMILY_ID','CLASS_ID');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVEL('GLOBALX','PRODUCT','PRODUCT_ROLLUP',
   'ITEM','GLOBALX','PROD_DUMMY','ITEM_ID','FAMILY_ID');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVELATTR('GLOBALX','PRODUCT','Long Description',
   'PRODUCT_ROLLUP','ITEM','Long Description','GLOBALX','PROD_DUMMY','ITEM_DSC');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVELATTR('GLOBALX','PRODUCT','Long Description',
   'PRODUCT_ROLLUP','FAMILY','Long Description','GLOBALX','PROD_DUMMY','FAMILY_DSC');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVELATTR('GLOBALX','PRODUCT',
   'Long Description','PRODUCT_ROLLUP','CLASS','Long Description','GLOBALX',
   'PROD_DUMMY','CLASS_DSC');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVELATTR('GLOBALX','PRODUCT','Long Description',
   'PRODUCT_ROLLUP','TOTAL_PRODUCT','Long Description','GLOBALX', 'PROD_DUMMY',
   'TOTAL_PRODUCT_DSC');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVELATTR('GLOBALX','PRODUCT','Short Description',
   'PRODUCT_ROLLUP','ITEM','Short Description','GLOBALX','PROD_DUMMY','ITEM_DSC');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVELATTR('GLOBALX','PRODUCT','Short Description',
   'PRODUCT_ROLLUP','FAMILY','Short Description','GLOBALX','PROD_DUMMY','FAMILY_DSC');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVELATTR('GLOBALX','PRODUCT','Short Description',
   'PRODUCT_ROLLUP','CLASS','Short Description','GLOBALX','PROD_DUMMY','CLASS_DSC');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVELATTR('GLOBALX','PRODUCT','Short Description',
   'PRODUCT_ROLLUP','TOTAL_PRODUCT','Short Description','GLOBALX','PROD_DUMMY',
   'TOTAL_PRODUCT_DSC');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVELATTR('GLOBALX','PRODUCT', 'Package',
   'PRODUCT_ROLLUP','ITEM','Package','GLOBALX','PROD_DUMMY','ITEM_PACKAGE_ID');
EXECUTE cwm2_olap_validate.validate_dimension('GLOBALX', 'PRODUCT');

Example C-8 Script for Creating TIME Metadata

EXECUTE CWM2_OLAP_DIMENSION.DROP_DIMENSION('GLOBALX','TIME');
EXECUTE CWM2_OLAP_DIMENSION.CREATE_DIMENSION('GLOBALX','TIME','Time', 'TIME','Time',
   'Time','Time');
EXECUTE cwm2_olap_dimension_attribute.create_dimension_attribute_2('GLOBALX','TIME',
   'Long Description','Long Description','Long Description','Long Description',1);
EXECUTE cwm2_olap_dimension_attribute.create_dimension_attribute_2('GLOBALX','TIME',
   'Short Description','Short Description','Short Description','Short Description',1);
EXECUTE cwm2_olap_dimension_attribute.create_dimension_attribute_2('GLOBALX','TIME',
   'End Date','End Date','End Date','End Date',1);
EXECUTE cwm2_olap_dimension_attribute.create_dimension_attribute_2('GLOBALX','TIME',
   'Time Span','Timespan','Timespan','Timespan',1);
EXECUTE cwm2_olap_hierarchy.create_hierarchy('GLOBALX','TIME','CALENDAR', 'Calendar',
   'Calendar','Calendar','UNSOLVED LEVEL-BASED');
EXECUTE cwm2_olap_dimension.set_default_display_hierarchy('GLOBALX','TIME','CALENDAR');
EXECUTE cwm2_olap_level.create_level('GLOBALX','TIME','YEAR','Year','Year','Year','Year');
EXECUTE cwm2_olap_level.create_level('GLOBALX','TIME','QUARTER', 'Quarter','Quarter',
   'Quarter','Quarter');
EXECUTE cwm2_olap_level.create_level('GLOBALX','TIME','MONTH','Month','Month','Month','Month');
EXECUTE cwm2_olap_level.add_level_to_hierarchy('GLOBALX','TIME','CALENDAR','YEAR',NULL);
EXECUTE cwm2_olap_level.add_level_to_hierarchy('GLOBALX','TIME','CALENDAR','QUARTER','YEAR');
EXECUTE cwm2_olap_level.add_level_to_hierarchy('GLOBALX','TIME','CALENDAR','MONTH','QUARTER');
EXECUTE cwm2_olap_level_attribute.create_level_attribute_2('GLOBALX','TIME','Long Description',
   'YEAR','Long Description','Long Description','Long Description','Long Description',1);
EXECUTE cwm2_olap_level_attribute.create_level_attribute_2('GLOBALX','TIME','Long Description',
   'QUARTER','Long Description','Long Description','Long Description','Long Description',1);
EXECUTE cwm2_olap_level_attribute.create_level_attribute_2('GLOBALX','TIME','Long Description', 
   'MONTH','Long Description','Long Description','Long Description','Long Description',1);
EXECUTE cwm2_olap_level_attribute.create_level_attribute_2('GLOBALX','TIME','Short Description', 
   'YEAR','Short Description','Short Description','Short Description','Short Description',1);
EXECUTE cwm2_olap_level_attribute.create_level_attribute_2('GLOBALX','TIME','Short Description', 
   'QUARTER','Short Description','Short Description','Short Description','Short Description',1); 
EXECUTE cwm2_olap_level_attribute.create_level_attribute_2('GLOBALX','TIME','Short Description',
   'MONTH','Short Description','Short Description','Short Description','Short Description',1);
EXECUTE cwm2_olap_level_attribute.create_level_attribute_2('GLOBALX','TIME','End Date','YEAR',
   'End Date','End Date','End Date','End Date',1);
EXECUTE cwm2_olap_level_attribute.create_level_attribute_2('GLOBALX','TIME','End Date','QUARTER',
   'End Date','End Date','End Date','End Date',1);
EXECUTE cwm2_olap_level_attribute.create_level_attribute_2('GLOBALX','TIME','End Date','MONTH',
   'End Date','End Date','End Date','End Date',1);
EXECUTE cwm2_olap_level_attribute.create_level_attribute_2('GLOBALX','TIME','Time Span','YEAR',
   'Time Span','Timespan','Timespan','Timespan',1);
EXECUTE cwm2_olap_level_attribute.create_level_attribute_2('GLOBALX','TIME','Time Span',
   'QUARTER','Time Span','Timespan','Timespan','Timespan',1);
EXECUTE cwm2_olap_level_attribute.create_level_attribute_2('GLOBALX','TIME','Time Span','MONTH',
   'Time Span','Timespan','Timespan','Timespan',1);
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVEL('GLOBALX','TIME','CALENDAR', 'YEAR','GLOBALX',
   'TIME_DUMMY','YEAR_ID',NULL);
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVEL('GLOBALX','TIME','CALENDAR', 'QUARTER',
   'GLOBALX','TIME_DUMMY','QUARTER_ID','YEAR_ID');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVEL('GLOBALX','TIME','CALENDAR', 'MONTH','GLOBALX',
   'TIME_DUMMY','MONTH_ID','QUARTER_ID');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVELATTR('GLOBALX','TIME','Long Description',
   'CALENDAR','MONTH','Long Description','GLOBALX','TIME_DUMMY','MONTH_DSC');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVELATTR('GLOBALX','TIME','Long Description',
   'CALENDAR','QUARTER','Long Description','GLOBALX','TIME_DUMMY','QUARTER_DSC');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVELATTR('GLOBALX','TIME','Long Description',
   'CALENDAR','YEAR','Long Description','GLOBALX','TIME_DUMMY','YEAR_DSC');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVELATTR('GLOBALX','TIME','Short Description',
   'CALENDAR','MONTH','Short Description','GLOBALX','TIME_DUMMY','MONTH_DSC');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVELATTR('GLOBALX','TIME','Short Description',
   'CALENDAR','QUARTER','Short Description','GLOBALX','TIME_DUMMY','QUARTER_DSC');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVELATTR('GLOBALX','TIME','Short Description',
   'CALENDAR','YEAR','Short Description','GLOBALX','TIME_DUMMY','YEAR_DSC');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVELATTR('GLOBALX','TIME','End Date', 'CALENDAR',
   'MONTH','End Date','GLOBALX','TIME_DUMMY','MONTH_END_DATE');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVELATTR('GLOBALX','TIME','End Date', 'CALENDAR',
   'QUARTER','End Date','GLOBALX','TIME_DUMMY','QUARTER_END_DATE');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVELATTR('GLOBALX','TIME','End Date', 'CALENDAR',
   'YEAR','End Date','GLOBALX','TIME_DUMMY','YEAR_END_DATE');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVELATTR('GLOBALX','TIME','Time Span',
   'CALENDAR','MONTH','Time Span','GLOBALX','TIME_DUMMY','MONTH_TIMESPAN');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVELATTR('GLOBALX','TIME','Time Span',
   'CALENDAR','QUARTER','Time Span','GLOBALX','TIME_DUMMY','QUARTER_TIMESPAN');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_DIMTBL_HIERLEVELATTR('GLOBALX','TIME','Time Span',
   'CALENDAR','YEAR','Time Span','GLOBALX','TIME_DUMMY','YEAR_TIMESPAN');
EXECUTE cwm2_olap_validate.validate_dimension('GLOBALX', 'TIME');

Example C-9 Script for Creating UNITS Cube

EXECUTE CWM2_OLAP_CUBE.DROP_CUBE('GLOBALX','UNITS_CUBE');
EXECUTE CWM2_OLAP_CUBE.CREATE_CUBE('GLOBALX','UNITS_CUBE','UNITS CUBE','UNITS CUBE',
  'UNITS CUBE');
EXECUTE CWM2_OLAP_CUBE.ADD_DIMENSION_TO_CUBE('GLOBALX','UNITS_CUBE','GLOBALX','CHANNEL');
EXECUTE CWM2_OLAP_CUBE.ADD_DIMENSION_TO_CUBE('GLOBALX','UNITS_CUBE','GLOBALX','CUSTOMER');
EXECUTE CWM2_OLAP_CUBE.ADD_DIMENSION_TO_CUBE('GLOBALX','UNITS_CUBE','GLOBALX','PRODUCT');
EXECUTE CWM2_OLAP_CUBE.ADD_DIMENSION_TO_CUBE('GLOBALX','UNITS_CUBE','GLOBALX','TIME');
EXECUTE CWM2_OLAP_MEASURE.CREATE_MEASURE('GLOBALX','UNITS_CUBE','UNITS','UNITS','Units Sold',
   'Units Sold');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_FACTTBL_LEVELKEY('GLOBALX','UNITS_CUBE','GLOBALX','UNITS_DUMMY',
   'LOWESTLEVEL',
   'DIM:GLOBALX.CHANNEL/HIER:CHANNEL_ROLLUP/LVL:CHANNEL/COL:CHANNEL_ID;
    DIM:GLOBALX.CUSTOMER/HIER:MARKET_ROLLUP/LVL:SHIP_TO/COL:SHIP_TO_ID;
    DIM:GLOBALX.PRODUCT/HIER:PRODUCT_ROLLUP/LVL:ITEM/COL:ITEM_ID;
    DIM:GLOBALX.TIME/HIER:CALENDAR/LVL:MONTH/ COL:MONTH_ID;');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_FACTTBL_LEVELKEY('GLOBALX','UNITS_CUBE','GLOBALX',
   'UNITS_DUMMY','LOWESTLEVEL',
   'DIM:GLOBALX.CHANNEL/HIER:CHANNEL_ROLLUP/LVL:CHANNEL/COL:CHANNEL_ID;
    DIM:GLOBALX.CUSTOMER/HIER:SHIPMENTS_ROLLUP/LVL:SHIP_TO/COL:SHIP_TO_ID;
    DIM:GLOBALX.PRODUCT/HIER:PRODUCT_ROLLUP/LVL:ITEM/COL:ITEM_ID;
    DIM:GLOBALX.TIME/HIER:CALENDAR/LVL:MONTH/COL:MONTH_ID;');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_FACTTBL_MEASURE('GLOBALX','UNITS_CUBE','UNITS','GLOBALX',
   'UNITS_DUMMY','UNITS',
   'DIM:GLOBALX.CHANNEL/HIER:CHANNEL_ROLLUP/LVL:CHANNEL/COL:CHANNEL_ID;
    DIM:GLOBALX.CUSTOMER/HIER:MARKET_ROLLUP/LVL:SHIP_TO/COL:SHIP_TO_ID;
    DIM:GLOBALX.PRODUCT/HIER:PRODUCT_ROLLUP/LVL:ITEM/COL:ITEM_ID;
    DIM:GLOBALX.TIME/HIER:CALENDAR/LVL:MONTH/COL:MONTH_ID;');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_FACTTBL_MEASURE('GLOBALX','UNITS_CUBE','UNITS','GLOBALX',
   'UNITS_DUMMY','UNITS',
   'DIM:GLOBALX.CHANNEL/HIER:CHANNEL_ROLLUP/LVL:CHANNEL/COL:CHANNEL_ID;
    DIM:GLOBALX.CUSTOMER/HIER:SHIPMENTS_ROLLUP/LVL:SHIP_TO/COL:SHIP_TO_ID;
    DIM:GLOBALX.PRODUCT/HIER:PRODUCT_ROLLUP/LVL:ITEM/COL:ITEM_ID;
    DIM:GLOBALX.TIME/HIER:CALENDAR/LVL:MONTH/COL:MONTH_ID;');
EXECUTE cwm2_olap_validate.validate_Cube('GLOBALX', 'UNITS_CUBE');

Example C-10 Script for Create PRICE Cube

EXECUTE CWM2_OLAP_CUBE.DROP_CUBE('GLOBALX','PRICE_CUBE');
EXECUTE CWM2_OLAP_CUBE.CREATE_CUBE('GLOBALX','PRICE_CUBE','PRICE CUBE','PRICE CUBE',
   'PRICE CUBE');
EXECUTE CWM2_OLAP_CUBE.ADD_DIMENSION_TO_CUBE('GLOBALX','PRICE_CUBE','GLOBALX','TIME');
EXECUTE CWM2_OLAP_CUBE.ADD_DIMENSION_TO_CUBE('GLOBALX','PRICE_CUBE','GLOBALX','PRODUCT');
EXECUTE CWM2_OLAP_MEASURE.CREATE_MEASURE('GLOBALX','PRICE_CUBE','UNIT_COST','UNIT COST',
   'Unit Cost','Unit Cost');
EXECUTE CWM2_OLAP_MEASURE.CREATE_MEASURE('GLOBALX','PRICE_CUBE','UNIT_PRICE','UNIT PRICE',
   'Unit Price','Unit Price');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_FACTTBL_LEVELKEY('GLOBALX','PRICE_CUBE',
   'GLOBALX', 'PRICE_AND_COST_DUMMY','LOWESTLEVEL',
   'DIM:GLOBALX.PRODUCT/HIER:PRODUCT_ROLLUP/LVL:ITEM/COL:ITEM_ID;
    DIM:GLOBALX.TIME/HIER:CALENDAR/LVL:MONTH/COL:MONTH_ID;');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_FACTTBL_MEASURE('GLOBALX','PRICE_CUBE','UNIT_COST','GLOBALX',
   'PRICE_AND_COST_DUMMY','UNIT_COST',
   'DIM:GLOBALX.PRODUCT/HIER:PRODUCT_ROLLUP/LVL:ITEM/COL:ITEM_ID;
    DIM:GLOBALX.TIME/HIER:CALENDAR/LVL:MONTH/COL:MONTH_ID;');
EXECUTE CWM2_OLAP_TABLE_MAP.MAP_FACTTBL_MEASURE('GLOBALX','PRICE_CUBE','UNIT_PRICE','GLOBALX',
   'PRICE_AND_COST_DUMMY','UNIT_PRICE',
   'DIM:GLOBALX.PRODUCT/HIER:PRODUCT_ROLLUP/LVL:ITEM/COL:ITEM_ID;
    DIM:GLOBALX.TIME/HIER:CALENDAR/LVL:MONTH/COL:MONTH_ID;');
EXECUTE cwm2_olap_validate.validate_Cube('GLOBALX', 'PRICE_CUBE');