Restoring an SSAS database
You will see how to restore an SSAS database in this recipe.
Getting ready
Locate your SSAS backup file, and replace the backup file parameter with the location of your file.
How to do it...
Let's explore the code required to restore an SSAS database:
- Open PowerShell ISE as an administrator.
- Import the
SQLASCmdlets
module as follows:#import SQLASCmdlets module Import-Module SQLASCmdlets -DisableNameChecking
- Add the following script and run it:
$instanceName = "localhost" $backupfile = "C:\Temp\AWDW.abf" Restore-ASDatabase -RestoreFile $backupfile -Server $instanceName -Name "AWDW" -AllowOverwrite
How it works...
The Restore-ASDatabase
allows multidimensional or tabular SSAS databases to be restored when provided with a backup file:
$instanceName = "localhost" $backupfile = "C:\Temp\AWDW.abf" Restore-ASDatabase -RestoreFile $backupfile -Server $instanceName -Name "AWDW" -AllowOverwrite
There's more...
To...