December 22, 2008 at 3:34 pm
Is there a way to determine which bak was used in a restore of a database.
i.e if i used test1234.bak to restore databass TEST
Can i find this information in any system file .
Thanks
December 22, 2008 at 4:51 pm
It might be in the SQL Server Logs.
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
December 22, 2008 at 5:20 pm
If it's not in the logs, I think you're stuck.
http://msdn.microsoft.com/en-us/library/ms187408(SQL.90).aspx
December 22, 2008 at 5:31 pm
Use msdb;
Select *
From dbo.restorehistory r
Inner Join dbo.backupset b2 On b2.backup_set_id = r.backup_set_id
Inner Join dbo.backupmediaset b3 On b3.media_set_id = b2.media_set_id
Inner Join dbo.backupmediafamily b4 On b4.media_set_id = b3.media_set_id
Jeffrey Williams
“We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”
― Charles R. Swindoll
How to post questions to get better answers faster
Managing Transaction Logs
December 22, 2008 at 7:22 pm
Neat query Jeffery. 🙂
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
December 22, 2008 at 9:09 pm
That works if you're restoring same server, but if this were DR or on another box, you wouldn't know, would you?
December 22, 2008 at 9:15 pm
Nice Query Jeffery, its very useful. Thank you [:)]
December 22, 2008 at 9:34 pm
Hi Steve,
I have tried restoing a test database from a network backup and still it works. It gives the phisical_device_name as network backup location \\servername\backupshare\backupfilename.
Please correct me if I misunderstood your question.
Regards,
Rajini
December 22, 2008 at 10:24 pm
Steve Jones - Editor (12/22/2008)
That works if you're restoring same server, but if this were DR or on another box, you wouldn't know, would you?
As long as you are not restoring msdb - then it should work. This should show the restore history on the system you run it.
Jeffrey Williams
“We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”
― Charles R. Swindoll
How to post questions to get better answers faster
Managing Transaction Logs
December 23, 2008 at 1:33 am
Good query by Jeffery. Yes it will work untill the msdb is not restored post user database restoration.
December 23, 2008 at 8:32 am
Thanks for the details.
December 23, 2008 at 8:46 am
I had to just confess i restored the wrong DB....ouch that hurts.
December 25, 2008 at 11:18 pm
Viewing 13 posts - 1 through 12 (of 12 total)
You must be logged in to reply to this topic. Login to reply