menu

Friday, May 27, 2011

Process a SQL Server Analysis Services Cube Using an XMLA Query

Problem

One of the Junior DBAs in my company wanted to know how to process a cube using an XMLA Query. In this tip we will go through the steps a database administrator needs to follow to process an Analysis Services cube using an XMLA command.  

Solution

Let us go through the steps a database administrator needs to follow to process an Analysis Services cube using XMLA.
1. Connect to a SQL Server Analysis Services Instance using SQL Server Management Studio.
2. In the Object Explorer Pane, expand the Analysis Services Instance, expand Databases, expand Analysis Services database, and then right click the Analysis Services cube which you want to process and then choose New Query ->XMLA from the drop down menu to open a new XMLA Query window.
3. In the XMLA Query window copy and paste the below XML. You need to change the DatabaseID and CubeIDappropriately as per your environment and then to do a Full Processing of the cube execute the XMLA Query.
<Batch xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
  
<
Parallel>    <Process xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ddl2="http://schemas.microsoft.com/analysisservices/2003/engine/2"xmlns:ddl2_2="http://schemas.microsoft.com/analysisservices/2003/engine/2/2"xmlns:ddl100_100="http://schemas.microsoft.com/analysisservices/2008/engine/100/100">      <Object>        <DatabaseID>Adventure Works DW</DatabaseID>        <CubeID>Adventure Works DW</CubeID>      </Object>      <Type>ProcessFull</Type>      <WriteBackTableCreation>UseExisting</WriteBackTableCreation>    </Process>  </Parallel>
</
Batch>
4. You can also generate the XMLA Query to process the cube by selecting Script Action to New Query Windowoption under the Process Cube GUI as shown in the below snippet.  Refer to this tip for more information on how to get this this screen.

Note

When you run the XMLA query as shown in Step 3 this will process the cube with the default options. If you need to specify other options as shown in this tip,, you can select all of the options using the SSMS and then use the "Script Action to New Query Window" to see how all of these addtional options are configured in XML.

Next Steps

No comments:

Post a Comment