Construct WideWorldImporters OLAP Database
The scripts in this folder are used to construct the WideWorldImportersDW database from scratch on SQL Server or Azure SQL Database.
A pre-created version of the database is available for download as part of the latest release of the sample: wide-world-importers-release.
Contents
About this sample
Before you begin
Run this sample
Disclaimers
Related links
About this sample
- Applies to: SQL Server 2016 (or higher), Azure SQL Database [testing and modified instructions are TBD]
- Key features: Core database features
- Workload: OLTP
- Programming Language: T-SQL
- Authors: Greg Low, Denzil Ribeiro, Jos de Bruijn
- Update history: 25 May 2016 - initial revision
Before you begin
To run this sample, you need the following prerequisites.
Software prerequisites:
- SQL Server 2016 (or higher) or an Azure SQL Database.
- SQL Server Management Studio, preferably 2016 April Preview or later (version >= 13.0.14000.36)
Run this sample
The below steps reconstruct the WideWorldImportersDW database. To construct the full version of the sample database (for Eval/Developer/Enterprise Edition and Azure SQL DB Premium), simply follow the steps below. To construct the standard edition version (for Standard Edition and Azure SQL DB Basic/Standard), omit step 6.
-
Execute the script: 1-wwi-dw-metadata-population.sql -> this script creates the WWI_DW_Preparation database that holds all required metadata to create the OLAP database.
-
Execute the script: 2-wwi-dw-construct-database-from-metadata-tables.sql -> this script performs code generation to create the script for the OLAP database.
-
Copy the output from the execution of the previous script to a new query window and execute it. (A copy of this has been saved as 3-wwi-dw-recreate.sql) (If the database already existed, you will also see warnings related to it being removed and existing transactions rolled back).
-
Execute the script: 4-wwi-dw-configured-required-database-objects.sql -> this script creates additional objects that are required that are not part of the table and schema metadata. This predominantly involves additional types, views, and stored procedures.
-
Execute the script 5-wwi-dw-load-seed-data.sql. This script populates the seed data required for the database. It will typically take a few minutes to execute.
-
Execute the script 6-wwi-dw-enable-full-features.sql. This script enables features not available in standard edition. Skip this step when creating the sample database targeting standard edition.
-
Execute the WWI_Integration SSIS package to perform the ETL to populate the database. For details see [wwi-integration-etl] (../wwi-integration-etl/).
-
Execute the script 8-wwi-dw-backup.sql. This creates a backup of the database. Make sure to adjust the file path of the backup to match your folder structure. (A sample restore script 9-wwi-restore.sql is also provided).
-
If required, remove the WWI_DW_Preparation database.
Disclaimers
The code included in this sample is not intended to be used for production purposes.
Related Links
TBD For more information, see these articles: