x

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

more ▼

asked Jan 09 at 06:49 PM in Default

avatar image

shamim007
170 5

Can you define what a "sanity" check is to you?

Jan 09 at 07:01 PM JohnM
(comments are locked)
10|1200 characters needed characters left

3 answers: sort voted first

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;
more ▼

answered Jan 10 at 09:54 AM

avatar image

David Wimbush
10.7k 30 34 43

Jan 10 at 03:49 PM ThomasRushton ♦♦
(comments are locked)
10|1200 characters needed characters left

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/

more ▼

answered Jan 12 at 05:43 AM

avatar image

jason_clark03
415 3 7

(comments are locked)
10|1200 characters needed characters left

DBCC CHECKDB [YOUR DB NAME]

more ▼

answered Jan 12 at 06:26 AM

avatar image

dumbdba
11 1

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x2130
x82

asked: Jan 09 at 06:49 PM

Seen: 60 times

Last Updated: Jan 12 at 06:26 AM

Copyright 2016 Redgate Software. Privacy Policy