September 24, 2019 at 12:10 am
Hi All,
I would like to know if we could find the log of export import database wizard ?
lets say when we do restore database
Thank you very much
Much appreciated
September 25, 2019 at 1:10 am
Thanks for posting your issue and hopefully someone will answer soon.
This is an automated bump to increase visibility of your question.
September 25, 2019 at 2:14 am
I have to ask... what does the Export/Import Wizard have to do with a Database Restore?
A Database Restore should show up in the SQL Server log.
--Jeff Moden
Change is inevitable... Change for the better is not.
September 25, 2019 at 5:01 am
Hope this will help.
-- Database Restore History
SELECT rh.destination_database_name AS [Database],
CASE WHEN rh.restore_type = 'D' THEN 'Database'
WHEN rh.restore_type = 'F' THEN 'File'
WHEN rh.restore_type = 'I' THEN 'Differential'
WHEN rh.restore_type = 'L' THEN 'Log'
ELSE rh.restore_type
END AS [Restore Type],
rh.restore_date AS [Restore Date],
bmf.physical_device_name AS [Source],
rf.destination_phys_name AS [Restore File],
rh.user_name AS [Restored By]
FROM msdb.dbo.restorehistory rh
INNER JOIN msdb.dbo.backupset bs ON rh.backup_set_id = bs.backup_set_id
INNER JOIN msdb.dbo.restorefile rf ON rh.restore_history_id = rf.restore_history_id
INNER JOIN msdb.dbo.backupmediafamily bmf ON bmf.media_set_id = bs.media_set_id
ORDER BY rh.restore_history_id DESC
Query credit : https://www.sqlshack.com/how-to-get-a-sql-database-restore-history/
-- Database Backup History
SELECT CONVERT(CHAR(100), SERVERPROPERTY('Servername')) AS Server,
msdb.dbo.backupset.database_name,
msdb.dbo.backupset.backup_start_date,
msdb.dbo.backupset.backup_finish_date,
msdb.dbo.backupset.expiration_date,
CASE msdb..backupset.type
WHEN 'D' THEN 'Database'
WHEN 'L' THEN 'Log'
END AS backup_type,
msdb.dbo.backupset.backup_size,
msdb.dbo.backupmediafamily.logical_device_name,
msdb.dbo.backupmediafamily.physical_device_name,
msdb.dbo.backupset.name AS backupset_name,
msdb.dbo.backupset.description
FROM msdb.dbo.backupmediafamily
INNER JOIN msdb.dbo.backupset ON msdb.dbo.backupmediafamily.media_set_id = msdb.dbo.backupset.media_set_id
WHERE (CONVERT(datetime, msdb.dbo.backupset.backup_start_date, 102) >= GETDATE() - 7)
ORDER BY
msdb.dbo.backupset.database_name,
msdb.dbo.backupset.backup_finish_date
Query credit : https://www.mssqltips.com/sqlservertip/1601/script-to-retrieve-sql-server-database-backup-history-and-no-backups/
October 1, 2019 at 3:14 am
Thanks Guys
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy