SQL Server 2005 中的压缩备份

发布于 2024-07-08 20:06:58 字数 202 浏览 6 评论 0原文

压缩维护计划生成的备份的最佳免费方法是什么?

我知道有一些非免费工具可以压缩备份,但我对它们不感兴趣。

选项:

  1. 备份后执行一个 T-SQL 任务,该任务将通过 xp_cmdshell 运行脚本来压缩每个非压缩备份。
  2. ???

欢迎任何其他想法,我想避免编写脚本/程序。

What is the best free way to get your maintenance plan-generated backups compressed?

I know there are non-free tools that will compress the backups, but I'm not interested in them.

Options:

  1. Have a T-SQL task after the backups that will run a script through xp_cmdshell that compresses every non compressed backup.
  2. ???

Any other ideas welcome, I'd like to avoid writing a script/program.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

迟月 2024-07-15 20:06:58

我是一个开源项目(GPL v3)的作者,这可能就是您正在寻找的(尽管它不是基于维护计划的)。 它是一个命令行工具(在 Windows 中的计划任务中进行计划)并备份到 gzip、zip(特别是 zip64,因为常规 zip 文件有 4GB 限制)或 bzip2 文件。 您可以使用该工具直接从压缩文件恢复,也可以解压缩压缩文件(标准的*.bak 文件)并使用SQL Server 恢复。

它称为 SQL Server 压缩备份,可在此处找到:http://sourceforge.net/projects/mssqlcompressed/

示例命令为:

msbp.exe backup "db(database=model)" "zip64" "local(path=c:\model.full.bak.zip)"

I'm the author of an open source project (GPL v3) that might be what you are looking for (It's not maintenance-plan based though). It is a command line tool (to schedule in Scheduled Tasks in Windows) and backs up to gzip, zip (specifically zip64 due to the 4GB limitation with regular zip files), or bzip2 files. You can use the tool to restore directly from the compressed files, or you can uncompress the compressed files (which are standard *.bak files) and use SQL Server to restore.

It's called SQL Server Compressed Backup, found here: http://sourceforge.net/projects/mssqlcompressed/

A sample command would be:

msbp.exe backup "db(database=model)" "zip64" "local(path=c:\model.full.bak.zip)"
自找没趣 2024-07-15 20:06:58

您需要三个组件。 调度程序应该启动备份压缩以及可能的其他步骤,例如将最终结果复制到文件服务器。 您可以为每项任务选择工具,但我可以推荐我们的 Cobian Backup基于的设置已经运行了几年。

  • 调度程序:Cobian Backup

  • 备份:ExpressMaint (对于 MSSQL Express)

  • 压缩:Cobian备份

基本上,您可以使用 Cobian 设置备份计划,运行 ExpressMaint 或其他 MSSQL 备份工具作为 Cobian“事件之前”。 然后,Cobian 压缩结果并将其保存到目的地。

如果您打算在网络中移动 SQL Server 备份文件和/或集中存储它们,则必须压缩 SQL Server 备份文件。

You need three components. A scheduler should launch backup, compression and perhaps other steps like copying the end result to a file server. You can choose your tool for each task but I can recommend our Cobian Backup based setup that has served well for a couple of years.

  • Scheduler: Cobian Backup

  • Backup: ExpressMaint (for MSSQL Express)

  • Compression: Cobian Backup

Basically, you set up backup scheduling with Cobian, run ExpressMaint or other MSSQL backup tool as a Cobian "before event". Cobian then zips the result and saves it to a destination.

Compressing SQL Server backup files is necessary if you intend to move them in a network and/or centralize their storage.

暮光沉寂 2024-07-15 20:06:58

C:\Program Files\Support Tools>compress /?

是一个用于压缩文件的命令行工具。

我不知道如何仅压缩未压缩的文件,但您可能已经知道 T-SQL 任务中的文件名?

如果这样做,您可以将文件名作为参数传递给 xp_cmdshell 调用。

C:\Program Files\Support Tools>compress /?

is a command line tool for zipping files.

I don't know how to compress only uncompressed files, but you may already know the file names in your T-SQL task?

If you do, you can pass file names as parameters to your xp_cmdshell call.

擦肩而过的背影 2024-07-15 20:06:58

我会在备份后安排一项任务来按照您的建议进行操作。 另外,我相信 SQL2008(至少某些版本)会进行压缩备份。

但是,如果您出于磁盘空间原因需要压缩备份,我建议您考虑更多存储空间。 当然,除非您想缩小尺寸以进行磁带传输。

I'd schedule a task after the backup to do it as you already suggest. Also, I believe SQL2008 (at least some flavours) will do compressed backups.

However, if you are at the point where you NEED to compress backups for disk-space reasons, I'd suggest looking at more storage. Unless you are trying to keep the sizes down for a tape transfer, of course.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文