Solved

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

Posted on 2014-10-08
1
105 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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

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 …
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

831 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