Microsoft KB Archive/294287

= INF: How to Automate an Archive or Backup of OLAP Database =

Article ID: 294287

Article Last Modified on 2/22/2007

-

APPLIES TO


 * Microsoft SQL Server OLAP Services
 * Microsoft SQL Server 2000 Analysis Services

-



This article was previously published under Q294287



SUMMARY
Microsoft SQL Server 2000 Analysis Services provides functionality to archive and restore Analysis Services databases. Each database is archived to one or more .cab files, which you can reserve for restoration requirements or migrate to other server computers. To automate the archiving of the OLAP database, you can use the msmdarch command.



MORE INFORMATION
The following command archives the sample FoodMart 2000 database included in Analysis Services: &quot;\Program Files\Microsoft Analysis Services\Bin\msmdarch&quot; /a myserver &quot;\Program Files\Microsoft Analysis Services\Data\&quot; &quot;FoodMart 2000&quot; &quot;\My archives\server myserver\FoodMart 2000.cab&quot; If you use the /r switch instead of the /a switch in the preceding command line, you restore the Foodmart 2000 database to myserver.

You can also execute the msmdarch command from a .bat file. If you want to schedule execution of a .bat file, Microsoft recommends that you use Data Transformation Services (DTS) to create an Execute Process task that runs the batch file. The msmdarch command returns an exit code of 1 if it fails. If you choose to use DTS, please make sure to pay attention to the following items to avoid the two most common mistakes in scheduling a DTS package to perform the task:
 * Start the SQLServerAgent service on an account that is a member of the local OLAP Administrators group of the server computer.
 * Type the msmdarch command on a single line. Do not use any hard carriage returns between characters.

If you are looking for a way to programmatically archive or restore your databases, the following Microsoft Visual Basic code example shows how you can shell out to execute the msmdarch command to archive or restore an Analysis Services database. There is no return code; use and check the SQL Server error log file to track success or errors: Dim Servername As String Dim DataPath As String Dim ExePath As String Dim CabFileName As String Dim DatabasenName As String Dim LogFileName As String Dim Execstr As String

Servername = &quot;ServerName&quot; DataPath = &quot;&quot;&quot;C:\Program Files\Microsoft Analysis Services\Data\&quot;&quot;&quot; ExePath = &quot;&quot;&quot;C:\Program Files\Microsoft Analysis Services\Bin\&quot; DatabaseName = &quot;&quot;                        ' leave this blank when restoring CabFileName = &quot;&quot;&quot;C:\temp\FoodMart 2000.cab&quot;&quot;&quot; ' Backup File LogFileName = &quot;&quot;&quot;C:\temp\FoodMart 2000.log&quot;&quot;&quot; ' LogFile Execstr = ExePath & &quot;MSMDARCH.EXE&quot;&quot; /r &quot; & Servername & &quot; &quot; & DataPath & &quot; &quot; & DatabaseName & &quot; &quot; & CabFileName & &quot; &quot; & LogFileName Shell Execstr, vbHide

As an extra precaution, Microsoft recommends that you use the following backup procedure in addition to using the archive and restore utilities. Before you perform the archive and restore, make sure that no one is connecting to the Analysis Server server, and that the MSSQLServerOLAPService service is stopped.

Steps to Backup Analysis Services Database

 * 1) To back up your Analysis Services databases, make a backup copy of your Analysis Services\Data folder, which is installed by default under the C:\Program Files folder.
 * 2) If you have not migrated the repository, please make a backup copy of the Msmdrep.mdb file that is located in the Analysis Services\Bin folder.
 * 3) If you have migrated the repository to SQL Server 7.0 OLAP Services format, use the SQL Server backup utility to back up your repository database.
 * 4) Save a copy of your Analysis Services registry entries by running regedit, and by using the Export Registry File item on the Registry menu to export this key to a backup file: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\OLAP Server

Additional query words: suggest suggestion recommendation OLAP

Keywords: kbinfo KB294287

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.