MSDN Documentation

Microsoft Developer Network

Backup and Restore Analysis Services Databases

This document provides comprehensive guidance on backing up and restoring Analysis Services databases, ensuring data integrity and disaster recovery capabilities.

Why Backup and Restore?

Regular backups are crucial for:

Backup Operations

Analysis Services supports full backups and differential backups. Transaction log backups are not supported for Analysis Services.

Full Backup

A full backup creates a complete copy of the database at the time of the backup. This is the most straightforward backup method.

Note: A full backup is always recommended as the initial step before performing any differential backups.

Differential Backup

A differential backup captures all the data that has changed since the last full backup. Restoring a differential backup requires the most recent full backup. Differential backups are smaller and faster to create than full backups, but the restore process is longer.

Performing Backups

Using SQL Server Management Studio (SSMS)

  1. Connect to your Analysis Services instance in SSMS.
  2. In Object Explorer, navigate to Databases.
  3. Right-click on the database you want to back up.
  4. Select Tasks > Backup....
  5. In the Backup Analysis Services Database dialog box:
    • Choose the Backup type (Full or Differential).
    • Specify the Destination for the backup file (e.g., a local path or a network share). Ensure the Analysis Services service account has read/write permissions to the destination.
    • Optionally, you can specify a File name.
  6. Click OK to start the backup process.

Using Transact-SQL (T-SQL) Commands

You can use the BACKUP DATABASE command with the following syntax:

BACKUP DATABASE [DatabaseName]
TO DISK = 'C:\Path\To\Your\BackupFile.abf'
WITH FORMAT, MEDIADESCRIPTION = 'Full backup of MyDatabase';

For a differential backup:

BACKUP DATABASE [DatabaseName]
TO DISK = 'C:\Path\To\Your\DifferentialBackupFile.abf'
WITH DIFFERENTIAL, MEDIADESCRIPTION = 'Differential backup of MyDatabase';

Tip: Use the FORMAT option only for the very first backup to a specific backup media. Subsequent backups to the same media should omit FORMAT.

Restore Operations

Restoring an Analysis Services database requires a full backup. If you have performed differential backups, you will need the last full backup and the most recent differential backup.

Using SQL Server Management Studio (SSMS)

  1. Connect to your Analysis Services instance in SSMS.
  2. In Object Explorer, right-click on Databases and select Restore Database....
  3. In the Restore Analysis Services Database dialog box:
    • Select the Source of the backup (e.g., "Database" to select from a list of backups on the server, or "From device" to specify a backup file path).
    • If restoring from a device, click the ellipsis (...) button to browse and select your backup file.
    • If you have multiple backups, select the appropriate backup set to restore.
    • For the Destination database:
      • If the database already exists, you can choose to overwrite it. Caution: This will permanently delete the existing database.
      • You can also restore to a new database name.
    • Review the Backup Sets. If restoring a differential backup, ensure the correct full backup is also available and selected (SSMS usually handles this automatically if the files are accessible).
  4. Click OK to begin the restore process.

Using Transact-SQL (T-SQL) Commands

To restore a full backup:

RESTORE DATABASE [DatabaseName]
FROM DISK = 'C:\Path\To\Your\BackupFile.abf'
WITH REPLACE; -- Use REPLACE to overwrite an existing database

To restore a differential backup after a full backup:

RESTORE DATABASE [DatabaseName]
FROM DISK = 'C:\Path\To\Your\DifferentialBackupFile.abf'
WITH RESTART, RECOVERY; -- Assumes the full backup has already been restored. RESTART allows resuming, RECOVERY rolls back uncommitted transactions.

Important: Restoring a database overwrites any existing database with the same name unless a new name is provided. Always ensure you have the correct backup files and understand the implications of the REPLACE option.

Backup Locations and Permissions

Ensure the Analysis Services service account has the necessary permissions to read from and write to the specified backup locations. Network shares are commonly used for centralized backup storage.

Best Practices