Merge branch 'wwi-update' of https://github.com/Microsoft/sql-server-samples into wwi-update

This commit is contained in:
Jos de Bruijn
2017-06-26 10:11:47 -07:00
2 changed files with 11 additions and 11 deletions
@@ -53,9 +53,9 @@ The below steps reconstruct the WideWorldImportersDW database. To populate the d
3. Publish the WideWorldImportersDW database:
1. In the Solution Explorer, right-click the **WideWorldImportersDW** project, and select **Publish** to bring up the **Publish Database** dialog.
1. Click **Edit** to modify the **Target Database Connection** to point to your SQL Server.
1. Edit the **Database Name** to say "WideWorldImportersDW".
1. Edit the **Database Name** to "WideWorldImportersDW".
1. Click **Publish**.
1. Wait for publication to finish. You can monitor progress in the **Data Tools Operations** page in Visual Studio. In testing this took around 3 minutes.
1. Wait for the publication process to finish. You can monitor progress in the **Data Tools Operations** page in Visual Studio. During testing this took around 3 minutes.
4. Execute the SQL Server Integration Services package **Daily ETL** once, to seed the WideWorldImportersDW database based on the contents of the WideWorldImporters database. For instructions on how to install and run this package see [wwi-ssis] (../wwi-ssis/).
@@ -2,7 +2,7 @@
The Visual Studio SQL Server Data Tools project in this folder is used to construct the WideWorldImporters database from scratch on SQL Server or Azure SQL Database. It is possible to vary the data size.
A pre-created version of the database is available for download as part of the latest release of the sample: [wide-world-importers-release](http://go.microsoft.com/fwlink/?LinkID=800630).
A pre-created version of the database is available for download as part of the latest release of the sample: [wide-world-importers-release](https://aka.ms/wwi).
### Contents
@@ -17,7 +17,7 @@ A pre-created version of the database is available for download as part of the l
## About this sample
<!-- Delete the ones that don't apply -->
1. **Applies to:** SQL Server 2016 (or higher), Azure SQL Database [testing and modified instructions are TBD]
1. **Applies to:** SQL Server 2016 (or higher), Azure SQL Database
1. **Key features:** Core database features
1. **Workload:** OLTP
1. **Programming Language:** Transact-SQL
@@ -25,7 +25,6 @@ A pre-created version of the database is available for download as part of the l
The instructions below are for creating the sample database from scratch.
A pre-created version of the database is available for download as part of the latest release of the sample: [wide-world-importers-release](http://go.microsoft.com/fwlink/?LinkID=800630).
<a name=before-you-begin></a>
@@ -35,7 +34,7 @@ To run this sample, you need the following prerequisites.
**Software prerequisites:**
1. SQL Server 2016 SP1 (or higher) or an Azure SQL Database. Also works with SQL Server 2016 RTM, for Evaluation, Developer, and Enterprise edition.
1. SQL Server 2016 SP1 (or higher) or an Azure SQL Database (Premium). Also works with SQL Server 2016 RTM, for Evaluation, Developer, and Enterprise edition.
2. Visual Studio 2015 Update (or higher) with SQL Server Data Tools (SSDT). We recommend you update to the latest available of SSDT from the Visual Studio Extensions and Updates feed.
@@ -60,11 +59,11 @@ Note that each time the database is created from scratch, the data in many table
1. Click **Edit** to modify the **Target Database Connection** to point to your SQL Server 2016 (or later) instance.
1. Edit the **Database Name** to say "WideWorldImporters".
1. Click **Publish**.
1. Wait for publication to finish. You can monitor progress in the **Data Tools Operations** page in Visual Studio. In testing this took around 3 minutes.
1. Wait for the publication process to finish. You can monitor progress in the **Data Tools Operations** page in Visual Studio. During testing this took around 3 minutes.
4. (Optional) Data population: After step 3, the database contains data for January 2013. This step populates data from February 2013 up to the current data.
1. Open SQL Server Management Studio, and connect to the WideWorldImporters database that was published in the previous step.
1. Execute the following script. This may take a while to complete - populating data from Feb 2013 to Jun 2016 took about 40 minutes in one test.
1. Execute the following script. This may take a while to complete - populating data from Feb 2013 to Jun 2016 took about 40 minutes in one test on a machine with 3.4GHz CPU and the transaction log on SSD.
```
EXEC DataLoadSimulation.PopulateDataToCurrentDate
@@ -78,8 +77,8 @@ Note that each time the database is created from scratch, the data in many table
To customize the period for data generation, leverage the stored procedure `DataLoadSimulation.DailyProcessToCreateHistory`.
<br/><br/>The referenced stored procedure removes the temporal nature of the tables, and implements a series of triggers. It then emulates typical activities that would occur during each day. Finally, it removes the triggers and re-establishes the temporal tables. You can see the progress of the simulation in the Messages tab in SSMS as the query executes. (AreDatesPrinted controls whether dates are printed to the messages window as data is generated. IsSilentMode controls whether detailed output is printed. IsSilentMode = 1 produces just date output if AreDatesPrinted = 1.).
Note that a different outcome is produced each time it is run as it uses many random values.
StartDate and EndDate cover the period for generation. Other code populates the 2012 period when expanding the columnstore tables so do not populate back into 2012 or earlier with this procedure. The EndDate must also be at or before the current date as temporal tables do not allow future dates.
You can configure the amount of data produced by modifying the number of orders per day. The default is 60 orders and produces a reasonable OLTP database size of around 93MB compressed. You are also able to configure how busy Saturday and Sunday are compared to normal Monday to Friday working days, as a percentage. The suggested values are 50% for Saturday and 0% for Sunday.
StartDate and EndDate cover the period for generation. The OLAP database `WideWorldImportersDW` contains the stored procedure `Application.Configuration_PopulateLargeSaleTable` to populate the 2012 period with a large amount of data for columnstore tables testing, so do not populate back into 2012 or earlier using the `DailyProcessToCreateHistory` procedure. The EndDate must also be at or before the current date as temporal tables do not allow future dates.
You can configure the amount of data produced by modifying the number of orders per day. The default is 60 orders per day and produces a reasonable OLTP database size of around 93MB compressed for a period of 2.5 years. You are also able to configure how busy Saturday and Sunday are compared to normal Monday to Friday working days, as a percentage. The suggested values are 50% for Saturday and 0% for Sunday.
### Publishing to Azure SQL Database
@@ -88,7 +87,8 @@ To publish the database to Azure SQL Database, complete the following steps afte
A. Update the partition schemes `Storage\PS_TransactionDate.sql` and `Storage\PS_TransactionDateTime.sql` as follows: replace every occurrence of `USERDATA` with `PRIMARY`.<br/>
B. Delete the filegroups `Storage\USERDATA.sql` and `Storage\WWI_MemoryOptimized_Date.sql`.<br/>
C. Right-click the project **WideWorldImporters** and select **Properties** to open the properties pane.<br/>
D. Change the **Target Platform** to **Microsoft Azure SQL Database v12**, and press **Ctrl-S** to save.
D. Change the **Target Platform** to **Microsoft Azure SQL Database v12**, and press **Ctrl-S** to save.<br/>
E. Create a new Azure SQL Database with the name WideWorldImporters. As pricing tier, select **Premium**. For instructions see: [Create an Azure SQL database in the Azure portal](https://docs.microsoft.com/azure/sql-database/sql-database-get-started-portal).
Continue with Step 2 above.