MSDN Documentation

Microsoft Developer Network

Deploying Analysis Services Mining Models

This document provides a comprehensive guide on deploying your well-designed mining models in SQL Server Analysis Services (SSAS). Deployment is a crucial step that makes your predictive models available for querying and integration into business intelligence solutions.

Prerequisites

Deployment Methods

There are several ways to deploy your mining models:

  1. Using SQL Server Management Studio (SSMS): The most common and user-friendly method for interactive deployment.
  2. Using Visual Studio (with SQL Server Data Tools): Ideal for development scenarios, allowing you to package and deploy projects.
  3. Using XMLA (XML for Analysis): Programmatic deployment for automated or scripting purposes.

Deploying with SQL Server Management Studio (SSMS)

Follow these steps to deploy your mining models using SSMS:

  1. Connect to your SQL Server Analysis Services instance in SSMS.
  2. Right-click on the Analysis Services database that will host your mining model.
  3. Select "Deploy."
  4. In the Deployment Wizard, choose "Deploy Mining Model."
  5. Select the mining model(s) you wish to deploy from the available list.
  6. Configure deployment properties, such as whether to overwrite existing models.
  7. Review the deployment summary and click "Finish."

Tip: Always consider deploying to a development or test instance first before deploying to a production environment.

Deploying with Visual Studio (SQL Server Data Tools)

If you developed your SSAS project in Visual Studio:

  1. Open your SSAS project.
  2. Right-click on the project in Solution Explorer.
  3. Select "Deploy."
  4. Visual Studio will build the project and deploy all its components, including mining models, to the configured target server.

Note: Ensure your project's deployment properties are correctly configured to point to the desired Analysis Services server.

Deploying with XMLA

XMLA provides a powerful way to automate deployments. You can execute XMLA scripts to deploy mining models. A typical XMLA deployment script would involve commands to process and create or update objects within the SSAS database.

Here's a simplified example of an XMLA command to deploy a mining model (actual script would be more complex and often generated):

<Execute xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
  <Command>
    <Batch xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
      <Alter Action="Create" ObjectExpansion="ExpandFull">
        <Object>
          <DatabaseID>YourDatabaseName</DatabaseID>
          <MiningModels>
            <MiningModel>
              <ID>YourMiningModelID</ID>
              <Name>YourMiningModelName</Name>
              <DataSourceID>YourDataSourceID</DataSourceID>
              <Algorithm>M</Algorithm>
              <Structure>
                <Source>...</Source>
              </Structure>
            </MiningModel>
          </MiningModels>
        </Object>
      </Alter>
    </Batch>
  </Command>
  <PropertyList>
    <DataSourceInfo>Provider=MSOLAP.8;Data Source=YourServerName;</DataSourceInfo>
    <Catalog>YourDatabaseName</Catalog>
  </PropertyList>
</Execute>

Post-Deployment Steps

Warning: Ensure your data sources are accessible from the SSAS server before processing the mining model. Insufficient permissions or network issues can lead to processing failures.

Troubleshooting Common Deployment Issues

For more advanced deployment scenarios, including scripting and automation, refer to the XMLA Syntax documentation.