我需要在SQL脚本文件中自动化SQL Azure数据库备份。我怎么能这样做? [英] I need to automate SQL Azure database backup in SQL Script files. How can i do so?

查看:186
本文介绍了我需要在SQL脚本文件中自动化SQL Azure数据库备份。我怎么能这样做?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我每天都在生成SQL脚本来进行SQL Azure数据库的备份。我需要使用一些免费软件自动完成此过程。我如何实现这一点?



注意: - 我需要采取SQL脚本的形式到一些本地机器的备份。

解决方案

选项1:运行一些代码/脚本备份数据库



可以使用SQLCMD实用程序运行SQL。



http:// msdn.microsoft.com/en-us/library/ms162773.aspx



要安排此操作,只需使用Windows任务计划程序。



http://msdn.microsoft.com /en-us/library/bb756979.aspx



选项2:使用Azure数据同步



保持本地数据库与SQL Azure数据库同步,例如一个常量备份。



http://msdn.microsoft.com/en-us/library/windowsazure/hh456371.aspx p>

选项3:使用BacPac



Azure中有一个API可备份您的数据库到BACPAC格式。



http://msdn.microsoft.com/en-us/library/windowsazure/hh335292.aspx



RedGate工具允许您以还原到本地SQL Server。



http://www.red-gate.com/products/dba/sql-azure-backup/





我已经创建了一个命令行工具,它将创建数据库的副本,使用Azure Management API的BacPac:



https:// github .com / richorama / SQLDatabaseBackup


Presently i am generating SQL scripts everyday to take the backup of SQL Azure database. I need to automate this process using some freeware. How can i achieve this?

Note:- I need to take the backup in form of SQL Script to some local machine.

解决方案

Option 1: Run some code/script to backup the database

You could run the SQL using the SQLCMD utility.

http://msdn.microsoft.com/en-us/library/ms162773.aspx

To schedule this, just use the Windows Task Scheduler.

http://msdn.microsoft.com/en-us/library/bb756979.aspx

Option 2: Use Azure Data Sync

Keep a local database in sync with your SQL Azure database, like a constant backup.

http://msdn.microsoft.com/en-us/library/windowsazure/hh456371.aspx

Option 3: Use BacPac

There is an API available in Azure to backup your database to a BACPAC format.

http://msdn.microsoft.com/en-us/library/windowsazure/hh335292.aspx

A RedGate tool then allows you to restore to a local SQL Server.

http://www.red-gate.com/products/dba/sql-azure-backup/

Edit

I have since created a command line tool which will create a copy of your database, and back it up to BacPac using the Azure Management API:

https://github.com/richorama/SQLDatabaseBackup

这篇关于我需要在SQL脚本文件中自动化SQL Azure数据库备份。我怎么能这样做?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