Showing posts with label corruption in sql server. Show all posts
Showing posts with label corruption in sql server. Show all posts

Tuesday, December 21, 2010

How to Restore SQL Server Database When DBCC CHECKDB Fail?

We have a client who uses Microsoft Dynamics NAV with a SQL 2005 database. Six days ago they started getting consistency errors in their database. We had restore from the last updated backup, and that seemed to fix the issue.

Yesterday they again started getting consistency errors in different area of the database. After everyone was off, I ran a DBCC CHECKDB command on the database with REPAIR_ALLOW_DATALOSS (the minimum level stated in the first CHECKDB I ran), and it failed to restore.

Here is a partial list of the results;

DBCC results for 'NAVSQL'.
Service Broker Msg 9675, State 1: Message Types analyzed: 14.
Service Broker Msg 9676, State 1: Service Contracts analyzed: 6.
Service Broker Msg 9667, State 1: Services analyzed: 3.
Service Broker Msg 9668, State 1: Service Queues analyzed: 3.
Service Broker Msg 9669, State 1: Conversation Endpoints analyzed: 0.
Service Broker Msg 9674, State 1: Conversation Groups analyzed: 0.
Service Broker Msg 9670, State 1: Remote Service Bindings analyzed: 0.
Msg 8909, Level 16, State 1, Line 1
Table error: Object ID 0, index ID -1, partition ID 0, alloc unit ID 281498259750912 (type Unknown), page ID (3:2179484) contains an incorrect page ID in its page header. The PageId in the page header = (8192:65536).
Repairing this error requires other errors to be corrected first.
Msg 8939, Level 16, State 98, Line 1
Table error: Object ID 0, index ID -1, partition ID 0, alloc unit ID 3906872676743905280 (type Unknown), page (34749:0). Test (IS_OFF (BUF_IOERR, pBUF->bstat)) failed. Values are 46139657 and -4.
The repair level on the DBCC statement caused this repair to be bypassed.
Msg 8909, Level 16, State 1, Line 1
Table error: Object ID 0, index ID -1, partition ID 0, alloc unit ID 5641040008258584576 (type Unknown), page ID (4:675855) contains an incorrect page ID in its page header. The PageId in the page header = (256:10150144).
Repairing this error requires other errors to be corrected first.
CHECKDB found 0 allocation errors and 3 consistency errors not associated with any single object.
DBCC results for 'sys.sysrowsetcolumns'.
There are 32308 rows in 186 pages for object "sys.sysrowsetcolumns".

...

CHECKDB found 0 allocation errors and 44 consistency errors in database 'NAVSQL'.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.

At last we used stellar sql recovery software to fix the problem. Stellar SQL recovery software is an advanced tool that repair and recover corrupted sql server database. This software is compatible with window 7.
»»  Read More...

Wednesday, October 27, 2010

How to recover MDF file when you encounter Error 8910 in MS SQL Server 2000

Are you getting error messages repeatedly while working on a particular database in MS SQL Server 2000? If yes, then you should check the exact cause of these messages as there may be chances of database corruption. The database corruption can happen due to various reasons including virus infections, malfunctioning of the hardware components, abrupt or unplanned system shutdown while the database is open, etc, which could even make the database inaccessibile. In such cases, you should look for MDF file recovery using appropriate corrective methods, failing which you must use a third-party MS SQL Server recovery software to do the needful.

Let us consider a situation in which you are getting the following error message while working on an MS SQL Server 2000 database:

"Page P_ID in database ID DB_ID is allocated to both object ID O_ID1, index ID I_ID1, and object ID O_ID2, index ID I_ID2."


Cause
:

The most prominent reason behind this error is that the index definitions in the IAM pages have damaged.

Resolution:

To perform MDF recovery of the damaged SQL database, you should perform either of the following methods, ideally in the given sequence:

Address hardware related issues: It may be possible that the error is occurring due to hardware corruption, which can be resolved using the following measures:

Fixing the issues that appear after running hardware diagnostics.
Swapping the hardware components to isolate the exact reason and fixing it.
Checking the Windows application log and the SQL Server error log to find out whether the error has occurred due to hardware malfunctioning.
Checking if the hard disk has write-caching enabled. If yes, then contact the hardware vendor to replace the hard disk.

Restore from database: You should check the state of the database backup. If it is updated and clean, then you should restore the database with its backup.

Run DBCC CHECKDB: If the backup is not clean, then you should run the DBCC CHECKDB tool with the suggested repair clause to recover MDF file.

If these aforementioned methods are unable to address the situation, then you would need to take the services of a third-party master database file recovery software. With the use of read-only recovery mechanisms, these SQL recovery tools ensure that no type of data is lost or damaged during the recovery.

In such cases, I would recommend you to use Stellar Phoenix SQL Data Recovery, which recovers SQL databases created in MS SQL Server 7.0, 2000, 2005, and 2008. Performing .MDF recovery by recovering databases components including NDF files, stored procedures, tables, defaults, triggers, etc, this SQL database recovery software is compatible with Windows 7, Server 2008, Vista, Server 2003, XP, and 2000.
»»  Read More...

Wednesday, October 13, 2010

Recover SQL server database from error or corruption


All the rows of table in the SQL server database are divided into partitions that are represented by number from 1 to n. By default SQL server consider all rows are in a single partition. All the rows of table partition are stored in heap structure or Binary tree. Leaves are used to store the data. The data stored in leaf nodes of leaves are called text data node and other nodes are called text index nodes. Text index nodes are used to store index values for leaf node. Sometimes, you observe that mismatch between the child nodes and their corresponding parents nodes that result table inconsistency. At that time you will be unable to access your database and got an error message. For recovering this situation you need an advanced SQL recovery software to fix the problem.

Given below an error message you might encounter with your SQL database table:

Server: Msg 8961 , Level 23, State

Table error: Object ID O_ID. The text, ntext, or image node at page P_ID1, slot S_ID1, text ID TEXT_ID does not match its reference from page P_ID2, slot S_ID2.

Where, ‘state_number’ might be 1, 2 or 4.

Causes:

The main cuase of this error is mismatch between the childs node and their corresponding parents nodes. Corruption in the text object may be also the couse of error. If you want to know the exact cause for this error message then used state_number which is displaying.

State 1: This situation occurs when timestamps in child node and parent node don’t match.

State 2: This Situation occurs when the size of child node is greater than its parent node.

State 4: This situation occurs when the level of child node is different from what is supposed by its parent node.

Resolutions:

For solving such type of error message, you should follow the given below steps:

• Fix the hardware problem, if any.

• Restore database from last updated backup, if backup is updated available.

• Run DBCC CHECKDB command without repair clause if backup is not available. Again run DBCC CHECKDB but this time with the repair clause.

After performing all the above steps and still you will unable to access your sql database, i will suggest you to use any third party sql recovery software to fix the problem.

Stellar SQL Database Recovery software is a premier tool to repair corrupted SQL server databases. This software is comfortable with the SQL Server 2008, 2005 and 2000. This recovery software repairs primary (MDF) as well as secondary (NDF) files in sql server database.
»»  Read More...