Quantcast
Channel: SQLServerCentral » SQL Server 2005 » Data Corruption » Latest topics
Viewing all 227 articles
Browse latest View live

How to recover suspect database

$
0
0

Hi,

I have SQL 2005 database in suspect state. By my opinion it is damaged because of hard disk error. I’m trying to set the database in such kind of state so, that I can read undamaged data from it.

First I was tried with EXECsp_resetstatus'PIS';

and I was got the following message:

The suspect flag on the database "PIS" is already reset.

Then I was tried to use DBCC checkdb('PIS')

but I was got the message:

Msg 926, Level 14, State 1, Line 1

Database 'PIS' cannot be opened. It has been marked SUSPECT by recovery. See the SQL Server errorlog for more information.

Then I was tried to set database in emergency mode with AlterDatabase PIS SetEmergency

but I was got the following error again :

Msg 823, Level 24, State 2, Line 1

The operating system returned error 38(Dosežen je bil konec datoteke (EOF).) to SQL Server during a read at offset 0x0000000c0b8000 in file 'c:\DATA\DATA\MITIC1.mdf'. Additional messages in the SQL Server error log and system event log may provide more detail. This is a severe system-level error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online.

The database is now not suspected but in the Management Studio I see just database without any database objects.

Likewise I was tried to move database to another SQL server so, that I was restore database from older backup on the another SQL server. Then I was stopped this server and original server then I was copied original files (I have 3 files and 1 log file) over new restored files and then I was started new SQL server. The database becomes suspected with all above problems.

Does anybody has ideas or tricks how to correct this database so, that I can read good data from it?

Regards


Database Corruption problems

$
0
0
We had a server reboot the other night and it seams to have corrupted several files. I have a database in SQL Express that is corrupt and one in regular SQL that was labeled suspect. I found this on a web site for fixing suspect DB's. ALTER DATABASE koochdata SET EMERGENCYDBCC checkdb('koochdata')ALTER DATABASE koochdata SET SINGLE_USER WITH ROLLBACK IMMEDIATEDBCC CheckDB ('koochdata', REPAIR_ALLOW_DATA_LOSS)ALTER DATABASE koochdata SET MULTI_USERWhen I issue these one at a time I can see in the log files that the DB is changing status but when I run the dbcc commands I get this result.Msg 922, Level 14, State 1, Line 1Database 'KoochData' is being recovered. Waiting until recovery is finished.Query completed with errorsI haven't been able to find msg 922 anywhere. Is there a reason that dbcc doesn't want to work? It didn't leave a message in the log file just the changes in the DB status.Also. Can I use the same procedure in Sqlserver express?Thank you in advance.Quinn McCarthy

DBCC Question

$
0
0
I have a client (SQL 2008R2SP1) who run maintenance plans and reported back to me DBCC errors, unfortunately he's in SIMPLE mode, but the application has 2 week data-caching and the client has backups for several weeks.I hopped on the server and has DBCC CheckDB ('DB NAME') WITH ALL_ERRORMSGS, NO_INFOMSGS and it returned no errors, I even restored a backup and the same thing.The next step in the Maintenance Plan was a index reorg/rebuild (don't remember which), so this probably deallocated the corrupt bit.My question is now that DBCC comes back clean, I know there's still corruption somewhere in there and it's just a matter of time before SQL reallocates to that page. Is there anything I can do in the mean time? Switch the Full mode? shrink the db and do a alter index rebuild? I know how to fix it, just curious cause it seems like you have to catch it in the bad state.Also I know even I did catch it, DBCC PAGE wouldn't have worked from the backup because the pages were likely different from the rebuilt pages (post-backup rebuild).Any advice would be appreciated!/* Here's the errors, I know what they are though, post really isn't about that :) */Task start: 2012-04-01T00:30:06.Task end: 2012-04-01T00:39:18.Failed:(-1073548784) Executing the query "DBCC CHECKDB(N'FOODB') WITH NO_INFOMSGS " failed with the following error: "Object ID 1895013832, index ID 2, partition ID 72057594183090176, alloc unit ID 72057594179158016 (type In-row data): Page (1:563928) could not be processed. See other errors for details.Table error: Object ID 1895013832, index ID 2, partition ID 72057594183090176, alloc unit ID 72057594179158016 (type In-row data). Page (1:563928) was not seen in the scan although its parent (1:226755) and previous (1:563903) refer to it. Check any previous errors.Object ID 1895013832, index ID 2, partition ID 72057594183090176, alloc unit ID 72057594179158016 (type In-row data): Page (1:563929) could not be processed. See other errors for details.Table error: Object ID 1895013832, index ID 2, partition ID 72057594183090176, alloc unit ID 72057594179158016 (type In-row data). Index node page (1:226755), slot 15 refers to child page (1:563929) and previous child (1:563928), but they were not encountered.Object ID 1895013832, index ID 2, partition ID 72057594183090176, alloc unit ID 72057594179158016 (type In-row data): Page (1:563930) could not be processed. See other errors for details.Table error: Object ID 1895013832, index ID 2, partition ID 72057594183090176, alloc unit ID 72057594179158016 (type In-row data). Index node page (1:226755), slot 16 refers to child page (1:563930) and previous child (1:563929), but they were not encountered.Object ID 1895013832, index ID 2, partition ID 72057594183090176, alloc unit ID 72057594179158016 (type In-row data): Page (1:563931) could not be processed. See other errors for details.Table error: Object ID 1895013832, index ID 2, partition ID 72057594183090176, alloc unit ID 72057594179158016 (type In-row data). Index node page (1:226755), slot 17 refers to child page (1:563931) and previous child (1:563930), but they were not encountered.Object ID 1895013832, index ID 2, partition ID 72057594183090176, alloc unit ID 72057594179158016 (type In-row data): Page (1:563932) could not be processed. See other errors for details.Table error: Object ID 1895013832, index ID 2, partition ID 72057594183090176, alloc unit ID 72057594179158016 (type In-row data). Index node page (1:226755), slot 18 refers to child page (1:563932) and previous child (1:563931), but they were not encountered.Object ID 1895013832, index ID 2, partition ID 72057594183090176, alloc unit ID 72057594179158016 (type In-row data): Page (1:563933) could not be processed. See other errors for details.Table error: Object ID 1895013832, index ID 2, partition ID 72057594183090176, alloc unit ID 72057594179158016 (type In-row data). Index node page (1:226755), slot 19 refers to child page (1:563933) and previous child (1:563932), but they were not encountered.Object ID 1895013832, index ID 2, partition ID 72057594183090176, alloc unit ID 72057594179158016 (type In-row data): Page (1:563934) could not be processed. See other errors for details.Table error: Object ID 1895013832, index ID 2, partition ID 72057594183090176, alloc unit ID 72057594179158016 (type In-row data). Index node page (1:226755), slot 20 refers to child page (1:563934) and previous child (1:563933), but they were not encountered.Object ID 1895013832, index ID 2, partition ID 72057594183090176, alloc unit ID 72057594179158016 (type In-row data): Page (1:563935) could not be processed. See other errors for details.Table error: Object ID 1895013832, index ID 2, partition ID 72057594183090176, alloc unit ID 72057594179158016 (type In-row data). Index node page (1:226755), slot 21 refers to child page (1:563935) and previous child (1:563934), but they were not encountered.Table error: Object ID 1895013832, index ID 2, partition ID 72057594183090176, alloc unit ID 72057594179158016 (type In-row data). Page (1:563944) is missing a reference from previous page (1:563935). Possible chain linkage problem.CHECKDB found 0 allocation errors and 17 consistency errors in table 'FOOTABLE' (object ID 1895013832).CHECKDB found 0 allocation errors and 17 consistency errors in database 'FOODB'.repair_allow_data_loss is the minimum repair level for the errors found by DBCC CHECKDB (FOO).". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

Data from Corrupt SQL backup file

