SQL Server – Log Shipping – Monitoring

 

Background

As we bring back online our Log Shipping DR SQL Instance, wanted to write a couple of scripts to review the settings and put in place ongoing monitoring.

 

Script

Primary


select
	  [serverPrimary] = cast(serverproperty('servername') as sysname)
	, [database] = tblLSP.primary_database
	, [directoryBackupLocal] = tblLSP.backup_directory
	, [directoryBackupNetworkShare] = tblLSP.backup_share
	, tblLSP.last_backup_file
	, tblLSP.last_backup_date

from   [msdb].[dbo].[log_shipping_primary_databases] tblLSP

Output:
primary

 

Secondary


select
	[serverSecondary] = cast(serverproperty('servername') as sysname)
	, [database] = tblLSS.[secondary_database]
	, tblLSS.last_restored_file
	, tblLSS.last_restored_date
	, tblLSS.restore_delay
	, tblLSS.disconnect_users

from   [msdb].[dbo].[log_shipping_secondary_databases] tblLSS

Output:
secondary

Listening

Listening and dedicating Joshua Radin’s  Everything’ll Be Alright (Will’s Lullaby) to a new and special friend who is moving to Columbia.

It is always good to meet someone that still believes in a World without barbwires.

God’s Speed as she follows Camelot’s calling.

 

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s