Book Image

SQL Server 2014 with PowerShell v5 Cookbook

By : Donabel Santos
Book Image

SQL Server 2014 with PowerShell v5 Cookbook

By: Donabel Santos

Overview of this book

Table of Contents (21 chapters)
SQL Server 2014 with PowerShell v5 Cookbook
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Processing an SSAS cube


In this recipe, we will process an SSAS cube.

Getting ready

Choose a cube that is readily available in your SSAS instance.

How to do it...

Let's explore the code required to process an SSAS cube:

  1. Open PowerShell ISE as an administrator.

  2. Import the SQLASCmdlets module as follows:

    #import SQLASCmdlets module
    Import-Module SQLASCmdlets -DisableNameChecking
  3. Add the following script and run it:

    $instanceName = "localhost"
    Invoke-ProcessCube -Name "AW" -Server $instanceName -Database "AWDW" -ProcessType ([Microsoft.AnalysisServices.ProcessType]::ProcessFull)

To check whether the cube has been processed, perform the following steps:

  1. Go to Management Studio and connect to SQL Server Analysis Services. Right-click on the cube you just processed and go to Properties:

  2. In the General section, check the Last Processed value. It should be updated to when the script finished executing, as shown in the following screenshot:

How it works...

Processing, or reprocessing, a cube is a common task that...