Scripting Analysis Services Database Backup

by keruibo 30. August 2008 20:19

There are a number of ways to automate backups of Analysis Services databases.  Some examples I've seen: SSIS Packages, PowerShell, SQL Agent jobs with XMLA. 

Here is a "quick and dirty" way using a .vbs cscript that can be called form the operating system, or scheduled in SQL Agent as a cmdexec step. This script will backup all Analysis Services databases programatically (i.e. if someone adds a new database, it will automatically be backed-up without further operational changes).

I'm not saying this is the best way to do this, and the script below completely lacks error trapping.  But it is effective, simple to implement, and may form a good base for a robust script in your environment.

 

 '-------------  Get the target folder from the command-line  -----------
 strBackupPath = WScript.Arguments.Named.Item("folder")
 WScript.echo "Destination folder: " & strBackupPath 

 if strBackupPath = "" then     wScript.Echo "'folder' parameter resulted in a blank string"     WScript.Echo "Usage: cscript BackupSSAS.vbs /folder:<full path to backup folder>"     WScript.Quit 1  end if

 strBackupPath = strBackupPath + "\"

 '-------------- Get TimeStamp in form YYYYMMDDhhmmss  -------------  MyTimestamp = CStr(Year(Now()) * 10000 + Month(Now()) * 100 + Day(Now())) _    + CStr(Hour(Now()) * 10000 + Minute(Now()) * 100 + Second(Now()))     '-------------  Connect to SSAS Instance  --------------------  Set ssas = CreateObject("Microsoft.AnalysisServices.Server")  ssas.Connect("localhost")

 '-----------  Backup Databases   -------------------------  For Each MyDatabase In ssas.Databases      MyDatabase.Backup strBackupPath + MyDatabase.Name + "_" + MyTimestamp + ".abf"  Next    '------------  Disconnect from SSAS Instance  -----------------  ssas.Disconnect()

Tags:

Analysis Services

Comments


United States cj 
October 8. 2008 05:52
can someone give an example of scripting a analysis cube to process?
i want to add that to our scheduler



January 19. 2010 18:41
If you paint in your mind a picture of bright and happy expectations, you put yourself into a condition conducive to your goal.


January 20. 2010 18:12
The beauty of these blogging engines and CMS platforms is the lack of limitations and ease of manipulation that allows developers to implement rich content and 'skin' the site in such a way that with very little effort one would never notice what it is making the site tick all without limiting content and effectiveness.


February 5. 2010 18:40
Victory always starts in the head. It's a state of mind. It then spreads with such radiance and such affirmations that destiny can do nothing but obey.


February 13. 2010 12:31
I wanted to thank you for this great read!! I definitely enjoying every little bit of it Smile I have you bookmarked to check out new stuff you post..


February 13. 2010 18:24
If you paint in your mind a picture of bright and happy expectations, you put yourself into a condition conducive to your goal.


February 15. 2010 07:14
I was looking for crucial information on this subject. The information was important as I am about to launch my own portal. Thanks for providing a missing link in my business.


February 20. 2010 03:15
What a excellent blog entry, Thanks for sharing it with me.  Have a Great day!


February 20. 2010 03:20
What a excellent blog entry, Thanks for sharing it with me.  Have a Great day!


February 20. 2010 03:26
Great Post! I love reading it.


February 20. 2010 03:28
I would like to share it with all my friends and hope they will like it too.


February 20. 2010 03:28
I like your blog post, keep on writing this great material!  I'll make sure to follow up on your blog in the future.


February 20. 2010 03:32
What a excellent blog entry, Thanks for sharing it with me.  Have a Great day!


February 20. 2010 12:56
I don't agree with everything in this piece of writing, but you do make some very good points. Im very interested in this matter and I myself do alot of research as well. Either way it was a well thoughtout and nice read so I figured I would leave you a comment. Feel free to check out my website sometime and let me know what you think.


February 20. 2010 18:59
This is a wonderful post, but I was wondering how do I suscribe to the RSS feed?


February 21. 2010 12:51
I'm happy I located this blog site, I couldnt obtain any knowledge on this topic before. Also manage a site and for anyone who is ever interested in a little bit of visitor writing for me you should feel free to let me know, im always look for people to check out my site. Please stop by and leave a comment sometime!


February 21. 2010 18:07
This is a very intriguing post, I was looking for this info. Just so you know I located your web site when I was browsing for blogs like mine, so please check out my site sometime and leave me a comment to let me know what you think.


February 21. 2010 21:51
I don't agree with everything in this write-up, but you do make some very good points. I'm very interested in this subject and I myself do alot of research as well. Either way it was a well thoughtout and nice read so I figured I would leave you a comment. Feel free to check out my website sometime and let me know what you think.


February 22. 2010 02:43
I have read a few of the articles on your website now, and I really like your style of blogging. I added it to my favorites site list and will be checking back soon. Please check out my site as well and let me know what you think.


February 22. 2010 05:26
This is a superb post, but I was wondering how do I suscribe to the RSS feed?


February 22. 2010 13:50
Great site, where did you come up with the knowledge in this blog? I'm glad I found it though, ill be checking back soon to see what other articles you have.


February 22. 2010 17:00
Great blog, this is very similar to a site that I have. Please check it out sometime and feel free to leave me a comenet on it and tell me what you think. I'm always looking for feedback.


February 22. 2010 21:26
Useful site, where did you come up with the knowledge in this piece? Im pleased I found it though, ill be checking back soon to see what other articles you have.


February 22. 2010 23:57
I have read a few of the articles on your website now, and I really like your style of blogging. I added it to my favorites web site list and will be checking back soon. Please check out my site as well and let me know what you think.


February 23. 2010 19:15
I don't agree with everything in this post, but you do make some very good points. Im very interested in this subject and I myself do alot of research as well. Either way it was a well thoughtout and nice read so I figured I would leave you a comment. Feel free to check out my website sometime and let me know what you think.


February 23. 2010 21:40
This is a good blog, I was wondering if I could use this posting on my website, I will link it back to your website though. If this is a problem please let me know and I will take it down right away.


February 24. 2010 02:36
I have read a few of the articles on your website now, and I really like your style of blogging. I added it to my favorites blog site list and will be checking back soon. Please check out my site as well and let me know what you think.


February 24. 2010 05:02
This is a terrific post, but I was wondering how do I suscribe to the RSS feed?


February 24. 2010 11:39
This is a good blog post, I was wondering if I could use this article on my website, I will link it back to your website though. If this is a problem please let me know and I will take it down right away.


February 24. 2010 16:51
This is a fantastic piece of content, I found your web site looking around bing for a similar subject and arrived to this. I couldnt discover to much additional details on this posting, so it was wonderful to find this one. I likely will be back again to look at some other articles that you have another time.


February 24. 2010 20:56
You really make it seem so easy with your presentation but I find this topic to be really something which I think I would never understand. It seems too complicated and very broad for me. I am looking forward for your next post, I will try to get the hang of it!


February 25. 2010 05:51
If you're serious about being fiscally responsible you should think about second guessing your auto insurance broker next time your rates increase. Smart drivers across Canada have started comparing the rates of their auto insurance broker with other competitive offerings.  Don't allow your rates to go through the roof this year ... Get Insurance Quotes!  You won't know what you can save on your auto insurance until you do a comparison!


February 25. 2010 23:24
Top post. I look forward to reading more. Cheers
http://www.environskincareaustralia.com.au


February 26. 2010 09:25
Hello,I love reading through your blog, I wanted to leave a little comment to support you and wish you a good continuation. Wishing you the best of luck for all your blogging efforts.


February 26. 2010 19:16
Exceptional site, where did you come up with the information in this write-up? I'm glad I found it though, ill be checking back soon to see what other articles you have.


February 26. 2010 22:10
Im pleased I located this blog, I couldnt discover any information on this topic prior to. I also operate a niche site and if you wish to ever interested in a little bit of visitor writing for me please feel free to let me know, im always look for people to check out my blog. Please stop by and leave a comment sometime!


February 27. 2010 03:57
This is a outstanding post, but I was wondering how do I suscribe to the RSS feed?


February 27. 2010 07:31
I don't agree with everything in this piece, but you do make some very good points. Im very interested in this topic and I myself do alot of research as well. Either way it was a well thoughtout and nice read so I figured I would leave you a comment. Feel free to check out my website sometime and let me know what you think.


February 27. 2010 11:51
Exceptional site, where did you come up with the knowledge in this post? I'm happy I found it though, ill be checking back soon to see what other articles you have.


February 27. 2010 15:58
This is a outstanding summary, I found your blog page doing research yahoo for a similar topic and arrived to this. I couldnt discover to much other material on this write-up, so it was good to discover this one. I will end up being back to check out some other posts that you have another time.


February 27. 2010 17:02
Interesting read, thanks for helping keep me busy at work ;)
http://www.webmarketingexperts.com.au/


February 27. 2010 18:02
Im happy I found this blog page, I couldnt find any info on this subject before. I also operate a niche site and if you want to ever serious in doing some visitor writing for me make sure you feel free to let me know, im always look for people to check out my web page. Please stop by and leave a comment sometime!


February 27. 2010 18:04
Hi
I feel enjoy at your blog. Your article very helpful for me. Keep writing and happy blogging.

Thanks
Dave


February 27. 2010 18:36
Very useful info. Hope to see more posts soon!

http://www.ifloor.com/


February 27. 2010 19:34
Finally someone that actually knows what they are talking about - thank you!


