Bi notes-several methods for deploying SSAs

Source: Internet
Author: User

 

There are many ways to deploy the SSAS library. You can select different methods based on different environments. This article lists several of the most common deployment methods and describes their application environments.

 

Environment conventions: SQL Server 2008

Example Library: Adventure works DW

 

Method 1: Visual Studio direct deploy

This method is the most direct and simple method. Most of us deploy it locally using this method. If you need to deploy it on another machine, refer:

Right-click the SSAS project and select "properties". On the displayed page, select deployment. This is directly deployed on the server through the source file. Note that we need to have permissions on the target server.

This configuration interface does not exist for SSAs libraries opened online using Visual Studio.

This method is suitable for the scenario where the server environment is relatively free and is also the most direct deployment method. A prerequisite is that bids must be installed on the target machine or server (actually a shell of Visual Studio ).

 

 

Method 2: Backup and Restore

In the development environment, back up the SSAS database to the abf file, right-click the database to be backed up, and select backup:

Then restore the file on the target server. Similarly, right-click and restore:

This method is usually used when the development environment and production environment are isolated.

The disadvantage is the processing of data source connections, because in an isolated environment, the configuration of the data source server must be different, so after recovery, you often need to use Visual Studio to connect to the recovered SSAs library and manually change it. Or you can change it directly in SSMs.

 

 

Method 3: asw..exe

Deploy it in command line mode. This program can be found at a location similar to the following:

C: \ Program Files \ Microsoft SQL Server \ 100 \ samples \ Analysis Services \ Administrator \ ascmd \ CS

The following is its source file. The purpose of the source file is to change the development environment to 32 bits, and the production environment to 64 bits, then you need the ascmd file of the 32-bit and 64-bit versions. We only need to specify this parameter during compilation:

To deploy this method, you need to generate the deployed SSAs library as an xmla script, which is an XML file.

The following are the specific methods:

Note: The generation time may be relatively long, depending on the complexity of SSAs dB. (Reference: the Library of adventure works will take more than five minutes)

If you want to deploy the service in overwriting mode, you must add the attribute allowoverwrite = "true" to the root node"

One thing to note is that you need to change the data source, which can be retrieved in the xmla file:

Because the deployed target server is different from the local server, a placeholder is left here. The method is to replace localhost (or the configuration of your corresponding data source location) with: $ (dwserver)

Then, open a command line to locate the directory where asw..exe is located, and then run the following command:

Ascmd-s XXX. XXX-V dwserver = XXX. XXX-I adventureworks. xmla

The preceding example assumes that ascmd and the stored xmla are in the same directory. If they are not in the same directory, you can change the value after-I.

Where:

-S is the address of the target server to be deployed. It is inferior to localhost or 172.5.3.123.

-V is the parameter replacement, that is, the replaced $ dwserver, that is, the location of the data source.

If it is used in a 64-bit environment, remember to compile asw..exe using a 64-bit environment.

This method is widely used because the development and production environments of most Bi projects are isolated and each has its own data warehouse. During deployment, you can write a batch processing script with parameters, which makes the deployment more flexible.

 

 

Method 4: Use AMO in the program.

The main point is to reference the following namespace:

The core code is as follows:

// Connect SSAs

Server _ Server = new server ();

_ Server. Connect ("localhost ");

 

// Load xmla content to string.

Streamreader sr = new streamreader ("xmlaquery. xmla", system. Text. encoding. Default );

String strxmla = Sr. readtoend ();

Sr. Close ();

 

// Execute

Xmlaresultcollection _ result = _ server. Execute (strxmla );

Foreach (xmlaresult R in _ result)

{

Foreach (xmlamessage m in R. Messages)

{

Console. writeline (M. Description );

}

}

Note that if a deployment problem occurs, no exception is thrown here. Therefore, the deployment result can only be seen by calling the execute method of the server instance, pay attention to the foreach section of the above Code.

The following are common errors that indicate that the SSAS library already exists because allowoverwrite = "true" is not added"

If the deployment is successful, there will be no messages in the result set.

This method is suitable for Integrated Development of your system and is relatively flexible.

 

 

Summary:

The above lists the most common methods for deploying the SSAS library. The complexity of each method varies with different application scenarios. Different solutions can be selected based on the actual situation in the project.

[Append]

Ascmd has been updated:

Http://sqlsrvanalysissrvcs.codeplex.com/releases/view/22769

[Append]

How to find ascmd

Download URL:

Http://sqlserversamples.codeplex.com/releases/view/45923

In the downloaded samples, find:

Sql2008r2. all_product_samples_without_dbs \ samples \ Analysis Services \ Administrator \ ascmd

It is the source file. You can compile it based on the system environment (x86 or x64.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.