changing the ID of an SSAS database
I want to rename my SALES cube to SALES_2009 and put a new cube called SALES. When I rename it, the ID remains as SALES so my new cube now is called SALES, but it's internal ID is SALES_2010 (and my old cube is called SALES_2009, but the internal ID is SALES).
Can the ID of a SSAS databas开发者_如何学JAVAe be changed?
I have tried the properties window and googled bing, but to no avail.
By some miracle, I found this. If you click a little button at the top of the Solutions Explorer in Visual Studio that says 'show all files' when you roll over it, you will see a file called Something.Database. View the code of that file and you can edit an element. This will change the ID of the database on deployment.
You could backup and restore with new name - http://richardlees.blogspot.com/2009/05/new-analysis-services-database-version.html but there isn't any way to alter the databaseid AFAIK
In the past I've scripted the cube as a create statement to a new window, changed the IDs to what I needed, dropped the old cube & run the create script. It works, but seems a bit risky.
This works for tabular, I am sure it will work for OLAP SSAS as well...
Go to Microsoft SQL Server Management Studio. Right click on your Tabular database and select Back Up... Select a location and name and perform the backup. Right click again on your database and click Delete, continue to delete the database.
Now Right click on the Databases folder and select Restore... Select the backup you have just created. While still in the Restore Database window, there will be a drop-down box with the label 'Restore Database:', by default this will be blank, Type the new name in there, this name will also be the new ID. Now click OK to restore your database.
After the restore completed hit the refresh button to see your new database, right click on it and select Properties, the ID should now be the same as the new Database name you have entered.
Analysis Cube object ID name change: To change the object ID name, right click the object and click on view code. The XML representation will appear and at the top, second line there will be a tag called ID there you can change the name.
Not being able to rename the database id is a current limitation with SSAS, I have created the following Connect Item so Microsoft will hopefully resolve the issue: https://connect.microsoft.com/SQLServer/Feedback/Details/1134252
精彩评论