Extending the Data Warehouse Logical Schema

Commerce Server 2002

This topic discusses extending the Commerce Server 2002 Data Warehouse logical schema. The architecture of the logical schema is governed by the Data Warehouse meta-model. Extending the logical schema requires detailed knowledge of the meta-model. For more information, see Data Warehouse Meta-model.

Note

The code provided in the following example is for demonstration purposes only. The OrderFormHeader class created in the example already exists in the Data Warehouse schema. The code provided in the following example requires schema change and commit schema commands to stand alone.

The CreateSchemaObject.vbs file included in the Commerce Server 2002 Software Development Kit should be used to automate the process of extending the schema. For more information about the script, see Create Schema Object Script.

Caution

Wherever possible, use existing Data Warehouse structures to store data. Deletion from the logical schema is not supported under this version of Commerce Server 2002.

The SQL script csdwschema.sql, found in the root installation directory of Commerce Server, creates the logical schema. This script must be run on an empty database. If the schema needs to be reinstalled, delete the previous database, create a new database, and re-run the script.

The distinct steps involved in extending the Data Warehouse are:

Connect to the Data Warehouse and turn on the schema change mode. Turning the schema change mode on denotes a schema change session. Changes to the schema are only allowed when in schema change mode, and the changes can only modify existing components of the schema; inserting data is not permitted. While in this mode, provider commands and URLs are accessible to alter the schema. The code to complete this step is located in Creating a New Class. For details about this step, see Schema Change.

If needed, create relations between the classes. If the new structure is to be linked to the existing logical schema, relations have to be created between the new classes and existing Data Warehouse classes. For details about this step, see Creating a New Class Relation.

The CommitSchema command persists the session changes to the actual schema tables, provided that all changes pass validation. This should be performed when all the individual schema change operations have been performed. This commits all pending schema changes to the persistent storage within SQL Server in a single transaction. For details about this step, see Commit.

A running example is provided to demonstrate these steps by using an existing Data Warehouse class. An existing class is used to provide insight into how the structure fits into the logical schema. The class to be created is the existing OrderFormHeader class. A purchase order is made up of the OrderFormHeader class, representing the information required by an organization to process the order, and the OrderFormLineItems class detailing the purchases. For simplicity, this example will ignore the detailed line items and concentrate on creating the OrderFormHeader class and linking the OrderFormHeader class to an existing OrderGroup class.

The example does not show error checking or certain other formalities required for functional code.

Following this example, the process of filtering and creating summarization tables is discussed.