February 27. 2010 22:34
I have read a few of the articles on your website now, and I really like your style of blogging. I added it to my favorites site list and will be checking back soon. Please check out my site as well and let me know what you think.


February 28. 2010 00:51
Excellent post. There's a lot of good info in this article, however I  would like to let you know something - I'm using Mac OS X with the current beta of Firefox, and the display of your site is kind of bizarre for me. I can read the content, but the navigation does not function so good.


February 28. 2010 20:57
Hi
I found your site through search at google.  Your article very useful for me, maybe for other people too.  Big Thanks

Regards
Orie


March 1. 2010 21:42
Great post! I am just starting out in community management/marketing media and trying to learn how to do it well - resources like this article are incredibly helpful. As our company is based in the US, it?s all a bit new to us. The example above is something that I worry about as well, how to show your own genuine enthusiasm and share the fact that your product is useful in that case.


March 3. 2010 04:48
This is a very good blog, I located your blog site browsing aol for a similar topic and came to this. I couldnt discover to much other details on this piece, so it was great to discover this one. I likely will end up being back to look at some other articles that you have another time.


March 3. 2010 06:52
I'm pleased I discovered this webpage, I couldnt obtain any info on this topic prior to. I also operate a website and for anyone who is ever interested in a little bit of guest writing for me if possible feel free to let me know, i'm always look for people to check out my web page. Please stop by and leave a comment sometime!


long term alcohol rehab california


March 4. 2010 15:40
Do you accept guest posts? I would love to write couple articles here.
I was wondering what is up with that weird gravatar??? I know 5am is early and I'm not looking my best at that hour, but I hope I don't look like this! I might however make that face if I'm asked to do 100 pushups. lol


March 4. 2010 20:36
I enjoy watching movies online, it is way cheaper than going to the theaters.


March 5. 2010 07:41
I enjoy streaming movies online, it is way cheaper than going to the theaters.


March 5. 2010 19:56
Hey I was thinking if you could give some live examples of people using this portal to explain your theories , it would add more benefit to our understanding.  I would really appreciate some more updates from your side.


March 6. 2010 00:10
Hi… that was great stuff.. I really like reading on this subject  Could you tell me more on that… I love to explore


March 6. 2010 06:32
I was very pleased to find this site.I wanted to thank you for this great read!! I definitely enjoying every little bit of it and I have you bookmarked to check out new stuff you post.


March 6. 2010 19:14
I am really impressed with this blog.It is easy to see that you are passionate about your writing.


March 6. 2010 23:14
I was very pleased to find this site.I wanted to thank you for this great read!! I definitely enjoying every little bit of it and I have you bookmarked to check out new stuff you post.


March 9. 2010 08:31
Howdy, i read your blog occasionally and i own a similar one and i was just wondering if you get a lot of spam comments? If so how do you prevent it, any plugin or anything you can advise? I get so much lately it's driving me mad so any assistance is very much appreciated.


March 9. 2010 08:32
Well, this is my first visit to your blog! We are a group of volunteers and starting a new initiative in a community in the same niche. Your blog provided us valuable information to work on. You have done a marvellous job!


March 9. 2010 14:14
Hi… that was great stuff.. I really like reading on this subject Could you tell me more on that… I love to explore


March 9. 2010 18:34
<Backup xmlns="schemas.microsoft.com/.../engine">
  <Object>
    <DatabaseID>Order Analysis - Testing</DatabaseID>
  </Object>
  <File>C:\Program Files\Microsoft SQL Server\MSAS10.FOYLE_DB\OLAP\Backup\filename</File>
  <ApplyCompression>true</ApplyCompression>
</Backup>

you can schedule this in job agent. I just put it in the default folder so i dont have to mess with permissions.


March 9. 2010 19:33
Do you know which cell phone companies allow tethering?


March 10. 2010 06:16
Laser hair removal and cosmetic procedures in Manhattan, New York


March 10. 2010 20:48
Howdy, i read your blog occasionally and i own a similar one and i was just wondering if you get a lot of spam comments? If so how do you prevent it, any plugin or anything you can advise? I get so much lately it's driving me mad so any assistance is very much appreciated.


March 11. 2010 00:51
Hey - nice blog, just looking around some blogs, seems a pretty nice platform you are using. I'm currently using Wordpress for a few of my sites but looking to change one of them over to a platform similar to yours as a trial run. Anything in particular you would recommend about it?


March 12. 2010 14:08
I admit, I have not been on this webpage in a long time... however it was another joy to see It is such an important topic and ignored by so many, even professionals. I thank you to help making people more aware of possible issues.
Great stuff as usual...


March 12. 2010 15:12
I personally have embraced the new technologies and the CMS platforms, I think the new tools only make the web designs better. I am glad that new technologies are coming out in web design that make things easier, improved, and better looking for design.

Add comment




  Country flag

biuquote
  • Comment
  • Preview
Loading



Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2010 Rob Kerr's BI Blog