Skip Headers

Oracle® OLAP Reference
10g Release 1 (10.1)

Part Number B10334-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

10 CWM2_OLAP_DIMENSION

The CWM2_OLAP_DIMENSION package provides procedures for managing dimensions.

This chapter discusses the following topics:

10.1 Understanding Dimensions

A dimension is an OLAP metadata entity. This means that it is a logical object, identified by name and owner, within the OLAP Catalog. Logical OLAP dimensions are fully described in .


Note:

Dimensions in CWM2 map directly to columns in dimension tables and have no relationship to Oracle database dimension objects.

Use the procedures in the CWM2_OLAP_DIMENSION package to create, drop, and lock CWM2 dimension entities and to specify descriptive information for display purposes. To fully define a CWM2 dimension, follow the steps listed in "Creating a Dimension".


See Also:

Oracle OLAP Application Developer's Guide for more information on dimensions and the OLAP metadata model.

10.2 Example: Creating a CWM2 Dimension

The following statement creates a CWM2 dimension entity, PRODUCT_DIM, in the JSMITH schema. The display name is Product, and the plural name is Products. The short description is Prod, and the description is Product.

execute cwm2_olap_dimension.create_dimension
     ('JSMITH', 'PRODUCT_DIM', 'Product', 'Products', 'Prod', 'Product');

The following statements change the short description to Product and the long description to Product Dimension.

execute cwm2_olap_dimension.set_short_description
     ('JSMITH', 'PRODUCT_DIM', 'Product');
execute cwm2_olap_dimension.set_description
     ('JSMITH', 'PRODUCT_DIM', 'Product Dimension');


Summary of CWM2_OLAP_DIMENSION Subprograms

Table 10-1 CWM2_OLAP_DIMENSION Subprograms

Subprogram Description
CREATE_DIMENSION Procedure
Creates a dimension.
DROP_DIMENSION Procedure
Drops a dimension.
LOCK_DIMENSION Procedure
Locks the dimension metadata for update.
SET_DEFAULT_DISPLAY_HIERARCHY Procedure
Sets the default hierarchy for a dimension.
SET_DESCRIPTION Procedure Sets the description for a dimension.
SET_DIMENSION_NAME Procedure
Sets the name of a dimension.
SET_DISPLAY_NAME Procedure Sets the display name for a dimension.
SET_PLURAL_NAME Procedure
Sets the plural name for a dimension.
SET_SHORT_DESCRIPTION Procedure
Sets the short description for a dimension.


CREATE_DIMENSION Procedure

This procedure creates a new dimension entity in the OLAP Catalog.

By default the new dimension is a normal dimension, but you can specify the value TIME for the dimension_type parameter to create a time dimension.

Descriptions and display properties must also be established as part of dimension creation. Once the dimension has been created, you can override these properties by calling other procedures in this package.

Syntax

CREATE_DIMENSION (
          dimension_owner       IN   VARCHAR2,
          dimension_name        IN   VARCHAR2,
          display_name          IN   VARCHAR2,
          plural_name           IN   VARCHAR2,
          short_description     IN   VARCHAR2,
          description           IN   VARCHAR2,
          dimension_type        IN   VARCHAR2 DEFAULT NULL);

Parameters

Table 10-2 CREATE_DIMENSION Procedure Parameters

Parameter Description
dimension_owner Owner of the dimension.
dimension_name Name of the dimension.
display_name Display name for the dimension.
plural_name Plural name for the dimension.
short_description Short description of the dimension.
description Description of the dimension.
dimension_type (Optional) Type of the dimension. Specify the value TIME to create a time dimension. If you do not specify this parameter, the dimension is created as a normal dimension.


DROP_DIMENSION Procedure

This procedure drops a dimension entity from the OLAP Catalog. All related levels, hierarchies, and dimension attributes are also dropped.

Syntax

DROP_DIMENSION (
         dimension_owner     IN   VARCHAR2,
         dimension_name      IN   VARCHAR2);

Parameters

Table 10-3 DROP_DIMENSION Procedure Parameters

Parameter Description
dimension_owner Owner of the dimension.
dimension_name Name of the dimension.


LOCK_DIMENSION Procedure

This procedure locks the dimension metadata for update by acquiring a database lock on the row that identifies the dimension in the CWM2 model table.

Syntax

LOCK_DIMENSION (
           dimension_owner     IN   VARCHAR2,
           dimension_name      IN   VARCHAR2.
           wait_for_lock       IN   BOOLEAN DEFAULT FALSE);

Parameters

Table 10-4 LOCK_DIMENSION Procedure Parameters

Parameter Description
dimension_owner Owner of the dimension.
dimension_name Name of the dimension.
wait_for_lock (Optional) Whether or not to wait for the dimension to be available when it is already locked by another user. If you do not specify a value for this parameter, the procedure does not wait to acquire the lock.


SET_DEFAULT_DISPLAY_HIERARCHY Procedure

This procedure sets the default hierarchy to be used for display purposes.

Syntax

SET_DEFAULT_DISPLAY_HIERARCHY  (
          dimension_owner     IN   VARCHAR2,
          dimension_name      IN   VARCHAR2,
          hierarchy_name      IN   VARCHAR2);

Parameters

Table 10-5 SET_DEFAULT_DISPLAY_HIERARCHY Procedure Parameters

Parameter Description
dimension_owner Owner of the dimension.
dimension_name Name of the dimension.
hierarchy_name Name of one of the dimension's hierarchies.


SET_DESCRIPTION Procedure

This procedure sets the description for a dimension.

Syntax

SET_DESCRIPTION (
          dimension_owner     IN   VARCHAR2,
          dimension_name      IN   VARCHAR2,
          description         IN   VARCHAR2);

Parameters

Table 10-6 SET_DESCRIPTION Procedure Parameters

Parameter Description
dimension_owner Owner of the dimension.
dimension_name Name of the dimension.
description Description of the dimension.


SET_DIMENSION_NAME Procedure

This procedure sets the name for a dimension.

Syntax

SET_DIMENSION_NAME (
          dimension_owner        IN   VARCHAR2,
          dimension_name         IN   VARCHAR2,
          set_dimension_name     IN   VARCHAR2);

Parameters

Table 10-7 SET_DIMENSION_NAME Procedure Parameters

Parameter Description
dimension_owner Owner of the dimension.
dimension_name Original name of the dimension.
set_dimension_name New name for the dimension.


SET_DISPLAY_NAME Procedure

This procedure sets the display name for a dimension.

Syntax

SET_DISPLAY_NAME (
          dimension_owner     IN   VARCHAR2,
          dimension_name      IN   VARCHAR2,
          display_name        IN   VARCHAR2);

Parameters

Table 10-8 SET_DISPLAY_NAME Procedure Parameters

Parameter Description
dimension_owner Owner of the dimension.
dimension_name Name of the dimension.
display_name Display name for the dimension.


SET_PLURAL_NAME Procedure

This procedure sets the plural name of a dimension.

Syntax

SET_PLURAL_NAME  (
          dimension_owner     IN   VARCHAR2,
          dimension_name      IN   VARCHAR2,
          plural_name         IN   VARCHAR2);

Parameters

Table 10-9 SET_PLURAL_NAME Procedure Parameters

Parameter Description
dimension_owner Owner of the dimension.
dimension_name Name of the dimension.
plural_name Plural name for the dimension.


SET_SHORT_DESCRIPTION Procedure

This procedure sets the short description for a dimension.

Syntax

SET_SHORT_DESCRIPTION (
          dimension_owner       IN   VARCHAR2,
          dimension_name        IN   VARCHAR2,
          short_description     IN   VARCHAR2);

Parameters

Table 10-10 SET_SHORT_DESCRIPTION Procedure Parameters

Parameter Description
dimension_owner Owner of the dimension.
dimension_name Name of the dimension.
short_description Short description of the dimension.