不同步时重新启动日志传送

发布于 2024-11-01 03:51:44 字数 743 浏览 1 评论 0原文

场景是。数据库辅助服务器由于不同原因不同步或怀疑不同步。有人因错误或其他事故而将辅助数据库设置为在线。如果您现在想确保它们重回正轨。你是怎么做到的?最好是快速地同时针对多个数据库。

当您使用指南在两台服务器之间设置日志传送时,它会负责初始备份和备份文件的复制,然后进行初始恢复。 如果我必须重做,我必须无法/启用并重做日志传送并再次填充所有参数。还有其他办法吗?我可以使用 sqllogship 应用程序吗? 我有一个“C:\Program Files\Microsoft SQL Server\100\Tools\Binn\sqllogship.exe” -Restart -server SQLServ\PROD2 或者有什么可以使用 powershell 和 SQL Server 管理对象 - SMO?

我想使用 log_shipping_secondary 等表中已有的所有参数。

我还没有找到任何执行此操作的脚本。我在使用指南时查看了生成的脚本,但其中不包含初始备份和副本。我可以编写自己的脚本。我只是担心有人会说:你为什么不直接运行:$smoLogShipping.Redo

The scenario is. A database secondary server are for different reason out of sync or is suspected that is not sync. Someone has made the secondary databases online by mistake or other mishaps. If you now want to make sure that they are set back on track. How do you do that? Preferably swiftly and for many databases at once.

When you set up a log shipping between two servers using the guide it takes care of the initial backup and copying of backup file and then the initial restore.
If I have to redo that I have to unable/enble and redo the loghipping and fill all the parameters again. Is there an other way? Can I use sqllogship application?
I there a "C:\Program Files\Microsoft SQL Server\100\Tools\Binn\sqllogship.exe" -Restart -server SQLServ\PROD2
Or is there something that could be done easily with powershell and SQL Server Management Objects - SMO?

I want to use all the parameters that are already in tables like log_shipping_secondary.

I have not found any scripts for doing this. I looked at the generated script when I used the guide but that does not contain the inital backup and copy. I can write my own script. I am just afraid someone will say: Why did you not just run: $smoLogShipping.Redo

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

梦忆晨望 2024-11-08 03:51:44

如果您使备用数据库联机(即)使用_recovery 恢复它,那么这将破坏日志传送。重新建立日志传送的唯一方法是再次从源的完整备份恢复备用数据库并使用 no_recovery/standby 模式。

If you bring a standby database on-line (i.e.) restore it with_recovery then this will break the log-shipping. The only way to re-establish log shipping is to restore the standby database from a full backup of the source again and use no_recovery / standby mode.

折戟 2024-11-08 03:51:44

我不知道有任何社区支持的脚本可以完成您所要求的操作,但它可以编写足够简单的脚本。 GUI 可以处理大部分流程,然后您只需对其进行参数化和自定义以适应您所追求的工作流程即可。下面的链接给出了我正在谈论的内容的示例。

编写日志传送自动化脚本

I do not know of any community supported script to do what you ask but it can be scripted easy enough. The GUI can handle most of the process, you would then just need to tweak it be parameterized and customized to the work flow that you are after. The link below gives an example of what I'm talking about.

Scripting Log Shipping Automation

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文