Monday, March 19, 2012

How to take SSAS database metadata backup using XMLA commands?

Hi,

I am looking for XMLA command to only take metadata backup of a SSAS database having MOLAP storage mode.

I know that by issuing normal backup command it can take backup of metadata, source data and aggregations but I want only metadata backup.

Can someone confirm if this is possible or not?

Quick reposnse of this query is highly appreciated.

Thanks,

Kuldeep

Backup command is not intended to backup metadata only.

You can write few lines using AMO object model to output database metadata into a file and backup the file itself.

Something like:

server.Connect("MyServerName");

XmlTextWriter xmlwrite = new XmlTextWriter("c:\backup\MyDatabase.xmla", System.Text.Encoding.UTF8);

xmlwrite.Formatting = Formatting.Indented;

xmlwrite.Indentation = 2;

Scripter.WriteAlter(xmlwrite, server.Databases["MyDatabaseName"], true, true);

xmlwrite.Close();

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

No comments:

Post a Comment