October 20, 2009 at 7:05 am
Is there a tSQL command to see when the database was last restored in place? (or created)
October 20, 2009 at 7:36 am
The msdb database has a history of backups and restores. The system tables in there are pretty easy to work with.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
October 20, 2009 at 7:42 am
The msdb.dbo.restorehistory Table has the info regarding the restorations done on that SQL Instance, check that out.
Blog -- LearnSQLWithBru
Join on Facebook Page Facebook.comLearnSQLWithBru
Twitter -- BruMedishetty
October 20, 2009 at 7:45 am
restorehistory - http://msdn.microsoft.com/en-us/library/ms186782.aspx
October 20, 2009 at 7:58 am
Perfect!
Thanks.
October 20, 2009 at 8:19 am
How do I explore other MSDB tables?
When I see under System tables, I do not see any of the tables, including the restorehistory table.
I see only these tables:
MSreplication_options
spt_fallback_db
spt_fallback_dev
spt_fallback_usg
spt_monitor
spt_values.
And what are these spt tables? if I do
select * from msdb.dbo.spt_fallback_db, it gives error "Invalid object name 'msdb.dbo.spt_fallback_db'"
October 20, 2009 at 9:36 am
Then it must be the case that you do not have the required permissions on the Database
Blog -- LearnSQLWithBru
Join on Facebook Page Facebook.comLearnSQLWithBru
Twitter -- BruMedishetty
October 20, 2009 at 3:19 pm
If I have permission to access restorehistory table, I would have thought I would have had permission for the other system tables there, too.
What is the permission that is required for system tables?
Dan
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply