Solved

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

Posted on 2014-10-08
1
108 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 43

Accepted Solution

by:
Eugene Z 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
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.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

724 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