$
0
0
Hi All,Think I may already know the answer to this post, however would like others opinion on it please. I have a corrupted sql backup file that will not restore, it appears that the backup isnt complete. Is there anyway of retrieving the data? Any software? Any methods anybody has used to retrieve such data would be much aprreciated.RegardsAndy

sql server 2005

$
0
0
i have a probleme to transfer data form access to sql serverSSIS package "Package.dtsx" starting.Information: 0x4004300A at Data Flow Task, DTS.Pipeline: Validation phase is beginning.Information: 0x4004300A at Data Flow Task, DTS.Pipeline: Validation phase is beginning.Information: 0x40043006 at Data Flow Task, DTS.Pipeline: Prepare for Execute phase is beginning.Information: 0x40043007 at Data Flow Task, DTS.Pipeline: Pre-Execute phase is beginning.Error: 0xC020203B at Data Flow Task, SQL Server Destination [1]: The thread for the SSIS Bulk Insert task failed initialization.Error: 0xC004701A at Data Flow Task, DTS.Pipeline: component "SQL Server Destination" (1) failed the pre-execute phase and returned error code 0xC020203B.Information: 0x40043009 at Data Flow Task, DTS.Pipeline: Cleanup phase is beginning.Information: 0x4004300B at Data Flow Task, DTS.Pipeline: "component "SQL Server Destination" (1)" wrote 0 rows.Task failed: Data Flow TaskWarning: 0x80019002 at Package: The Execution method succeeded, but the number of errors raised (2) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.SSIS package "Package.dtsx" finished: Failure.The program '[7692] Package.dtsx: DTS' has exited with code 0 (0x0).

RESTORE detected an error on page (0:0)

$
0
0
I am trying to restore a backup taken from SQL 2005 to SQL 2008 R2. The restore process has worked countless times before, but this morning I received the error below:[quote]RESTORE detected an error on page (0:0) in database "[i]database_name[/i]" as read from the backup set.Error: 3183, Severity: 16, State: 1.[/quote]I tried a second backup file from the day before but received the same result. I ran a RESTORE VERIFYONLY on both backup files through the 2008 R2 instance and after about 10 minutes (backup file is ~100GB) received the following errors from both:[quote]Msg 3189, Level 16, State 1, Line 1Damage to the backup set was detected.Msg 3013, Level 16, State 1, Line 1VERIFY DATABASE is terminating abnormally.[/quote]CHECKDB ran clean last weekend and no I/O errors were found in the error log on 2005.At present I am re-copying the latest backup file to the 2008 R2 server thinking it could have been a corruption when copying the file around the network...however I have little hope that is the issue since I get the same result from both backups taken on consecutive nights.Any insight into what might be going on?

distribution db became suspect while replication

$
0
0
HI,We are running a transactional replication between 2 servers (push subscriber). both the distribution and subscriber DB rely on the same server.for some reason the distribution DB became "Suspect" and cannot be reached, stoping the subscriber from being update.What could be the reasons of the situation?The Distribution server, is under low-level usage (few users use it),we did not find anything weird in the sql server error logs, or the windows error log.WE didnt find any HW failure, or corrupted disk file.Any help…??Thnks,YK

Database is showing suspected mode

$
0
0
Dear Sir,The Database is showing suspected modeI/O error (torn page) detected during read at offset 0x0000003d0f4000 in file 'D:\TEST\DS1213.mdf'.plz. help me what is do ?Thanking youDebasis Bag

To Gila Monster ----now suspect database

$
0
0
Dear Sir,As per instruction we did the job and now the database is showing suspected. Now tell me wht I do..Plz help ..Thanking youDebasis Bag

read_only filegroup

$
0
0
Hi,I have a filegroup which is set to read-only. I need to set it back to read-write. When I try to modify it, it errors out with: 'An error occurred while processing 'AltFile' metadata for database...'After looking at sys.master_files, the filegroup has all redo_xxxx_lsn values set. The redo_start_lsn and redo_target_lsn is the same values, so theoretically, the filegroup is ok, but it still prevents me from changing the read-only mode.Any thoughts?Thanks.

Table data Corrupted

