We recently migrated our SQL Server 2008 R2 and SAN storage to the new infrastructure, I have log shipping setup on few databases and to retain all the jobs I restored MSDB database on the new server, post migration I synced primary and secondary servers, enabled all log shipping related jobs and the entire process was successful, but few hours later Primary Server started generating alerts, error 14420 “The log shipping primary database [ServerName].[DatabaseName] has backup threshold of 60 minutes and has not performed a backup log operation for 120 minutes.”
To confirm my log shipping status I checked Log backup , log copy and log restore jobs and all were running successfully, my last log backup was 15 min back and it was successfully restored on secondary server as shown below.
Now I am pretty sure there is no problem with log shipping, but why server generating alerts, on further investigation using following query on Primary server.
Select * from msdb.dbo.log_shipping_monitor_primary
last_backup_date column was not at all updating with latest dates and it was showing date and time of last backup just before we migrated to new server.
This helped me a lot for my further investigation, and somewhere I read a suggestion just to check my server name.
Select ServerProperty('ServerName'), @@ServerName
Above query returned two different names,ServerProperty(‘ServerName’) returned actual server, whereas @@ServerName returned the name we had assigned to the server during SQL Installation(SQL Server Setup sets the server name to the computer name during installation )
When you run following queries all should return you same server name.
Select ServerProperty('ServerName') Select @@ServerName Select primary_server from msdb.dbo.log_shipping_monitor_primary
This happens if you install SQL Server and later you change Server name, to solve my problem I have to drop old server name and add it again with new server name as shown in the following queries
EXEC sp_dropserver 'OLD_SERVER_NAME' EXEC sp_addserver 'NEW_SERVER_NAME', 'local'
You need to restart your SQL Service for changes to take effect, no more error messages now.