What We Learn
Deploying new content to an existing installation.
Scenario, Mapping And Modeling
A person’s email address as well as home phone number have suddenly become available in the PersMaster source system, and we want to add them to the DW. Changes will then need to happen in:
- the staging area table PersMaster.RAW_PERSON: the new columns (EMAIL, HOMEPHONE) must be made available to the hashing mechanism
- the Raw Model: the Person class must be extended with the new attributes
- the 01_Mappings_PersMaster.csv mapping file: the new columns need to be mapped to the new attributes
Start by adding the new attributes email : email and Home phone number : string to the Person class in your modeling tool and export the model to the working directory.
Refresh D♯ Engine. Your edited Person class should now look like this:
Open the PersMaster mapping file in D♯ Engine and drag the new columns and class attributes into it so that they are correctly aligned. Then…
…do this… | …and this will happen |
---|---|
In the mapping file, for Home phone number, in the Group column, write Phones. | Home phone number will be stored in a new satellite. |
Save the mapping file and refresh D♯ Engine in order to generate the solution.
Verify that these changes have also been applied to the Raw Vault structure by selecting the Person class in the Conceptual Model pane and then clicking the Table Structure button. The two satellites as well as the PIT table pictured below have been affected by the change.
Deploy the Changes
In the Conceptual Model pane, make a selection that contains the Person class to be installed and click the Package symbol in the pane’s toolbar. A Deployment package hierarchy will open, where you can preview the installation structure. The deployment package will perform an incremental installation of the selecton you made: nothing in the DW will be dropped, but new objects will be added and existing altered. In this case, the Raw Vault tables will be created or altered to look like in the image above, and other relevant changes in other objects (procedures, views) will also be made.
You can also immediately analyze the difference between the D# Engine model and the actual database with the Compare Model With DW-command: make a UI selection containing classes you are interested in and run the command. This will create a SQL query that compares the actual DW table structure to what the current D# Engine-generated structure would be.
Press the Deploy button in the Deployment package hierarchy pane to generate the SQL code for the deployment, and finally run it in SQL Server.
Run the tutorial command step.
Script | Source data | Main points of interest |
---|---|---|
Step 1: Load into new structure | The Staging Area can now receive email and phone number data. | The new columns have been added to the K_Person view, and hence also to the entire Raw Vault structure. |