Extending the Data Warehouse Logical Schema
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.
- 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.
- 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.
- Create the classes. For details about this step, see Creating a New Class.
- Populate the classes with the appropriate data members. For details about this step, see Creating a New Class Data Member.
- If needed, explicitly create a key for the class. A class key can be implicitly created for a single member key. For details about this step, see Creating a New Class Key.
- If needed, explicitly create key members for the class. For details about this step, see Creating a New Class Key Member.
- 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.
- If needed, create data relation members between the classes. For details about this step, see Creating a New Class Relation Member.
- 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.
This section contains:
- Creating a New Class
- Creating a New Class Data Member
- Creating a New Class Key
- Creating a New Class Key Member
- Creating a New Class Relation
- Creating a New Class Relation Member
- Applying Filtering to a Class
- Creating Summarization Classes