Solved

script check backup log on primary server and restore log on secondary server

Posted on 2014-10-08
1
104 Views
Last Modified: 2014-10-09
Hello,

I search a script to compare backup log on primary SQL server and restore log on secondary SQL server.

Thanks

Regards
0
Comment
Question by:bibi92
1 Comment
 
LVL 42

Accepted Solution

by:
EugeneZ earned 500 total points
ID: 40370288
to check backup history
use
Select * from msdb.dbo.backupset where type ='L' and database_name = <your database name >


--for restore history
Select * from  msdb.dbo.restorehistory

or/and

select distinct r.destination_database_name, r.restore_date,
       bs.server_name, m.physical_device_name as backup_device, b.physical_name
from msdb.dbo.restorehistory r
      inner join msdb.dbo.backupfile b on r.backup_set_id = b.backup_set_id
      inner join msdb.dbo.backupset bs on b.backup_set_id = bs.backup_set_id
      inner join msdb.dbo.backupmediafamily m on bs.media_set_id = m.media_set_id
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have a large data set and a SSIS package. How can I load this file in multi threading?
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Viewers will learn how the fundamental information of how to create a table.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now