check if there is any damage / issues with database

Posted on 2012-09-10
Last Modified: 2012-09-19
the hard drive crashed and then came up again after a tool was run.

how /what can we run to make sure the SQL database is fine in every way., other than running select statements.
Question by:25112
    LVL 6

    Assisted Solution

    Best step :)

    Run consistency check for the sql database. This wil show you error on sql database, if any.
    LVL 16

    Assisted Solution

    First off, do a backup!

    Then use the DBCC tool (ref here):


    There are also CheckAlloc, CheckCatalog, CheckConstraints, CheckFilegroup, CheckIdent, CheckTable options, as you'll see in the ref.

    DBC also has repair options if it does find problems - I'd recommend doing some of the checks above and coming back here if you have any problems.


    LVL 5

    Author Comment

    so DBCC is enough.. no extra tools needed?
    LVL 13

    Assisted Solution

    LVL 35

    Assisted Solution

    by:David Todd

    Paul Randall who managed dbcc checkdb a few versions ago states that it should be run as often as a full backup.

    LVL 16

    Assisted Solution

    DBCC will do most of what you want, as you're trying right now to find out if your system is already damaged. Going forwards look up things like Torn Page Detection and backing up with a checksum (which tries to ensure your backup gt to disk correctly). As others have said, look at blogs by Paul Randall (SQLSkills) and also products from Red Gate and Idera.
    LVL 68

    Accepted Solution

    Yes, DBCC CHECKDB should be good enough to find any/all issues.

    Personally, I would store the DBCC CHECKDB results in a table for later use/analysis.

    For non-clus indexes, you can just drop and (re)create the index (other uses of the table will be restricted during that time, unless you do an online rebuild, but presumably you're initially not allowing apps in anyway, just verifying your dbs' statuses).

    For clus indexes, you must repair the table or restore it (if you have an appropriate backup).

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
    Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
    Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
    Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now