Skip to main content

Questions tagged [dbcc]

DBCC is a T-SQL statement provided by SQL Server. This tag is used for questions regarding DBCC and its use.

4 votes
1 answer
667 views

What is Microsoft SQL Server doing when I manually reduce the file size in Database Properties > Files?

In Microsoft SQL Server I can go into Database Properties > Files and change the Size of a file to a lower number. If there's space available, it will actually reduce the file's size, and never ...
user avatar
0 votes
0 answers
77 views

DBCC CHECKDB DATABASENAME ERROR TIMEOUT

I am on SQL Server 2019 and running into the following error. The database in question is in SINGLE_USER mode. DBCC results for 'CourierComplete'. Msg -2, Level 11, State 0, Line 0 Execution Timeout ...
Abdi Abdullah's user avatar
0 votes
2 answers
225 views

What to attempt when REPAIR_ALLOW_DATA_LOSS fails in reparing a corrupted db?

I have a corrupted DB, I do not know the cause, it is a DB of an application whose distributor never had this kind of corruption. So I tried DBCC with REPAIR_ALLOW_DATA_LOSS as suggested in: An ...
user193655's user avatar
0 votes
0 answers
72 views

dbcc checkdb - how to work out the resources needed?

Integrity checks are important on a regular basis to find out errors. Even on servers involved in availability groups. we can normally find out how long it took to run? It is a known fact that dbcc ...
Marcello Miorelli's user avatar
1 vote
1 answer
54 views

SQL Server 2008R2 - data file grows back after shrinking and available to shrink again

After shrinking of datafile there is around 180Gb of free space on hard drive (prior to operation shrink file dialog also shows that it is possible to free up around 180Gb of space). After 1-2 days ...
Andrew B's user avatar
  • 113
0 votes
1 answer
62 views

Is DBCC CHECKFILEGROUP worthless if you already run DBCC CHECKDB on all databases?

DBCC CHECKDB makes many other integrity checks redundant, but I can't see anything in the documentation saying if it makes DBCC CHECKFILEGROUP redundant. Is DBCC CHECKFILEGROUP worthless if you ...
J. Mini's user avatar
  • 1,276
0 votes
2 answers
177 views

Should I stop replication logreader and distribution jobs during database maintenance (reindexing, updating stats, and checkdb)?

I have transactional replication setup in SQL Server 2022. I have a distribution server running push subscriptions to subscribers. I'm trying to figure out if I need to stop replication jobs (log ...
dba_gal's user avatar
5 votes
1 answer
2k views

how to kill a rogue spid that is already killed?

I have an obstinate spid that I cannot kill and it is preventing the transaction log of my tempdb to get truncated this is how I found this rogue spid: if object_id('tempdb..#OpenTranStatus','U') is ...
Marcello Miorelli's user avatar
1 vote
1 answer
1k views

How to fix table with corrupt rows

I was inserting records into a table, when I suddenly got disconnected from the DB server When I tried doing a row count on the table, I got a fatal error 824 I tried DBCC CHECKTABLE and it indicated ...
user avatar
5 votes
1 answer
517 views

DBCC CLONEDATABASE & User Defined Table Types conflict

I am using DBCC CLONEDATABASE to create database copies without data. There are a number of databases that will not clone. The error message is: Cannot insert duplicate key row in object 'sys....
beehive's user avatar
  • 179
0 votes
1 answer
112 views

DBCC RESULTS - 1719 Errors - how best to proceed with repair

A production database which is continually updated with external data has reported following an integrity check 1719 errors. These can be grouped into: 116 x <Dbcc ID="1" Error="8909&...
Damo's user avatar
  • 193
1 vote
1 answer
113 views

Can't drop and recreate FK in SQL

I have a DBCC check that will always fail with the following error: Msg 8992, Level 16, State 1, Line 2 Check Catalog Msg 3853, State 1: Attribute (referenced_object_id=517752334,key_index_id=1) of ...
Dominic Legendre's user avatar
0 votes
1 answer
211 views

DBCC CLONEDATABASE called from stored procedure fails

SQL Server 2019 DBCC CLONEDATABASE runs successfully when issued in a query window ... but when called from a stored procedure, fails with "User 'dbo' does not have permission to run DBCC ...
Ollie2308's user avatar
3 votes
1 answer
177 views

Formula for memory grant for DBCC CHECKDB

How is the memory grant for a DBCC checkdb determined (other than the max size for memory grants which is from resource governor, possibly the default pool)? I'm not trying to solve a specific problem....
xhr489's user avatar
  • 827
2 votes
1 answer
2k views

DBCC CLONEDATABASE returns error: Cannot insert duplicate key row in object 'sys.syssingleobjrefs

I'm trying to run the following line of code: DBCC CLONEDATABASE ([DBName],[DBName_Staging]) WITH VERIFY_CLONEDB And I'm getting the following error: Msg 2601, Level 14, State 1, Line 15 Cannot insert ...
Kenneth Fisher's user avatar

15 30 50 per page
1
2 3 4 5
10