如何安排SQL Server Express的每日备份? [英] How can I schedule a daily backup with SQL Server Express?

查看:141
本文介绍了如何安排SQL Server Express的每日备份?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行一个以SQL Server Express(2005)为后端的小型Web应用程序.我可以使用SQL脚本创建备份,但是,我希望每天安排一次.作为额外的选择(应该),我只想保留最后的X个备份(显然是出于节省空间的原因)是否有任何指针?

I'm running a small web application with SQL server express (2005) as backend. I can create a backup with a SQL script, however, I'd like to schedule this on a daily basis. As extra option (should-have) I'd like to keep only the last X backups (for space-saving reasons obviously) Any pointers?

[edit] SQL Server代理在SQL Server Express中不可用...

[edit] SQL server agent is unavailable in SQL server express...

推荐答案

您不能在SQL Server Express中使用SQL Server代理. 我之前做过的方法是创建一个SQL脚本,然后每天将其作为计划任务运行,您可以有多个计划任务来适合您的备份计划/保留时间.我在计划任务中使用的命令是:

You cannot use the SQL Server agent in SQL Server Express. The way I have done it before is to create a SQL Script, and then run it as a scheduled task each day, you could have multiple scheduled tasks to fit in with your backup schedule/retention. The command I use in the scheduled task is:

"C:\ Program Files \ Microsoft SQL Server \ 90 \ Tools \ Binn \ SQLCMD.EXE" -i"c:\ path \ to \ sqlbackupScript.sql"

"C:\Program Files\Microsoft SQL Server\90\Tools\Binn\SQLCMD.EXE" -i"c:\path\to\sqlbackupScript.sql"

这篇关于如何安排SQL Server Express的每日备份?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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