SQLTeam.com | Weblogs | Forums

Database Corruption on a VM Instance


#1

This is 2008 R2. SP2 Server has 32 GB memory and the database is small - 50 GB

Several tables reflect inconsistency errors.

This is a virtualized machine (VMware)
What are some of the possible causes to table\index corruption on a VM, virtual storage?

(I know what to do to resolve the corruption... I'm looking for the root cause)

Thanks.


#2

what's in the Windows and SQL logs? Look for errors or unexpected shutdowns or startups. Could also be real disk errors,


#3

There could be several reasons behind a SQL database corruption:

Try executing below command to repair the table in SQL Server :

dbcc checktable('databasename', repair_allow_data_loss)

If the corruption still persists after running the above command then read the following article for further options: sqltechtips.blogspot.com/2017/06/how-to-fix-corrupted-table.html


#4

So this is not for you :slight_smile: but for the next person that might stumble over this:

Under no circumstances use the repair_allow_data_loss option until you have exhausted all other possibilities. Its quite clear what it is going to do, from the name, but IME plenty of people use it before they have figured out a way back again ...


#5

In my case, the corruption was merely duplicate rows. The index was corrupted and once I deleted the duplicates, CHECKDB showed no corruption. I suppose had i ran repair with data loss that might have removed the dupl rows but I'm hesitant to do that. It's ok now. Thanks