Friday, March 30, 2012

Renaming databases sloooow

We have SSAS 2005 setup which rebuilds our cubes each night on a single server. What we were trying to do is make it so that each night a second database is built and processed for the next days data, and then the previous days database is dropped and the new one renamed to the correct name. This was meant to minimize downtime. The problem is, renaming the database is slow (it takes hours!) .. is this a bug? We've tried renaming it through AMO and SQL Studio, both of which cause the CPU to go up to 50% for more than 2 hours before the rename completes. These databases have approx 8 cubes with many measure groups.

You should be able to change database name by issuing a simple XMLA command like:

<Alter AllowCreate="true" ObjectExpansion="ObjectProperties" xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<Object>
<DatabaseID>CountMeasure</DatabaseID>
</Object>
<ObjectDefinition>
<Database xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ID>MyDb1</ID>
<Name>MyDb2</Name>
</Database>
</ObjectDefinition>
</Alter>

Try running Profiler and see what is happening during database rename.
During rename you should see bunch of Notification events about changes in database objects.

See how long in average each Notification Event takes. Is it possible rename of the database is getting blocked by some other operation?

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

No comments:

Post a Comment