Skip to main content
16 votes
Accepted

Master database is corrupt, instance won't start - what are my options?

Here are a few avenues I would investigate. Don't do all of these (some of them are different techniques to accomplish the same purpose), but are worth considering: 1. Examine the SQL Error Log ...
BradC's user avatar
  • 10k
14 votes

MySQL relay log corrupted, how do I fix it? Tried but failed

[Fixing MySQL replication after slaves' relay log was corrupted] MySQL replication on slave (version 5.XX) has stopped. Slave_IO_Running was marked as Yes, but Slave_SQL_Running as No. Simple stop/...
Mohamed Ayas's user avatar
13 votes

Corrupt a database page in a certain table then restore it

If you really want to do this, one way is to use a hex editor as Kendra Little explains, or perhaps you would prefer Brent Ozar's take on the same approach. An alternative is to use DBCC WRITEPAGE as ...
Paul White's user avatar
  • 87k
11 votes
Accepted

How to repair corruption for "Possible chain linkage problem."

When facing database corruption, you will need to determine the extent of the problem. Do you have one corrupt table/index, or many? You will probably want to run DBCC CHECKDB on the database. ...
RDFozz's user avatar
  • 11.6k
11 votes
Accepted

How do pages get updated checksum when switching page verification mode from torn page to checksum?

It won’t happen all at once. Each page will get changed independently when it is modified through some other action (e.g. insert or update). This was done precisely so that this change would not be a ...
Aaron Bertrand's user avatar
10 votes

What is the SQL server mechanism to ensure that the page being restored isn't corrupted?

It wont. If you have a corrupted page in a backup file and you restore it, SQL will restore it (and it won't raise any error). It's your job to run checkdb frequently and make sure you do not backup ...
Dominique Boucher's user avatar
10 votes
Accepted

What is the SQL server mechanism to ensure that the page being restored isn't corrupted?

It is the responsibility of the DBA to have an adequate maintenance plan in place and to ensure the integrity of the running database and the database backups. DBCC CHECKDB() is the tool to check for ...
John K. N.'s user avatar
9 votes
Accepted

Backup detects corruption, but CHECKDB does not

This answer is taken from an issue of the SQLskills.com newsletter written by Paul Randal, about "a database which would fail a backup with page checksum errors, but passed a DBCC CHECKDB". The ...
Randolph West's user avatar
8 votes

Corrupted InnoDB table, mysqlcheck and mysqldump crash server

For what it's worth, I've found that mysqlcheck -o can effectively repair corrupted InnoDB tables since it in fact does a "recreate + analyze". I had a corrupt table that was preventing mysql from ...
Eaten by a Grue's user avatar
8 votes
Accepted

Backup Compression Causing Corruption In SQL 2017 TDE Database

It looks like this issue is with databases that have had SHRINK operations run on them. In my case, I was taking a copy of one of our production databases on SQL Server 2014 (which is already ...
Eric Cobb's user avatar
  • 561
7 votes

Random Error 824 - All Environments

82x errors are rarely, if ever, a SQL Server issue as these are all error codes on something that doesn't make sense or has errored when returning to SQL Server code. For example, with 824 this can be ...
Sean Gallardy's user avatar
6 votes

Export data using bcp to deal with corrupted data

First, here's my checklist on how to tackle corruption issues. It's a big deal - bigger than I can cover here - but based on the sounds of this, I don't think you've covered some of the basics (like ...
Brent Ozar's user avatar
6 votes

How I can corrupt a data base page and again restore the same

I love this question! To demo, I'm going to use a local copy of the Fitness database from the Stack Overflow data dump. First, make sure your database is in FULL recovery, and take a full and log ...
Erik Darling's user avatar
  • 42.1k
6 votes
Accepted

Database corruption on VM shutdown

As far as I know database corruption can happen if the machine restart in the middle of a transaction No. Database corruption is only caused by faults in the storage system or bugs. SQL Server will ...
David Browne - Microsoft's user avatar
5 votes

Table Corruption Error

Does the database open and you just can't view a single table, or are you unable to browse your database at all? Are other databases on the server affected, or just one? What's the current database ...
SqlRyan's user avatar
  • 1,228
5 votes
Accepted

How to run OPTIMIZE TABLE on a 3-node cluster?

If there is a need to run OPTIMIZE TABLE in PXC, you could achieve this by denying its recording into binary logs into one of three(3) ways: METHOD #1 SET sql_log_bin = 0; OPTIMIZE TABLE mydb....
RolandoMySQLDBA's user avatar
5 votes
Accepted

Database corruption: QueryStore internal table

As noted in my comment above I had a similar corruption issue with a query store internal table. As you yourself have suggested I used ALTER DATABASE MyDatabase SET QUERY_STORE CLEAR; to attempt to ...
Matthew McGiffen's user avatar
5 votes
Accepted

Shrink data file corruption risks?

No, shrink is safe. Unless you hit some bug in SQL Server of course, but that can happen whatever you do. The shrinkage is done as a series of mini transactions and it is also safe to terminate the ...
Tibor Karaszi's user avatar
4 votes
Accepted

Disabling SKIP_CORRUPT after using DBMS_REPAIR.SKIP_CORRUPT_BLOCKS

You can disable it with the same procedure. begin dbms_repair.skip_corrupt_blocks ( schema_name => '...', object_name => '...', object_type => dbms_repair.table_object, ...
Balazs Papp's user avatar
  • 40.8k
4 votes

sp_MSforeachdb Continue on failure when running DBCC CHECKDB

I know this is an old post, but I'm adding this answer in case someone comes across it. The most likely cause is that the error is so severe (it has a severity of 20 or higher, most likely 22, 23 or ...
HandyD's user avatar
  • 10k
4 votes
Accepted

How to repair database corruption from backup?

You don't repair it using the backup. You restore from a prior backup which is clean. I.e., the basics are, after detecting the corruption: Perform the last log backup if possible, make sure that no-...
Tibor Karaszi's user avatar
4 votes
Accepted

Random Error 824 - All Environments

Have you seen https://www.sqlservercentral.com/blogs/vmware-sql-server-823-824-alerts ? Not sure if you’re running on VMWare and which version, but there is a known issue with VMware vSphere 7.0 ...
Hans's user avatar
  • 56
3 votes

Do I face corruption issues?

If this returns nothing, then your database is fine. DBCC CHECKDB (DatabaseName) WITH NO_INFOMSGS, ALL_ERRORMSGS, EXTENDED_LOGICAL_CHECKS, DATA_PURITY
Randolph West's user avatar
3 votes
Accepted

PostgreSQL 9.1 runs into inconsistent data, but pg_dump corrects the problem?

Might be index corruption - assuming you have an index on sal_id. If so, REINDEX TABLE salXXXX; (or just REINDEX INDEX index_name would do the same trick as your dump/restore cycle, which also ...
Erwin Brandstetter's user avatar
3 votes

ANALYZE TABLE..VALIDATE STRUCTURE runs forever

UPDATE: What Worked... So after reading the link from @Raj and reading @ora-600's answer I tried to validate the database with the RMAN command backup check logical validate database;. While this ...
RBarryYoung's user avatar
  • 3,051
3 votes

Attempt to fetch logical page (5:65424) in database 2 failed

What you would hear from a lot of people is "the database is corrupt, you need to restore" without even recommending that you take some few mins to do some of the following; review your logs, find ...
daffyjeje's user avatar
  • 111
3 votes

How to verify that postgres 9.3 db has no corruption?

If you have initialized your cluster with checksum, you can control this while backuping with pg_backrest. PostgreSQL has supported page-level checksums since 9.3. If page checksums are enabled ...
Arkhena's user avatar
  • 1,580
3 votes

How to verify that postgres 9.3 db has no corruption?

If I may, there are now new tools for this: pg_verify_checksum (v 11) pg_checksum (v 12) Both can activate or deactivate checksums on the cluster as well as run checks on an offline cluster. If ...
Emeric Hunter's user avatar
3 votes
Accepted

SQL Server Corruption & Replication

Your steps are correct and you do not need to truncate or drop as you will be generating new snapshot for that one article. Few things to check: When you drop article, also drop subscription. Make ...
SqlWorldWide's user avatar
  • 13.5k
3 votes

InnoDB: Getting rid of a phantom table

The table still exists in the InnoDB dictionary. It's similar to how MySQL left temporary tables after a failed ALTER. I found that the easiest way to remove an entry from the dictionary tables is to ...
akuzminsky's user avatar
  • 4,987

Only top scored, non community-wiki answers of a minimum length are eligible