July 16, 2008 at 2:43 am
Hi
Is there an SP or something like that that I can run on a database to get some general stats back?
Namely:
Last time it was refreshed
Size
etc etc
My main focus is to find a quick way of checking whether our daily failover database refresh took place except I do not want to check logs or jobs.
Thanks in advance
July 16, 2008 at 11:40 am
How is your failover database refreshed?
For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]
July 16, 2008 at 3:23 pm
A couple of thoughts.
First, try these, they might give you some ideas:
select * from master.sys.databases
select * from (your DB name).sys.database_files
The database_files view doesn't show the actual size of the data, just the raw DB size. But if your system grows a lot, or you have the time to do a compact, you should be able to see a change.
Second, if your database is being refreshed via DTS, consider inserting a step before the refresh where a date/time value is inserted into a versioning table, said table could be easily checked to see when the system was last refreshed.
Third, and much more complicated than step 2, you could do a binary checksum on all of the tables in the database, then checksum that, and that would give you an easy comparison to see if it has changed. But if it's a big database, that could take some time. My biggest production database is about 16gig, it's on high-speed hardware, and it takes 4 minutes to checksum. If your database is in the hundreds of gigs or terabyte range, it might not be viable.
-----
[font="Arial"]Knowledge is of two kinds. We know a subject ourselves or we know where we can find information upon it. --Samuel Johnson[/font]
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply