检查数据库恢复是否完成
我们得到了由另一个来源管理的夜间备份/恢复。 我们需要在恢复后立即执行 SSIS 包。
目前,所有流程都是通过估计每个步骤需要多长时间来及时执行的,这很容易出错。
问题是,我如何检查恢复是否完成并执行 SSIS 包?
注意:备份/恢复不能使用SSIS 来完成。
We got a nightly backup/restore managed by another source. And we need to execute an SSIS package right after restore.
At the moment, all the processes are executed in a timely fashion by estimating how long every step can take which is very error prone.
Question is, how can i check if restore finished and execute the SSIS package?
NOTE: backup/restore is executed cannot be done with SSIS.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,我不知道完美的解决方案,但你可以尝试以下方法。
这将为您提供数据库的状态,如果数据库仍在恢复,则为“RESTORING”。 您可以在作业代理中创建一个重复作业,该作业设置为在恢复开始后运行。 当数据库完成恢复后,状态将为“ONLINE”,您可以从 SQL 执行 SSIS 包,作业结束。
我不知道有什么优雅的解决方案,但希望它有帮助。
Well I don't know of a perfect solution but you could try the following.
That'll give you the status of the database, "RESTORING" if it is still restoring. You could create a recurring job in the Job Agent, which is set to run, after the restoration has started. When the database is done restoring the status will be "ONLINE" and you can execute the SSIS package from SQL, and the Job ends.
I don't know of an elegant solution but hope it helped.