Backing up an SSAS database
In this recipe, we will create an SSAS database backup.
Getting ready
Choose an SSAS database you want to back up, and replace the –Name
parameter in the recipe. Ensure that you are running PowerShell with administrator privileges to the SSAS instance.
How to do it...
Open the PowerShell console by going to Start | Accessories | Windows PowerShell | Windows PowerShell ISE.
Import the
SQLPS
module as follows:#import SQLASCMDLETS module Import-Module SQLASCMDLETS -DisableNameChecking
Add the following script and run:
$instanceName = "KERRIGAN" $backupfile = "C:\Temp\AWDW.abf" Backup-ASDatabase -BackupFile $backupfile -Name "SampleDW" -Server $instanceName -AllowOverwrite -ApplyCompression
How it works...
The Backup-ASDatabase
cmdlet allows
multidimensional or tabular SSAS databases to be backed up to a file. In our recipe, we chose to do a compressed backup for the SampleDW
SSAS database to an Analysis Services Backup file (.abf
).
$instanceName = "KERRIGAN" $backupfile...