General database information

  • 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

  • How is your failover database refreshed?



    Alvin Ramard
    Memphis PASS Chapter[/url]

    All my SSC forum answers come with a money back guarantee. If you didn't like the answer then I'll gladly refund what you paid for it.

    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]

  • 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