不同步时重新启动日志传送
场景是。数据库辅助服务器由于不同原因不同步或怀疑不同步。有人因错误或其他事故而将辅助数据库设置为在线。如果您现在想确保它们重回正轨。你是怎么做到的?最好是快速地同时针对多个数据库。
当您使用指南在两台服务器之间设置日志传送时,它会负责初始备份和备份文件的复制,然后进行初始恢复。 如果我必须重做,我必须无法/启用并重做日志传送并再次填充所有参数。还有其他办法吗?我可以使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您使备用数据库联机(即)使用_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.
我不知道有任何社区支持的脚本可以完成您所要求的操作,但它可以编写足够简单的脚本。 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