在实体框架中备份数据库 [英] Backup of the database in entity framework

查看:80
本文介绍了在实体框架中备份数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好

我使用实体框架。我的db文件在一个目录中。

我想要备份数据库文件。什么软件可以移动这两个文件?

这个程序在文件被锁定时运行。

除了复制文件之外还有什么方法吗?

解决方案

如果您使用的是MDB,那么它们在使用时将始终处于锁定状态。一种方法是编写一系列存储过程,用备份过程包装它们并从客户端调用它。



考虑使用SQL 2008快递,并在那里托管数据库。这样你就可以创建备份维护计划,让其他服务器提取数据等等。有很多选择。您甚至可以使用SQL Server Management Studio手动进行备份。



干杯。


我要回溯有点......事实证明你可以使用卷影复制方法,但它可能不符合你的需要,如上所述。当然,它不能用EF来完成。



http://www.codeproject.com/KB/dotnet/makeshadowcopy.aspx?display=Print

干杯。


卷影复制来自。 NET [ ^ ]

Hello
I work with entity framework. my db files in a directory.
I want get backup the database files. What software do move these two files?
This program is run when files are locked.
Is there any way other than copying files?

解决方案

If you are using MDBs then they will always be locked when in use. One way to do it would be to write a whackload of stored procs, wrap them with a 'backup' proc and call that from the client.

Consider using SQL 2008 Express, and host the DB there. That way you would be able to create backup maintenance plans, have other servers pull the data, etc. Lots of options. You can even use SQL Server Management Studio to do the backups by hand.

Cheers.


I'm going to backtrack a bit...as it turns out you can use the shadow copy approach, but it may not fit your needs as you've described above. Certainly, it cannot be done with EF.

http://www.codeproject.com/KB/dotnet/makeshadowcopy.aspx?display=Print
Cheers.


Volume Shadow Copies from .NET[^]


这篇关于在实体框架中备份数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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