$
0
0
While Fetching record from a table we are getting below error for few records. Error:-Msg 823, Level 24, State 2, Line 1The operating system returned error 23(Data error (cyclic redundancy check).) to SQL Server during a read at offset 0x000000344c000 in file 'D:\DB_NAME\DB_NAME.mdf'. Additional messages in the SQL Server error log and system event log may provide more detail. This is a severe system-level error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online.After Executing DBCC CHECKTABLE ("TABLE_NAME") We are getting below error:-Msg 8966, Level 16, State 2, Line 1Unable to read and latch page (1:117) with latch type SH. 23(Data error (cyclic redundancy check).) failed. CHECKTABLE found 0 allocation errors and 1 consistency errors not associated with any single object.DBCC results for 'TABLE_NAME'.Msg 2533, Level 16, State 1, Line 1Table error: page (1:117) allocated to object ID 1606, index ID 0, partition ID 7205, alloc unit ID 72057 (type In-row data) was not seen. The page may be invalid or may have an incorrect alloc unit ID in its header.There are 932 rows in 927 pages for object "TABLE_NAME".CHECKTABLE found 0 allocation errors and 1 consistency errors in table 'TABLE_NAME' (object ID 1606).repair_allow_data_loss is the minimum repair level for the errors found by DBCC CHECKTABLE (DB_NAME.dbo.TABLE_NAME).DBCC execution completed. If DBCC printed error messages, contact your system administrator.Please advice how we could rectify this error.Regards

Zeroing out bad block?

$
0
0
I have a 2005, SP4, 64 bit, Enterprise edition server. Our Netapp crashed suddenly and when it was brought back up DBCC CHECKDB found a corruption in a table. After dropping an index and rebuilding it the CRC errors stopped. Problem solved, except that BACKUPS now fail for this database (with the same CRC errors) when the process gets to the bad block in the data file. Netapp is proposing that they zero out that block (overwrite the block with all zeros) to correct this.Will this work and will it affect the database in any way? My initial thought is that the database should be fine as this block is not currently in use by any objects, but my boss is afraid of further corrupting the data file.Your thoughts?

Error 823, Operating system error

$
0
0
We have the following error: Error: 823, Severity: 24, State: 7.Operating system error 'incorrect pageid (expected 1:216; actual 0:477691182)' resulted from attempt to read the following: sort run page (1:216), in file 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\tempdb.mdf', in database with ID 2. Sort is retrying the read.DESCRIPTION: The operating system returned error stale page (a page read returned a log sequence number (LSN) (47:398:55) that is older than the last one that was written (0:0:0)) to SQL Server during a read at offset 0x00000000290000 in file 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\tempdb.mdf'. Additional messages in the SQL Server error log and system event log may provide more detail. This is a severe system-level error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online.I ran dbcc checkdb on all databases with no errors. Our Server Administrator doesn't see any errors.Any ideas what else we should look for? Thanks very much.

Please help....index corruption issue

$
0
0
Already tried repair, rebuild, detach/attach, backup/restore (no backup prior to this error).DBCC CHECKDB generates following error messageMsg 8977, Level 16, State 1, Line 1Table error: Object ID 64719283, index ID 1, partition ID 285716419641344, alloc unit ID 285716419641344 (type In-row data). Parent node for page (1:84361) was not encountered.Msg 8934, Level 16, State 1, Line 1Table error: Object ID 64719283, index ID 1, partition ID 285716419641344, alloc unit ID 285716419641344 (type In-row data). The high key value on page (1:93719) (level 0) is not less than the low key value in the parent (0:1), slot 0 of the next page (1:84361).Much apprecaite it.Thank you.

Can't delete the Maintenanceplans

$
0
0
Hi,I'm not able to delete the maintenance plans.When I'm trying to delete the maintenance plans,facing the below error."A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 53)"When I'm trying to delete the job,facing the below error.The DELETE statement conflicted with the REFERENCE constraint "FK_subplan_job_id". The conflict occurred in database "msdb", table "dbo.sysmaintplan_subplans", column 'job_id'.The DELETE statement conflicted with the REFERENCE constraint "FK_subplan_schedule_id". The conflict occurred in database "msdb", table "dbo.sysmaintplan_subplans", column 'schedule_id'.The statement has been terminated.The statement has been terminated. (Microsoft SQL Server, Error: 547)Please advise.Thanks and Regards,Ravi.

