Home » SQL » Top 3 Measures to Troubleshooting the Log Shipping Issues in SQL Server

Top 3 Measures to Troubleshooting the Log Shipping Issues in SQL Server

  author
Ravindra Singh   
Published: Nov 28, 2018 • SQL • 4 Min Read

Are you the one facing issues with log shipping in Microsoft SQL server?

Is the issue restricting you from completing your daily business operations? Are you getting frustrated, irritated, and unable to focus on other work too?

Don’t panic, take a deep breath, and sit in a chill mode! We are having solution to your problem. This post is going to guide you for Troubleshooting log shipping issues in SQL server. So, let’s begin!

Log shipping is an old technology in Microsoft SQL server for achieving high availability. This feature is utilized under the backup of transaction log in the server. The replica copy of log file is created from the primary database, moved on the secondary server, and then recovered in the secondary database on daily basis. The backup, copy, and restore frequency can be described at the time of log shipping configuration.

If required, DBAs can change the settings anytime. Talking about the advantage of using log shipping is that we can describe multiple servers in it, whose role will be secondary. This provides a monitored server that audit the backup history and status. It also raise an alert when operations get terminated according to the defined schedule.

‘None of the applications or software features are perfect. One or the other day, an error occurs within them, and same is the case with SQL server log shipping.’

So, if you determine that the reports of log shipping are defunct, you need to perform two things at basic level of troubleshooting log shipping issues in SQL server :

  • Check that the remote connections are activated on primary, secondary, and monitor.
  • Ensure that linked server is making use of same authentication settings as mentioned in log shipping setup.

Other Basic Ideas to Log Shipping Troubleshooting in SQL Server

Sometimes the error in the server occurs because of the disturbance in basic settings. Therefore, below mentioned are the measures that needs to be done to check basic SQL server log shipping settings :

  • Have a look in the SQL Server ERRORLOGs, Application/System Event Logs and analyze the audit data.
  • Deeply look into the details of backup, copy, and restore for any errors.
  • Take the troubleshooting method on next level by looking into metadata of log shipping. This can be done by querying the tables of log shipping on monitor / secondary / primary.

If Basic Settings Are Correct, Go To Advance Level

The advance level requires learning of issue and then, accordingly take the action. This means that first you have to determine the actual error, and after that, execute the solution.

Error 1 : Access Couldn’t Be Gained Because Database is in Use

Following error appears when restoration process is going on the server :

 restoration process

The configuration settings, which result in this log shipping error are pointed below :

  • Secondary database is configured with read-only setting.
  • Connections to the database were present at the time of restoration.
  • The checkbox of ‘disconnect users….’ option is unchecked.
Solution – You can fix this log shipping issue in SQL server by checking the checkbox of ‘disconnect users…’.

Error 2 : The Log in Backup Set Initiates At LSN

This is the another common log shipping error, which can be seen in different scenarios of log shipping productions.

log shipping error in sql server

In the above screenshot, we had mentioned the log backup that is failing. Its time to move back in the time and address why previous log file was unable to get recovered on the secondary server.

Solution – Determine the absent log backup and then, restore it manually in secondary database. When the restoration gets completed, next backups will go smoothly without any issue.

Error 3 : Failure in Directory Lookup for File Path

The error 2 of log shipping issues in SQL server appears when restoration of transaction log backup occurs. This error 3 is from restoration of the job history.

troubleshooting log shipping issues in SQL server

The error appears when new file is appended into the primary database and its path does not exist in the secondary server.

Solution – There exists two methods to resolve this error :

  • Create a similar location on secondary server where restoration procedure is getting terminated.
  • Try to manually restore the failing log with help of ‘With Move” and then, navigate the new file towards a valid path on the secondary server.

Time to Wrap Up

Administrator needs to have expertise level of knowledge for troubleshooting log shipping issues in SQL server. If in case, he or she is unable to troubleshoot any issue then, don’t feel shy; simply contact to the Invorx support team. Based on the version and settings of client’s SQL server, our experts will go through the problem and accordingly guide with stepwise method to resolve the issue.

Check More Similar Posts:
1. SQL Server Database Performance Issues

2. Disaster Recovery Plan in MS SQL Server

3. SQL Server Database Autogrowth

By Ravindra Singh

Ravindra Singh is a seasoned professional who wears two essential hats in the digital world - as a Digital Marketing Consultant and a Content Strategist. His expertise lies in formulating and executing result-driven digital marketing strategies. Simultaneously, his strategic approach to content ensures that brands deliver compelling and engaging narratives.