简体   繁体   English

在SQL Server 2008/2012中复制还原数据库

[英]Copying restoring databases in SQL Server 2008/2012

I've got two SQL Servers, one of these servers (Server A) is backing up transaction logs on some database and uploading them to the other (Server B). 我有两台SQL Server,其中一台服务器(服务器A)正在备份某个数据库上的事务日志,并将它们上传到另一台服务器(服务器B)上。 Unfortunately I have no access to Server A, I simply have to trust that it is doing its job of periodically uploading its transaction logs to Server B. 不幸的是,我无权访问服务器A,我只需要相信它正在执行将其事务日志定期上载到服务器B的工作。

Now, suppose Server B needs to recover the database for whatever reason. 现在,假设服务器B无论出于何种原因都需要恢复数据库。 Doing this will break its ability to receive further transaction log backups. 这样做将破坏其接收进一步的事务日志备份的能力。

Is there any way to copy/branch/backup the restoring database, so I can have one version of it that will continue to apply the transaction logs, and one version that will be recovered for reading/writing? 是否有任何方法可以复制/分支/备份还原数据库,所以我可以拥有一个将继续应用事务日志的版本,以及一个将被恢复用于读取/写入的版本?

Unfortunately you can't use snapshot to bring a log-shipping backup instance online. 不幸的是,您不能使用快照使日志传送备份实例联机。 You might be able to do it if the data resides on a san where you can force a fast lun copy and then mount a second copy of it real quick. 如果数据驻留在san上,则可以执行此操作,您可以在其中强制执行快速lun副本,然后再真正快速地装入其第二个副本。 Even without a SAN you can basically, between log loads or while you let them stack up for a bit, offline the DB, copy the files, and then bring up the copied version. 即使没有SAN,您也基本上可以在两次日志加载之间或者让它们稍微堆叠一下之后,使DB脱机,复制文件,然后调出复制的版本。 Ugly but it gets the job done. 丑陋但完成了工作。

If you can get both DBs involved up to 2012 then I'd recommend you read up on AlwaysOn Availability Groups. 如果两个数据库都可以参与到2012年,那么我建议您阅读AlwaysOn可用性组。 http://technet.microsoft.com/en-us/library/hh510230.aspx They are cool because you can leave the second copy online in read-only mode while it is mirroring, all the time. http://technet.microsoft.com/zh-cn/library/hh510230.aspx它们很酷,因为您可以始终在镜像时将第二个副本保留为只读模式。 Thus the stupid, almost repetitive, name for what should have been called something simple like "Live Mirroring". 因此,愚蠢的,几乎是重复的名称应被称为“ Live Mirroring”之类的简单名称。

Also, questions like this might better be asked on one of the sister sites like http://ServerFault.com or https://dba.stackexchange.com/ 另外,最好在姐妹站点之一(例如http://ServerFault.comhttps://dba.stackexchange.com/)上询问类似这样的问题

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

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