Applies to:
SQL Server 2005 onwards. |
||
|
||
Summary:
This article explains how to manage an consistency / integrity / DBCC CHECKDB error. |
||
|
||
Details:
A data base may become corrupt. In this case, the HDS won’t be able to write to it. After the first attempt, the HDS disconnects from the database. It reconnects and attempts to write but then it displays an error like this: ‘Microsoft OLE DB Provider for SQL Server’ ‘SQL Server detected a logical error about I/O consistency. The error ID of the faulty page (ID of expected page: 1:415850; ID if actual page: 0:0) occurred during an operation to read the page (1:415850) in the database with ID 5 to the level of the shift 0x000000cb0d4000 in the file ‘D:\Databases\GTB_DB_L.mdf.’ You may find further information in the messages that appear in SQL Server’s error log and the system journal. This amounts to a severe error condition that threatens database integrity and must be corrected at once. Do a complete audit of the of the database’s consistency (DBCC CHECKDB). This error can arise from various factors; for further information, see the online documentation for SQL Server. (80004005=E_FAIL) The error is quite serious and can cause loss of data. There are two options: 1. Delete the database (with loss of all data). 2. Try to recover the database, as follows.
Use ‘DatabaseName’ GO DBCC CHECKDB (‘DatabaseName’) with ALL_ERRORMSGS GO The execution time of the script depends on the size of the database (up to 4 hours). All errors will be displayed in the Results window. The messages are explicit. If you notice that the command found errors but could not correct them, you will have to run a second script. f. WARNING Only execute this script if the previous step has failed. –Locate the right database. Use DatabaseName GO –Put the database in single–user mode –that will break all other connections to the database ALTER DATABASE DatabaseName SET SINGLE_USER GO DBCC CHECKDB (‘DatabaseName’, REPAIR_REBUILD) with ALL_ERRORMSGS GO –Return the database to multi-user mode The execution time of this script is much longer than that of the first (since this one rebuilds the indexes). All errors will be displayed in the Results window. The messages are relatively explicit. If error messages continue then the database is definitely in a bad state. Data corruption errors most usually occur on the indexes. They cause serious errors only during data writing operations (misreads are much less likely). So if the project data are critical, please follow the following steps 1. Export the database with the help of SQL Server Management Studio wizard. 2. Delete the database. 3. Restart PcVue to recreate the database. 4. Stop PcVue. 5. Re-import the exported data. |
||
|
||
|
Created on: 29 Jul 2011 Last update: 04 Sep 2024