How to backup multiple database using XMLA in one batch


Recently I got a question on how to backup multiple database using XMLA in one batch.

&sp;Lets see the problem

Here are two XMLA scripts for backup databases

  <Backup xmlns=”http://schemas.microsoft.com/analysisservices/2003/engine”&gt;
    
    <File>adv1.abf</File>
    <AllowOverwrite>true</AllowOverwrite>
  </Backup>

  <Backup xmlns=”http://schemas.microsoft.com/analysisservices/2003/engine”&gt;
    
    <File>mine1.abf</File>
    <AllowOverwrite>true</AllowOverwrite>
  </Backup>

Here when you run this query in XMLA query window it will give error

Executing the query …
The ‘Backup’ element at line 15, column 76 (‘http://schemas.microsoft.com/analysisservices/2003/engine&#8217; namespace) appears more than once under Envelope/Body/Execute/Command.
Execution complete

so we need to run it in batch. In batch we can run multiple XMLA query. But since this is backup we can not run it in transaction. So we have to specify transaction as false in the query

So the new query will be

<Batch xmlns=”http://schemas.microsoft.com/analysisservices/2003/engine” Transaction=”false” &gt;

  <Backup xmlns=”http://schemas.microsoft.com/analysisservices/2003/engine”&gt;
    
    <File>adv1.abf</File>
    <AllowOverwrite>true</AllowOverwrite>
  </Backup>

  <Backup xmlns=”http://schemas.microsoft.com/analysisservices/2003/engine”&gt;
    
    <File>mine1.abf</File>
    <AllowOverwrite>true</AllowOverwrite>
  </Backup>

</Batch>

Cheers
Amish Shah

3 Responses to “How to backup multiple database using XMLA in one batch”

  1. Unknown's avatar Anonymous Says:

    Thank you so much, U saved my day.

  2. Unknown's avatar Anonymous Says:

    You da man!

  3. Unknown's avatar Anonymous Says:

    Thanks, it was a very helpful tip

Leave a comment


Design a site like this with WordPress.com
Get started