.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Post New Web Links

DBCC CHECKDB('DB Name', REPAIR_REBUILD).

Posted By:      Posted Date: September 09, 2010    Points: 0   Category :Sql Server
 
    Do I have to run the DBCC CHECKDB('DB Name', REPAIR_REBUILD) in single user mode, have no users using the DB?  Not sure. If I have no users using the DB, can I still run without putting the server in single user mode?      Thanks for help   


View Complete Post


More Related Resource Links

Stack Dump generated on the db and SQL tipped over DBCC CHECKDB came out clean

  
We have Profile db for sharepoint 2010 and the SQL tipped over just before which it generated the below dump. The DBCC CHECKDB on the database came out clean. The SQL Server is SQL 2008 SP1 CU5 and the memory on the server is 32GB with max. for SQL Server being 26 GB.  What could have caused this? There is nothing in the error log prior to this dump. name                                minimum     maximum     config_value run_value ----------------------------------- ----------- ----------- ------------ ----------- access check cache bucket count     0           65536       0            0 access check cache quota            0           2147483647  0            0 Ad Hoc Distributed Queries          0           1           0

Should DR testing include DBCC CheckDB

  
We have EMC storage and use SRDFa to replicate production data to another location.  In the coming weeks we'll be doing some DR testing that will involve interrupting replication, then mounting the 'DR' storage on our staging servers.  I'll attach the databases and testing will begin.  I'm wondering if standard practice should include running DBCC CheckDB against the 'recovered' databases before turning them over to the users. [We're running SQL 2005 SP2 Enterprise (64-bit) on a 6 node Active-Passive cluster.  The OS is Win 2003.]

Database temporary corruption - DBCC CHECKDB error

  
I've run into a very strange and frustrating recurring error. I have a Single instance SQL Server 2005 DBMS on Win2K3 Server x86.  The problem occurs with a *single* database on the system, the other databases are unaffected.  We primarily access this database for editing through an Access 2007 data project, though it's accessed (select only) from many places using odbc or oledb. Basically some sort of corruption (or apparent corruption) occurs after a server update and reboot (usually unrelated to the DB software).  After that, the database is fine sometimes, other times it is fine until we try to access it via the ADP.  At that point it becomes inaccesssible by the ADP, though it can still be accessed through all other methods.  Running DBCC CHECKDB (databasename) returns: Msg 211, Level 23, State 51, Line 1 Possible schema corruption. Run DBCC CHECKCATALOG. Running DBCC CHECKCATALOG (databasename) returns no errors. Restarting the database service (from inside SSMS typically) will fix it *eventually* after a few restarts.  I can find no rhyme or reason to the apparent corruption.  I'll be glad to look and post any other log entries that might be relevant.  I should note that the database was originally created way back in SQL Server 7, though it's got no real customizations, triggers, and very few constraints on it.  It's

DBCC CHECKDB Blocking Itself SQL 2008 MSCRM

  
Hello I've got a nightly job that runs DBCC CHECKDB WITH TABLERESULTS for all databases, using sp_msforeachdb, and then saves the results into a table, tidies them up, and then disappears off. On my test MSCRM database, the DBCC CHECKDB command is blocking itself. The only way to resolve this self-blocking seems to be to restart SQL. sp_who2 won't execute, but sp_who does. DBCC INPUTBUFFER tells me that it's the stored procedure I'm executing causing the blocking.  A bit more searching into sys.dm_os_waiting_tasks and and sys.dm_exec_connections suggests that this piece of code is causing the problem: DECLARE @BlobEater VARBINARY(8000)   SELECT @BlobEater = CheckIndex (ROWSET_COLUMN_FACT_BLOB)  FROM { IRowset 0xE093909D00000000 }  GROUP BY ROWSET_COLUMN_FACT_KEY  >> WITH ORDER BY    ROWSET_COLUMN_FACT_KEY,    ROWSET_COLUMN_SLOT_ID,    ROWSET_COLUMN_COMBINED_ID,    ROWSET_COLUMN_FACT_BLOB  OPTION (ORDER GROUP)  with a wait_type of LCK_M_IX the resource type is objectlock lockPartition=0 objid=34 subresource=FULL dbid=2 id=lock8defbd80 mode=SIX associatedObjectId=34 Trying to rollback the transaction doesn't help: it just sits in a rollback sort of a state. Trying to stop SQL doesn't work too well: going into Task Manager on the Server and killing the sqlserver.exe pr

