简体   繁体   English

还原SQL Server数据库,替换现有数据库

[英]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.

相关问题 在现有数据库上(还原)还原数据库是否与通过在MS SQL Server中删除现有数据库来还原数据库不同? - Is restoring a database on existing one (replacing) different from restoring database by deleting the existing one in MS SQL Server? 在Docker容器上还原SQL Server数据库时遇到问题 - Trouble restoring sql server DB on docker container SQL Server 2005 - 在其他服务器上还原加密的数据库 - SQL Server 2005 - Restoring an encrypted DB on a different server SQL Server:通过链接服务器还原数据库-数据库间歇性地停留在还原状态(即使使用RECOVERY选项) - SQL Server: Restoring DB via linked server - Database intermittently stuck in restoring state (even with RECOVERY option) 在Sql Server 2012中还原数据库后如何正确运行查询? - How to run queries properly after restoring a db in Sql Server 2012? 恢复数据库SQL Server - restoring database sql server 使用 FullTextSearch 将数据库恢复到不同的数据库相同的服务器 - Restoring a DB with FullTextSearch To a Different DB same server SQL Server Azure,将 90% 的源数据库复制/复制/导入到现有数据库中 - SQL Server Azure, replicate/copy/importing 90% of source-db into existing one 还原SQL Server备份时出现问题 - Problem restoring a SQL Server backup 恢复SQL Server数据库的问题 - Problems with restoring SQL Server database
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM