简体   繁体   English

sql server日志备份

[英]sql server tlogs backup

my scenario is that i had log shipping configured between two sql servers and because of an issue the restore stopped few days back. 我的情况是,我在两个sql服务器之间配置了日志传送,并且由于问题,还原几天后就停止了。

Since the retention period has already expired and the purge job has already deleted the logs from the primary server I cannot patch the logs to dr to synch it with the primary server. 由于保留期已经到期,并且清除作业已经从主服务器删除了日志,因此我无法将日志修补到dr上以使其与主服务器同步。

My question is how can I backup tlogs from the primary sql server for a specific duration. 我的问题是如何在特定持续时间内从主sql服务器备份日志。 For example from the time of failure lets call it (15 October) till the current time (17 october 10 pm) manually . 例如,从发生故障的时间开始,手动将其称为(10月15日)直到当前时间(10月17日晚上10点)。

I dont want to take a differential backup or a full backup and restore it to the secondary server as that would require me to delete the log shipping configuration and re do it . 我不想进行差异备份或完整备份并将其还原到辅助服务器,因为这将需要删除日志传送配置并重新执行。

Unfortunately, you're going to have to pull another full backup of the database and start over for the secondary. 不幸的是,您将不得不提取数据库的另一个完整备份并重新开始备份。

You can probably disable the log shipping jobs, run a full backup, restore with norecovery, and re-enable the log shipping jobs. 您可能可以禁用日志传送作业,运行完整备份,无恢复进行还原以及重新启用日志传送作业。 I've done that with Red Gate SQL Backup. 我已经使用Red Gate SQL Backup做到了。 Full backups don't break the restore log chain. 完全备份不会破坏还原日志链。

Using a differential doesn't mean you will break log shipping. 使用差异并不意味着您会中断日志传送。 Here is a great article about basically doing the following: 这是一篇有关基本执行以下操作的出色文章

  1. Disable the Restore jobs on the Secondary server. 在辅助服务器上禁用还原作业。
  2. Perform a differential backup on the Primary database. 在主数据库上执行差异备份。
  3. Restore that differential on the Secondary database and choose to keep it in NORECOVERY mode. 在辅助数据库上还原该差异,然后选择将其保持在NORECOVERY模式。
  4. Re-enable the Restore jobs on the Secondary server. 在辅助服务器上重新启用还原作业。

The Restore job should then be smart enough to find any applicable logs that can be applied to the updated database. 然后,还原作业应该足够聪明,以找到可以应用于更新的数据库的任何适用的日志。 Your Log Shipping setup should be back to normal now and run as expected. 您的日志传送设置应立即恢复正常并按预期运行。

Please let me know how it goes. 请让我知道如何。 Thanks. 谢谢。

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

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