DBCC CHECKDB('DB Name', REPAIR_REBUILD).

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

More Related Resource Links

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

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.]

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

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

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.

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).

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:

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?

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.ÃÂ

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.

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

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 !