Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 598
  • Last Modified:

check if there is any damage / issues with database

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.
0
25112
Asked:
25112
6 Solutions
 
aadi369Commented:
Best step :)


Run consistency check for the sql database. This wil show you error on sql database, if any.
0
 
DcpKingCommented:
First off, do a backup!

Then use the DBCC tool (ref here):

DBCC CHECKDB <databasename> WITH ALLERRORMESSAGES

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.

hth

Mike
0
 
25112Author Commented:
so DBCC is enough.. no extra tools needed?
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
sameer2010Commented:
0
 
David ToddSenior DBACommented:
Hi

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

Regards
  David
0
 
DcpKingCommented:
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.
0
 
Scott PletcherSenior DBACommented:
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).
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now