简体   繁体   English

我可以从SQL Server 2005中删除差异备份吗?

[英]Can I delete a differential backup from SQL Server 2005?

I often like to create backups when testing the software I work on, and will sometimes create a differential backup if I want to be able to get back to multiple previous states. 我经常喜欢在测试要使用的软件时创建备份,并且有时如果我希望能够回到多个先前状态,有时会创建差异备份。 However, sometimes I realize that I forgot one thing I wanted to include in a differential backup, or I no longer need a previous differential backup. 但是,有时我意识到我忘记了要包含在差异备份中的一件事,或者不再需要以前的差异备份。 Sometimes I simply want to create a new scenario from the original base image and start working with a new series of differential backups. 有时,我只是想从原始基础映像创建一个新方案,并开始使用一系列新的差异备份。 So I'd like to be able to delete some older differential backups so I don't get confused about which ones I'm using. 因此,我希望能够删除一些较旧的差异备份,这样我就不会对正在使用的备份感到困惑。 But I can't find any way to delete just the differential backups, selectively or all at once. 但是我找不到任何方法有选择地或一次全部删除差异备份。

The best solution I've found so far is to remove the existing backup destination (so that the new backup won't overwrite it) and create a new one in a new file, then create a differential backup to that new file with the "back up to a new media set" option selected. 到目前为止,我发现最好的解决方案是删除现有的备份目标(以便新备份不会覆盖它)并在新文件中创建一个新备份,然后使用“备份到新媒体集”选项。 But I currently don't understand this solution or even know if it works for sure (I haven't done a lot of backing up and restoring lately). 但是我目前不了解该解决方案,甚至无法确定它是否有效(我最近没有做很多备份和还原工作)。 How does it know what the base backup looks like if I've removed that file from the destination set? 如果我已从目标集中删除该文件,它怎么知道基本备份的外观?

I'm starting to think the best way to delete all my differential backups might actually be to skip all that and just restore to my base backup, then re-backup overwriting all existing backup sets. 我开始认为删除所有差异备份的最佳方法实际上可能是跳过所有备份,然后还原到基本备份,然后重新备份以覆盖所有现有备份集。 This method doesn't let me pick and choose which differential backups to delete, but at least I can understand what's going on and rely on it. 这种方法不允许我选择要删除的差异备份,但是至少我可以理解并依靠它。

Where are you backing these up to? 您将这些备份到哪里? If you are backing up to disk, then you can have each backup be it's own file. 如果要备份到磁盘,则可以使每个备份都是它自己的文件。 That way you can individually remove files/backups you no longer want or need. 这样,您可以单独删除不再需要的文件/备份。 The initial backup will be the base image/backup, and each after can be a differential if you want. 初始备份将是基础映像/备份,并且如果需要,之后的每个备份可以是一个差异。

If your database is small enough (or you have enough space) you can always do full backups since you said this is all for testing, so I'm guessing you aren't working with huge amounts of data during this process. 如果您的数据库足够小(或您有足够的空间),那么您始终可以进行完整备份,因为您说这一切都是为了进行测试,因此我猜您在此过程中不会处理大量数据。 Then you don't need to worry about differentials, and can always do a full restore from a single file instead of having to maintain the chain. 然后,您不必担心差异,并且始终可以从单个文件进行完整还原,而不必维护链。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM