还原没有事务日志的SQL Server DB [英] Restore SQL Server DB without transaction log

查看:217
本文介绍了还原没有事务日志的SQL Server DB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

鉴于 SQL Server 2008 .bak文件,有一种方法可以从.bak文件中仅还原数据文件,而无需事务登录?

Given a SQL Server 2008 .bak file, is there a way to restore the data file only from the .bak file, without the transaction log?

我要问的原因是该数据库的事务日志文件很大-超出了我已经可以使用的磁盘空间.

The reason I'm asking is that the transaction log file size of this database is huge - exceeding the disc space I have readily available.

我对事务日志不感兴趣,对任何未完成的事务都不感兴趣.通常,恢复数据库后,我只会将日志缩小为零.但是,当我没有足够的磁盘空间来首先创建日志时,这无济于事.

I have no interest in the transaction log, and no interest in any uncompleted transactions. Normally I would simply shrink the log to zero, once I've restored the database. But that doesn't help when I have insufficient disc space to create the log in the first place.

我需要的是一种告诉SQL Server仅还原.bak文件中的数据,而不还原事务日志的方法.有什么办法吗?

What I need is a way to tell SQL Server to restore only the data from the .bak file, not the transaction log. Is there any way to do that?

请注意,我无法控制.bak文件的生成-它是从外部来源获取的. 不是不是一种选择.

Note that I have no control over the generation of the .bak file - it's from an external source. Shrinking the transaction log before generating the .bak file is not an option.

推荐答案

这确实是ServerFault或DBA站点的一个问题,但是简短的回答是否",您只能还原完整的.bak文件(撇开'exotic的情况,例如文件组或分段还原).您没有说巨大"是什么意思,但是磁盘空间却很便宜.如果真的不能添加更多数据,那么您需要找到一种从外部来源获取数据的替代方法.

This is really a question for the ServerFault or DBA sites, but the short answer is no, you can only restore the full .bak file (leaving aside 'exotic' scenarios such as filegroup or piecemeal restores). You don't say what "huge" means, but disk space is cheap; if adding more really isn't an option then you need to find an alternative way of getting the data from your external source.

这篇关于还原没有事务日志的SQL Server DB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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