How to Resolve MS SQL Error 8930?
Summary: When running the DBCC CHECKDB command for repairing a corrupt database, you may get the error 8930. In this post, you will learn how to resolve the error message 8930 in SQL Server. You’ll also get to know an advanced SQL database repair software that can repair corrupt database as well as backup files with ease.
MS SQL Server offers DBCC CHECKDB commands to check and repair corrupt or damaged databases. However, sometimes, when you run this command to repair the database, it fails and throws an error. The error message may look like this:
Msg 8930, Level 16, State 1, Line 1 Database error: Database 1 has inconsistent metadata. This error cannot be repaired and prevents further DBCC processing. Please restore from a backup.
The error message indicates that corruption in metadata resulted in the failure of the DBCC command. The metadata contains the catalogs and information about the tables. It stores information about the structure and database objects. For example, the system tables contain information about user tables, and the table sys.objects view contains information about tables, stored procedures, views, and other objects.
This error may occur due to different reasons, like hardware damage, software failure, etc. Let’s see how to fix this error and recover the data from a corrupt database.
How to Fix MS SQL Error 8930?
If the metadata is corrupt, you will not be able to work with the database. Unfortunately, you cannot repair the database using the DBCC command when this problem occurs. That is why you need to restore the data from the backup.
The backup is a file that contains a copy of the data and it also includes the metadata of SQL Server databases. You can restore your database to the date of the backup. If you have a transaction log, you can restore the data by entering the date and time.
To restore the database from the backup, follow the given steps:
- Open SQL Server Management Studio (SSMS).
- Connect to the SQL Server instance.
- In Object Explorer, right-click on the Databases option and select the Restore Database option.
- Select the Device option and then click on ellipses (…) to locate the backup file.
- Click Add and browse to the location where your backup (.bak) file is located.
- Select the file and then click OK.
- Again click on OK to close the Select Backup Devices window.
- Click OK to restore the database backup.
Alternatively, you can use the following Transact-SQL command to restore the database backup:
RESTORE DATABASE [StellarDB]
FROM DISK = N’C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQL\Backup\StellarDB.bak’ WITH FILE = 1, NOUNLOAD, STATS = 5;
What if the Backup is not Available?
If the backup is corrupt or not available, then the only option is to repair the corrupt database or backup file by using a third-party SQL database repair software, such as Stellar Repair for MS SQL – Technician. This software can easily repair the corrupt SQL Server database backup file and recover all its objects with complete integrity.
To repair the SQL database backup file using the software, follow these steps:
- Open the software and select the Extract from MSSQL Backup option.
- Click the Select Backup icon.
- You will see two options Find and Browse. You can search for the backup file using the Find option if you don’t know the file location. Else, you can click the Browse button and select the backup file.
- After selecting the backup file, press the Scan button.
- Select the Standard Scan mode.
- Select the data that you want to restore and press Next. If you want to recover only a few tables, you can select individual tables.
- Then, click the Save button.
- You can save the data in,
- New database
- Live database (an existing database)
- Other formats, such as Excel, CSV, etc. (to save the data of specific tables)
The error 8930 occurs when you try to repair a corrupt database using the DBCC CHECKDB command in SQL Server. This happens when the metadata is damaged or corrupted. In such a case, you cannot repair the database using the DBCC CHECKDB command. So, the only option is to recover the database from a recent healthy backup. However, if the backup is not available or corrupt, you can use Stellar Repair for MS SQL to repair the corrupt database or the backup itself.