Solved

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

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL Server Agent Job Error 13 70
In T-SQL cursor convert smallint to varchar 15 50
SQL 2012 Report Builder 3.0 query 2 16
Search Text in Views 2 24
Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

738 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