SQL Server: Database Log Shipping Interview Questions and Answers (Day-2)

What are your basic prerequisites for configuring Log Shipping?

  • Check SQL Server edition which supports Log Shipping.
  • The servers involved in log shipping should have the same case-sensitivity settings.
  • The databases in a log shipping configuration must use the full recovery model or bulk-logged recovery model.

How to monitor the Log Shipping configurations and operations?

We can use sp_help_log_shipping_monitor system stored procedure to monitor basic thing about the Log Shipping.

How to display the Transaction Log Shipping Status report on a server instance?

Connect to a monitor server, primary server, or secondary server.

Right-click the server instance in Object Explorer, point to Reports, and point to Standard Reports.

Click Transaction Log Shipping Status.

Which are the basic system tables to track the information about the Log Shipping?

  • log_shipping_monitor_alert
  • log_shipping_monitor_error_detail
  • log_shipping_monitor_history_detail
  • log_shipping_monitor_primary
  • log_shipping_monitor_secondary

Which permission is requireD to enable a Log Shipping?

You must be a sysadmin on each server instance to enable log shipping.

When Primary instance failed, we require fail-over management so during this exercise what is our big problem to enable a Secondary Instance for further operation?

Typically, the primary and secondary databases are unsynchronized, because the primary database continues to be updated after its latest backup job. Also, in some cases, recent transaction log backups have not been copied to the secondary server instances, or some copied log backups might still not have been applied to the secondary database.

What are your basic steps to perform Fail-over Secondary server in Log Shipping, when Primary Server fails?

  • Take the Tail of Log from Primary server if possible.
  • Restore Tail of log into all Secondary Database.
  • Remove Log-shipping configuration from Primary Server.
  • Select any one of Secondary server and bring into online with Alter Database DBName set Online.
  • Right click on Primary Database and Generate script for Users and Logins.
  • Then move the script to Secondary server to create Users and Logins.
  • Re-configure log shipping from New Server (Secondary server).

How we can swap the role between Primary Server and Secondary Server?

  • Bring the secondary database online, backing up the transaction log on the primary server with NORECOVERY.
  • Disable the log shipping backup job on the original primary server, and the copy and restore jobs on the original secondary server.
  • Enable the log shipping backup job on the secondary server (the new primary server), and the copy and restore jobs on the primary server (the new secondary server).

I want to know drop a database which is a part of Log Shipping, How it is possible?

If you are planning to delete a database that is part of a log shipping configuration, remove log shipping first.

You can remove log shipping from a primary database by disabling it in SQL Server Management Studio or by using the log shipping Transact-SQL stored procedures. When you remove log shipping from a database, all log shipping related jobs and schedules will be removed, along with log shipping history and error information. The databases themselves on both the primary and secondary servers will not be changed.

Which stored procedures used to remove a secondary database in Log Shipping?

On the primary server, execute sp_delete_log_shipping_primary_secondary to delete the information about the secondary database from the primary server.

On the secondary server, execute sp_delete_log_shipping_secondary_database to delete the secondary database.

Which stored procedures used to remove a Log Shipping?

On the primary server, execute sp_delete_log_shipping_primary_secondary to delete the information about the secondary database from the primary server.

On the secondary server, execute sp_delete_log_shipping_secondary_database to delete the secondary database.

On the primary server, execute sp_delete_log_shipping_primary_database to delete information about the log shipping configuration from the primary server. This also deletes the backup job.

Delete the secondary database from the secondary server if desired.

I want to perform migration of high availability Log Shipping to Always On Availability Group. What are the prerequisites for Log Shipping?

  • The log shipping primary database must reside on the instance of SQL Server that hosts the initial/current primary replica of the availability group.
  • For a given log shipping secondary database to be converted to an Always On secondary database, it must:
  • Use the same name as the primary database.
  • Reside on a server instance that hosts a secondary replica for the availability group.
  • Once the backup job has run on the primary database, disable the backup job, and once the restore job has run on a given secondary database, disable the restore job.
  • After you have created all the secondary databases for the availability group, if you want to perform backups on secondary replicas, you need to re-configure the automated backup preference of the availability group.

How can I continue to log ship to the former primary server without restoring a database backup?

It is possible to log ship between two servers repeatedly without having to restore the complete database backup. The requirement is that both the primary and secondary servers are available when you perform the role change procedure.

What do you know about the Error Message 14421?

Message 14421 does not necessarily indicate a problem with Log Shipping. This message indicates that the difference between the last backed up file and last restored file is greater than the time selected for the Out of Sync Alert threshold.

What do you know about the Error Message 14420?

Message 14420 does not necessarily indicate a problem with log shipping. The message indicates that the difference between the last backed up file and current time on the monitor server is greater than the time that is set for the Backup Alert threshold.

Logshipping primary database backup job failed with the following error:

 *** Error: Cannot open backup device ‘\\..\BACKUP LOG is terminating abnormally.

SQL Server agent does not have appropriate permission to access the shared folder. Granting access solves this problem.


Please share your ideas and opinions about this topic with me, your contribution will add true value to this topic.
If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.

If you like this post, then please share it with others.
Please follow dbrnd.com, I will share my experience towards the success of Database Research and Development Activity.

I put up a post every day, please keep reading and learning.
Discover Yourself, Happy Blogging !
Anvesh M. Patel.

More from dbrnd.com

Leave a Reply

Be the First to Comment!

Notify of
avatar
wpDiscuz