Does DBCC CHECKDB without additional arguments perform repairs if there is a consistency problem?

  
Does DBCC CHECKDB without additional arguments perform repairs if there is a consistency problem?

For example DBCC CHECKDB REPAIR_REBUILD?
Mr Shaw

DBCC CHECKDB

  

does  DBCC CHECKDB  actually repair the SQL Database??

if so, could someone give me code on using the command?

 

 

 I am using the Express version of SQL Server, 2008.

 

 


Running Dbcc CheckDB on Production Server databases.

  

Hi Guys 

I am new to SQL Server Administration. I have set up the Backup jobs according to the requirements from the Application team. Also I have set tip the  update stats, Reindexing Job every 2 weeks as far as the maintenance as maintenance is concerned. I am using  SQL Scripts in the SQL Agent to perform all these jobs

But i have not scheduled any Integrity Check (CheckDB ) Jobs on any of the database in any of the servers. I have databases of Size 1Gb-50 GB and few from 100-600 Gb. 

I want to set up the integrity jobs on all the databases. Can you please suggest me some best ways how I can schedule jobs every 2 or 3 weeks on small databases and on big databases like 100 - 600 GB in SQL Server 2005,2008. 

 

Thanks 

 


Downside of Regular DBCC SHRINKFILE (compact) and DBCC CHECKDB (repair)

  

Having come from the MS Access world, many people wonder if there is a similar tool in SQL Server or SQL Server Express that mimics the Access Compact & Repair.

Although it is possible, I've read that it is not best policy to regularly compact and repair SQL Server databases using DBCC SHRINKFILE (compact) and DBCC CHECKDB (repair).

Can anyone tell me why running these commands would be a bad thing?  What would be a better plan of attack especially for small companies with minimal staff and maybe not even a resident DBA (i.e. typical users of SQL Server Express).

Thanks.


I ran dbcc checkdb on one testdatabase ,getting following errors, how to fix it?

  

Hi Friends,

could you please provide the solution for below error,

Msg 8939, Level 16, State 98, Line 1

Table error: Object ID 0, index ID -1, partition ID 0, alloc unit ID -8646911284551352320 (type Unknown), page (289:0). Test (IS_OFF (BUF_IOERR, pBUF->bstat)) failed. Values are 62916873 and -1.

Repairing this error requires other errors to be corrected first.

Msg 8909, Level 16, State 1, Line 1

Table error: Object ID 0, index ID -1, partition ID 0, alloc unit ID -8646673261154795520 (type Unknown), page ID (3:240120) contains an incorrect page ID in its page header. The PageId in the page header = (0:34871552).

Repairing this error requires other errors to be corrected first.

Msg 8909, Level 16, State 1, Line 1

Table error: Object ID 0, index ID -1, partition ID 0, alloc unit ID -8596527261321199616 (type Unknown), page ID (3:313995) contains an incorrect page ID in its page header. The PageId in the page header = (16249:36607).

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 -8430570274608381952 (type Unknown), page (42240:-1694459136). Test (IS_OFF (BUF_IOERR, pBUF->bstat)) failed. Values are 29362441 and -1.

Repairing

DBCC CHECKDB against master DR Test on a different instance

  

As part of of the DR testing for the company I work for, we have to take a database backup file and restore it to a different instance on a different server and then run DBCC CHECKDB.  In this particular case one of the databases that needed to be tested was a master database (2008 not R2).  I recovered the 2008 database to our DR server (which already has a named 2008 instance up and running) and the restore completed successfully, however when I ran DBCC CHECKDB ('XXXXXX_master') I received the following output:

