question

shamim007 avatar image
shamim007 asked

DATABASE Sanity check

HI GURUS , i have databases from 2010,2011,2012 .i restored them without error .how do i do sanity check? need scripts to run sanity check . thank you all in advanced
sql-server-2008database-design
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Can you define what a "sanity" check is to you?
2 Likes 2 ·
David Wimbush avatar image
David Wimbush answered
I think what you need is `dbcc checkdb` ( https://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k(dbcc_checkdb_TSQL);k(sql13.swb.tsqlresults.f1);k(sql13.swb.tsqlquery.f1);k(MiscellaneousFilesProject);k(DevLang-TSQL)&rd=true). This will do a pretty thorough check that you have an intact, consistent database after a restore: dbcc checkdb('YourDatabase') with all_errormsgs;
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

jason_clark03 avatar image
jason_clark03 answered
By using DBCC Checkdb command you may easily check this. Have a look on this blog of sqlservercentral explains how to run DBCC CHECKDB: http://www.sqlservercentral.com/blogs/zoras-sql-tips/2015/07/04/how-to-run-dbcc-checkdb-to-check-sql-database-integrity/
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

dumbdba avatar image
dumbdba answered
DBCC CHECKDB [YOUR DB NAME]
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.