Microsoft SQL Server Error 904

$
0
0
Hi,I am not able to access my any database whenever i try to access i get this message.Error msg:-Database 4 Cannot Be Autostarted During Server Shutdown Or Startup. (Microsoft SQL Server, Error: 904).Please help.Remarks.1.SQLserver.exe is running.2.No trace flag is used.3.Database status is ONline in(sys.databases and databasepropertyex(status)).

Unlocking resources not owned DBCC CheckDB failure

$
0
0
Problem:I got the error message -[code="plain"]Check Database Integrity Task (MANNASQL2) Check Database integrity on Local server connectionDatabases: |database list here|Include indexesTask start: 2012-06-09T03:28:56.Task end: 2012-06-09T03:55:11.Failed:(-1073548784) Executing the query "DBCC CHECKDB WITH NO_INFOMSGS " failed with the following error: "Process ID 55 attempted to unlock a resource it does not own: PAGE: 29:1:25771460. Retry the transaction, because this error may be caused by a timing condition. If the problem persists, contact the database administrator.During undoing of a logged operation in database 'TheDatabase', an error occurred at log record ID (6729214:1576:425). Typically, the specific failure is logged previously as an error in the Windows Event Log service. Restore the database or file from a backup, or repair the database.A database snapshot cannot be created because it failed to start.A database snapshot cannot be created because it failed to start.The database snapshot for online checks could not be created. Either the reason is given in a previous error or one of the underlying volumes does not support sparse files or alternate streams. Attempting to get exclusive access to run checks offline.The database could not be exclusively locked to perform the operation.Check statement aborted. The database could not be checked as a database snapshot could not be created and the database or table could not be locked. See Books Online for details of when this behavior is expected and what workarounds exist. Also see previous errors for more details.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.[/code]I located the MSDN article:http://msdn.microsoft.com/en-us/library/aa337285(v=sql.105).aspxI am running DBCC on the DR machine, a restore from a few days ago on our staging machine, and our Net Admin is copying the backups from last night to the Stage server so I can do a restore and test. I will be doing DBCC later tonight on the production server, off business hours.Background:2005 SP4 Standard.DBCC runs once weekly.No previous error from previous weeks.Windows system and application logs gave no additional information.Anyone seen this error message WITHOUT any notification of a suspect database? I will try to rerun DBCC on the production as stated, off normal hours of operation, but I am curious what I might see when I do as a heads up. Just trying to get a game plan. I have looked over the beautiful interwebs knowledge base but am lacking anything that is spot on and tells of resolution. All other testing has completed without problems and the system has been up for two days without any reported errors seen. All other logs look clean, all backup directories look clean and plenty of space allocations ready to dump files. Database that failed is only about 235GB size, on Raid 10, transferring to Raid 0. Have not seen this in the year of being here. New datamart/warehouse snapshots were recently added, though did not affect the checkdb process last weekend.

Page missing in a Clustered Index on a table

$
0
0
Running DBCC Checkdb on a database yielded the following:[quote]DBCC CHECKDB(N'MyDB') WITH NO_INFOMSGSTable error: Object ID 2057110419, index ID 1, partition ID 72057597444161536, alloc unit ID 72057597501833216 (type In-row data). Page (1:7823149) is missing a reference from previous page (1:7823150). Possible chain linkage problem.Table error: Object ID 2057110419, index ID 1, partition ID 72057597444161536, alloc unit ID 72057597501833216 (type In-row data). Page (1:7823150) was not seen in the scan although its parent (1:5720869) and previous (1:7823151) refer to it. Check any previous errors.CHECKDB found 0 allocation errors and 2 consistency errors in table 'MyTable' (object ID 2057110419).CHECKDB found 0 allocation errors and 2 consistency errors in database 'MyDB'.repair_rebuild is the minimum repair level for the errors found by DBCC CHECKDB (MyDB).[/quote](Names of DB and table changed...)Index 1 is the clustered index on this table (and also it's PK), and there are no other indexes on this table. One of the columns in the PK (the last column) is an identity column. Client says that data appears to be only inserted into the table - and that they don't have a maintenance window. The table has ~ 200 million records.I'm thinking that I should:Restore the database to a parallel database, ensure that it is a clean DB with DBCC CHECKDB, and then check the gaps on the identity column. Run the repair_rebuild on this database, and check for gaps on the identity column.Compare the gaps, and we'll know which ones need replaced.Gail, Paul, and other corruption gurus... do you see anything else that I should look into or have any other suggestions for how to handle this?Thanks in advance for taking time out of your busy day to look / respond to this.

DBCC CHECKDB Error Msg 2570, Level 16, State 3

$
0
0
[b] Over the weekend, our database received this error when the DBCC CHECKDB job ran: [/b][font="Courier New"]DateTime: 2010-09-26 23:15:08Command: DBCC CHECKDB ([NSpireDB]) WITH NO_INFOMSGS, ALL_ERRORMSGS, DATA_PURITYMsg 2570, Level 16, State 3, Server NSPIRE, Line 1Page (1:219429), slot 7 in object ID 1445580188, index ID 1, partition ID 72057594204717056, alloc unit ID 72057594208845824 (type "In-row data"). Column "insp_vol" value is out of range for data type "real". Update column to a legal value.Msg 2570, Level 16, State 3, Server NSPIRE, Line 1Page (1:219429), slot 7 in object ID 1445580188, index ID 1, partition ID 72057594204717056, alloc unit ID 72057594208845824 (type "In-row data"). Column "sys_dead_space" value is out of range for data type "real". Update column to a legal value.Msg 2570, Level 16, State 3, Server NSPIRE, Line 1Page (1:219429), slot 8 in object ID 1445580188, index ID 1, partition ID 72057594204717056, alloc unit ID 72057594208845824 (type "In-row data"). Column "insp_vol" value is out of range for data type "real". Update column to a legal value.CHECKDB found 0 allocation errors and 3 consistency errors in table 'dl_calc' (object ID 1445580188).CHECKDB found 0 allocation errors and 3 consistency errors in database 'NSpireDB'.Outcome: FailedDuration: 00:03:56DateTime: 2010-09-26 23:19:04[/font][b] I've done some research and ran the following command to narrow down the issue: [/b][code="sql"]DBCC TRACEON (3604)GODBCC PAGE (NSpireDB, 1, 219429, 3)GO [/code][b] Which printed these results about slot 7 and slot 8: [/b][font="Courier New"]Slot 7 Column 32 Offset 0xab Length 4insp_vol = 2.00386e-043 Slot 7 Column 40 Offset 0xcb Length 4sys_dead_space = 2.00386e-043 Slot 8 Column 32 Offset 0xab Length 4insp_vol = 2.00386e-043[/font][b] This data is stored in a table called [i] dl_calc [/i] in a column named [i]insp_vol[/i] that is of type [i]"real" (length 4, precision 24, scale 0)[/i]. Can someone help me with what I need to do next to fix the error message? What does that number equal in the results? Do I need to run an update statement against the rows affected? How do I determine what rows to update? Thanks! [/b]

DBCC Hangs

$
0
0
I have a 600GB DB on a SQL 2005 server that causes DBCC to stop responding when running CheckDB. This server has many other DBs on it, and DBCC checkDB is successful with those, until it gets to this one DB. DBCC never returns any kind of status or error, even with it running for 8 hours yesterday. I have databases over 1TB that run CheckDB faster.The database is set to SQL 80 compatibility, for reasons I do not know, and Simple recovery. I inherited this. It has a single data file and a single log file. The DB server is version 9.0.3353. The database is still accessible and I have had no complaints from users about it. I'm just trying to run DBCC as part of maintenance.Anyone know what's up with this?Thanks,Chris
Viewing all 227 articles
Browse latest View live