Solved

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

Posted on 2014-10-08
1
102 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
Comment Utility
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

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

I wrote this interesting script that really help me find jobs or procedures when working in a huge environment. I could I have written it as a Procedure but then I would have to have it on each machine or have a link to a server-related search that …
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

762 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

10 Experts available now in Live!

Get 1:1 Help Now