[英]Restoring SQL Server DB, replacing the existing one
I am trying to restore SQL server DB, replacing the existing one but donot know how to do it. 我正在尝试还原SQL Server数据库,替换现有数据库,但不知道该怎么做。 My purpose is to restore the backup file selected by user, no matter if file with this name is already attached to the server or not.
我的目的是还原用户选择的备份文件,而不管该名称的文件是否已附加到服务器上。 If it is there, it should be replaced by the new one.
如果有,则应将其替换为新的。
Could any body give me vb.net code for it? 谁能给我vb.net代码呢?
Thanks 谢谢
That's easy and hard. 这既容易又困难。
Have you worked out what the sql is? 你知道sql是什么吗?
Are you restoring the entire back up or just a number of dbs out of it. 您要还原整个备份还是仅还原其中的一些数据库。
Do you want to sanity check it at all? 您是否要完全检查它?
How are you going to deal with sql server's service account not having permission to see the file? 您将如何处理不具有查看文件权限的sql server的服务帐户?
What about those using the database when it's requested. 那些在请求数据库时使用数据库的人呢?
Do you want to show progress as it restores? 您要在恢复时显示进度吗?
Are there other considerations, emailing, permissions, MSMQ, replication.... Which sql server versions are you coping with? 还有其他考虑因素,例如电子邮件,权限,MSMQ,复制...。您要处理哪些SQL Server版本?
If you aren't going to do this properly don't bother,m leave it the their IT / DBA people. 如果您不打算正确执行此操作,请不要理会,请留给他们的IT / DBA人员。 The more hand holding you want to do, the more the scope will creep...
您想要握住的手越多,作用域就越爬行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.