Questions tagged [dbcc]

DBCC stands for Database Console Commands in Transact-SQL.

The Database Console Commands (DBCC) are a series of statements in Transact-SQL programming language to check the physical and logical consistency of a Microsoft SQL Server database. These commands are also used to fix existing issues. They are also used for administration and file management.

DBCC was previously expanded as Database Consistency Checker.

Source: Wikipedia (Database Console Commands)

106 questions
0
votes
0 answers

Find out what makes DBCC CHECKDB makes database offline

We are using DBCC CHECKDB on our database since long. But from past 4-5 days, it makes our database offline. Our database size is 80GB . The drive where tempdb is located, have free space of 50GB. We had it online and it recently stopped working…
Manish Pansiniya
  • 537
  • 4
  • 14
0
votes
1 answer

DBCC SHRINKFILE with emptyfile generating filegroup is full errors

I have been using DBCC SHRINKFILE with EMPTYFILE to move data from one secondary data files data to another. There is currently four files in the filegroup and there is over 1TB free of space between those files. Oddly, I've had the system alert me…
Element Zero
  • 1,651
  • 3
  • 13
  • 31
0
votes
1 answer

Sql-DBCC Shrink database not reducing database size

I am using SQL Server express edition with 10 GB Size limit, There some table having millions + rows and I need to perform data purging operation at the end of every month, so as to free up the space and make it available for new data storage If I…
Vsagar
  • 197
  • 2
  • 17
0
votes
0 answers

MS SQL DBCC CHECKDB page ID (1:xxx) contains an incorrect page ID

Fistly, yes I'm aware that there are two options 1) is to restore or 2) run DBCC with allow data loss. But I'd like to understand what exactly is corrupted and what possible data loss could be. From DBCC CHECKDB these are the only errors Msg 8909,…
Jack0fshad0ws
  • 563
  • 1
  • 7
  • 13
0
votes
0 answers

SQL Server: Trace Flag 5556 What is it?

I have run tracestatus on our production server and found that 5556 trace flag is on. I have searched web and docs but could not find what is it. Does anyone knows what is it for? Version : Microsoft SQL Server 2016 (SP1) with file stream ON.
Decoded
  • 159
  • 1
  • 10
0
votes
1 answer

DBCC CheckDb-any ways to detect errors vb.net?

I am using the below code to check if my database has any issues/requires troubleshooting: Dim cmd As New SqlCommand("DBCC CHECKDB (offpoDb) WITH TABLERESULTS", con) Dim reader As SqlDataReader = cmd.ExecuteReader executing.Content = "Checking…
Software Dev
  • 5,368
  • 5
  • 22
  • 45
0
votes
1 answer

DBCC CheckDb - get sql messages in VB.NET

I am using this code to check my database for errors : Dim cmd As New SqlCommand("DBCC CHECKDB (offpoDb) WITH TABLERESULTS", con) cmd.ExecuteNonQuery() But, u see, this command only generates SQL messages. Is there any way to retrieve the messages…
Software Dev
  • 5,368
  • 5
  • 22
  • 45
0
votes
1 answer

Null bitmap is set when there is no null columns

I am learning PAGE structure and currently I'm stuck at the NULL bitmaps. create table dbo.ro ( ID int not null, Col1 varchar(8000) null, Col2 varchar(8000) null ); insert into dbo.ro(ID, Col1, Col2)…
Dmitrij Kultasev
  • 5,447
  • 5
  • 44
  • 88
0
votes
1 answer

Missing bytes in SQL Server data page

Did not know how to call the Title properly. However, I am trying to understand how the data pages are stored. I've created simple table: CREATE TABLE testFix ( id INT, v CHAR(10) ); INSERT INTO dbo.testFix ( id, v ) VALUES ( 1, -- id -…
Dmitrij Kultasev
  • 5,447
  • 5
  • 44
  • 88
0
votes
3 answers

SQL SERVER 2008 R2 DBCC PAGE PUZZLED

i did a test about DBCC IND and DBCC page . Engine: SQL Server 2008 Script: CREATE TABLE dbo.t2 ( ID int, Col1 varchar(10), Col2 varchar(20) ); INSERT INTO dbo.t2 SELECT 1,REPLICATE('a',10),REPLICATE('b',10) DECLARE @DBID int,@TableID…
0
votes
0 answers

Identity seed is mixed between 0 and 1 when reseeding all tables in database

**UPDATE (5/18/2017) ** I discovered the problem isn't as big as I thought it would be. This ONLY occurs after a schema has been deployed, and the migration errors out during the initial phase. The only time a schema will ever have to be deployed…
sksallaj
  • 3,872
  • 3
  • 37
  • 58
0
votes
0 answers

dbcc checkdb cause my Availability Group to failover

During maintenance plan on primary node of an Availability group, a client database has been found corrupted... After some investigation: SQL SERVER generate its DUMP STACK, this cause sql instance to freeze and the Availability group try to…
0
votes
2 answers

"String or binary data would be truncated" on DBCC CHECKIDENT

I am getting a "String or binary data would be truncated" error when i try to reset the Identity. Declare @tableNameWithSchema varchar(max) SET @tableNameWithSchema = '[' + @table_schema + '].[' + @tablenamee + ']' DBCC CHECKIDENT…
0
votes
1 answer

SQL Update table error : DBCC execution completed. If DBCC printed error messages, contact your system administrator

update Calls set Call_Closed = GETDATE() where CallId = 4266576; I have a table named calls. Whenever i'm trying to update any column in this table it throws an error. I have logged in with "sa" account in the server and it is the admin account.…
rohit singh
  • 1,239
  • 3
  • 15
  • 26
0
votes
1 answer

DBCC CheckDB require how much size of the Tempdb

An automatic job running to do the DBCC CheckDB for all of our database on SQL Server 2008 R2. we have 22 DBs, and 1 of the db has about 160GB, I relocate a hard drive around 70 GB for the tempdb but it failed. CheckDB Error : 1105 : Could not…
kai zhao
  • 1
  • 2