[TroubleShooting] The remote copy of database xx has not been rolled forward to a point in time

本文介绍了一种解决SQL数据库镜像同步过程中遇到的问题的方法。通过详细的步骤指导如何备份数据库、复制备份文件并进行恢复操作,特别强调了使用NORECOVERY及NOUNLOAD选项的重要性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Steps:

1. backup database TestMirror on Pricipal server

2. backup database log of TestMirror on Pricipal server

3. copy db and log backup files to Mirror server

4. restore db with norecovery

5. restore log with norecovery

6. create endpoints on both Pricipal serverand Mirror server

 

Issue:

If you use sql command or Mirror wizard to set mirror machine.

It will show error: "The remote copy of database "DBmirrorTest" has not been rolled forward to a point in time that is encompassed in the local copy of the database log."

Or

1.  ALTERDATABASETestBackup01SETPARTNER='TCP://isrv04.xxx:50221';

2. Tasks -> Mirror ->Mirroring -> Config Security

 

Solutions:

RESTORE DATABASE @dbname FROM DISK = @backupfile WITH FILE = 1, NORECOVERY, NOUNLOAD;
RESTORE LOG @dbname FROM DISK = @backupfile WITH FILE = 2, NORECOVERY, NOUNLOAD;


These did the trick for me. I generated the commands through the "Script"-menu within the "Restore Database"-dialog of the Management Studio, because enabling mirroring was no problem when I restored through the "Restore Database"-dialog. My manually written SQL-commands were missing the "NOUNLOAD" part.

 

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值