DBCC results for 'XXXXX_master'.
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.
Service Broker Msg 9605, State 1: Conversation Priorities analyzed: 0.
Msg 8992, Level 16, State 1, Line 1
Check Catalog Msg 3851, State 1: An invalid row (class=12,depid=0,depsubid=0) was found in the system table sys.syssingleobjrefs (class=12).
Msg 8992, Level 16, State 1, Line 1
Check Catalog Msg 3851,

dbcc checkdb script for many DB checking & printing out the results?

  

Hi All;

I would like to set a job for a health checking. I want to run the command DBCC CHECKDB for a number of databases. So how the script will gonna be? Is the below one is correct:

USE DB1

DBCC CHECKDB

GO

USE DB2

DBCC CHECKDB

GO

USE DB 3

DBCC CHECKDB

GO

will this run the first DB then will go to the second one? What If there is any error in the first dbcc checking? How would I know? Is there is a possiblity to send the results to Excel/.txt file for each database?


Database corrupt not able to recover by DBCC Checkdb

  

Weekly integrity check jobs for one of our critical database are failing with the following Error. We fixed the error by DBCC CHECKDB ALLOW DATALOSS. But again the integrity job is failing for other tables. When we check the object_name of objectid it wont be there in sysobjects or database. We checked the disks using chkdsk, no bad sectors found. 

Database is on SQl Server 2000 instance, having Service pack 4 applied.  Please suggest.

[1] Database XXX: Check Data and Index Linkage...        
[Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 2576: [Microsoft][ODBC SQL Server Driver][SQL Server]IAM page (0:0) is pointed to by the previous pointer of IAM page (3:51165) object ID 1275867612 index ID 0 but was not detected in the scan.            
[Microsoft][ODBC SQL Server Driver][SQL Server]IAM page (0:0) is pointed to by the previous pointer of IAM page (1:424) object ID 1275867612 index ID 9 but was not detected in the scan.                                                                     
[Microsoft][ODBC SQL Server Driver][SQL Server]IAM page (0:0) is pointed to by the previous pointer of IAM page (1:481) object ID 1275867612 index ID 10 but was not detected in the scan.                                                                    
[Microsoft][ODBC SQL Server Driver][SQL Server]IAM page (0:0) is pointed to by the previous poin

Internal error. Buffer provided to read column value is too small. Run DBCC CHECKDB to check for any

  

Hello!

I'm using Asp.NET 4 to perform a simple query on database.
But when navigating to page that needs data (i'm using SqlDataSource) i receive this internal error.
I already ran DBCC without error and i still have the issue.

Windows 2003 Standard with latest updates 32-bit
Sql Server Standard 2005 SP4

The same query, executed from SSMS works fine.


Il saggio è quello che sa di non sapere

Dbcc inputbuffer

  
Hi, Can anyone assist in troubleshooting one issue at my end. Using dbcc inputbuffer (spid) will give the current command that the process is executing. My question is how exactly we can find the exact query that the user has submitted to the sql server. The reason i was looking at it was because of some heavy blockings on the server, i used sp_who2 and found an spid which is causing huge blocking on the server. But when i used dbcc inputbuffer it is showing as an Insert command (Might be an inserts into the tempDB) and it is not the exact Insert command because the application where user's use to connect has no insert function on it. Is there any way to find the exact t-sql that the user has issued. Regards, Sandhya

DBCC physical_only can be done online?

  
DBCC physical_only can be done online? Is that a good practice to do this before you do your backups?

DBCC SQLPERF (SPINLOCKSTATS)

  
Hi, Is there any good link that descibes how to understand the output of DBCC SQLPERF (SPINLOCKSTATS). Regards, Zainu    

DBCC OPENTRAN does not report known explicitly open transactions

  
Using query analyzer, I can do simple select after BEGIN TRANSACTION, and in a separate or same session execute DBCC OPENTRAN and I get reported " no active transactions."  Tried on SS_2000 as well as SS_2008. Not sure what I am missing !   Any ideas ?      Thanks ! 
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend