Rebuilding the data warehouse from scratch

From time to time there can be a need to rebuild the analytics data warehouse from scratch. The most common need would be when you need to make a configuration change that fundamentally affects the way the existing data has been built. For example, change in the default country code, changing the data warehouse sales history to but based on financial data versus Activity, etc.

The procedure is as follows.

  1. From a SQL browser, select the Analytics data warehouse as your current database and run the following procedures:

    EXEC asi_DWSInitDB
    
    EXEC asi_DWSETLAll 1
  2. Rebuild the cubes

Once analytics has been established and running some time, one should avoid rebuilding the data warehouse from scratch, as some historical information can be lost. Examples of data that can be lost by rebuilding a data warehouse from scratch include:

  • Any prior versions of "versioned" data will be lost. For instance, if a customer changed their address at some point and time, the older history records would have an address as of their transaction date (or the date the warehouse was initially installed or rebuilt, which ever is later), and the newer records could be pointing to the newer date. If a warehouse is rebuilt, all history records will point to the latest address only.
  • Certain types of historical record balances on a day be day basis. In particular, inventory levels is an example. If the data warehouse is rebuilt, historical balances of this type can be lost.
  • Lost records due to purge. If any records are purged in the main iMIS database, a rebuild will not be able to include those records. (In the normal course of events, purges of the main iMIS database do not affect data warehouse data.)