sqlserver日志同步报错


今天收到邮件报警sqlserver数据库无法正常备份恢复,报错信息如下:消息
The backup data at the end of "G:\日志传送使用\ybcatalog102\ybcatalog102_20160508000005.trn" is incorrectly formatted. Backup sets on the media might be damaged and unusable. To determine the backup sets on the media, use RESTORE HEADERONLY. To determine the usability of the backup sets, run RESTORE VERIFYONLY. If all of the backup sets are incomplete, reformat the media using BACKUP WITH FORMAT, which destroys all the backup sets.

估计是数据恢复出现问题,只能尝试完整备份来解决了。

现在主服务器上完整备份数据库,然后在被服务器上恢复数据。

RESTORE DATABASE [ybcatalog102]
FROM DISK = N'\\192.168.0.31\g$\日志传送使用\20160808.bak'
WITH REPLACE,
MOVE N'ybcatalog102' TO N'E:\sqldatafile\ybcatalog102.mdf',
MOVE N'ybcatalog102_log' TO N'F:\sqllogfile\ybcatalog102.ldf',
STANDBY = N'G:\sysqldata\recovery_ybcatalog102.bak'

标红的逻辑名称用下面的语句查询就可以了。

RESTORE FILELISTONLY FROM disk='\\192.168.0.31\g$\日志传送使用\20160808.bak'


Whatever is worth doing is worth doing well.