How disable DBCC CHEKCDB command

  • Hi,

    For error someone run DBCC CHECKDB in production database, now i want disable or cancel this command for prevent this errors on future.

    Thanks

  • CheckDB runs database integrity checks. Nothing else. It doesn't cause errors. It should be run regularly to make sure that things aren't broken.

    Regardless, there's nothing to disable, checkDB runs when someone runs it or when a job runs it. It does not run automatically.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • DBCC CHECKDB - http://msdn.microsoft.com/en-US/library/ms176064%28v=SQL.90%29.aspx

    As Gail mentioned, this doesn't cause errors.

    Disabling it, even if allowed, doesn't make sense. Why would you not want to know about potential problems in the database?

  • I want disable dbcc checkdb because my database have 4TB, and then take long time for this commnad to end (around 16h hours).

    We have many maintenance plans and jobs and in some cases is confuse for the operators.

    Is posible disable?

  • Sure, find the job/maint plan that runs it and disable that job. CheckDB does not run automatically. There is a job or maintenance plan that runs it.

    However, that is really bad practice and not a solution. You need to be running checkDB somehow so that you can detect corruption before it affects the users, before it becomes irreparable. For some ideas for checkDB on very large databases see - http://sqlskills.com/BLOGS/PAUL/post/CHECKDB-From-Every-Angle-Consistency-Checking-Options-for-a-VLDB.aspx

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • You need to run checkdb periodically. It is the only way you will detect corruption and the sooner you can detect it, the better.

    If it's a burden on the primary server, then restore on a secondary server and run it there. If you don't have 4TB, consider purchasing Red Gate's Virtual Restore, and running it on a server that uses a virtual restore. You need to run checkdb.

    Disclosure: I work for Red Gate.

  • dbcc checkdb runs on startup. This is an issue for any VLDB. It particularly is bad for mirroring and cluster failovers.

    *****

    Give a man a fish, and you've given him a meal. Teach a man to fish and he'll ask to borrow your boat.:-P

  • eric.lyons (8/28/2012)


    dbcc checkdb runs on startup. This is an issue for any VLDB. It particularly is bad for mirroring and cluster failovers.

    Not that I am aware of.

  • Check your log file.

    *****

    Give a man a fish, and you've given him a meal. Teach a man to fish and he'll ask to borrow your boat.:-P

  • eric.lyons (8/28/2012)


    Check your log file.

    I have, not a peep. Haven't seen DBCC CHECKDB run on any of my servers without me running it, and I have been working with SQL Server for 15 years.

  • eric.lyons (8/28/2012)


    dbcc checkdb runs on startup. This is an issue for any VLDB. It particularly is bad for mirroring and cluster failovers.

    I rebooted my desktop yesterday morning. It has SQL Server 2008 R2 Developer Edition running on it, with several user databases on that, including a 78 Gig bulk-testing database (where I test code on large tables of realistic data). The log file has entries for starting up each database, and recovering each database, and then nothing for 2 hours, when it turned on DBCC TRACEON 3604 for a bunch of SPIDs. No DBCC CHECKDB entries in the log, unless you mean the "Recovery completed for database ..." entries. But those are just getting log and data into sync, to make sure it's consistent.

    Where are you getting the data that DBCC CHECKDB runs on startup?

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • Here is my log file showing what happened at startup. If anyone knows how to disable the dbcc checkdb at startup for USER databases, I'd appreciate that piece of information. FYI, these DBs are NOT VLDB -- yet.

    LogDate ProcessInfo Text

    8/19/2012 9:51 Server "Microsoft SQL Server 2005 - 9.00.4060.00 (Intel X86)

    Mar 17 2011 13:20:38

    Copyright (c) 1988-2005 Microsoft Corporation

    Standard Edition on Windows NT 5.2 (Build 3790: Service Pack 2)

    "

    8/19/2012 9:51 Server (c) 2005 Microsoft Corporation.

    8/19/2012 9:51 Server All rights reserved.

    8/19/2012 9:51 Server Server process ID is 3232.

    8/19/2012 9:51 Server Authentication mode is MIXED.

    8/19/2012 9:51 Server Logging SQL Server messages in file 'D:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG'.

    8/19/2012 9:51 Server This instance of SQL Server last reported using a process ID of 3252 at 8/19/2012 9:45:17 AM (local) 8/19/2012 2:45:17 PM (UTC). This is an informational message only; no user action is required.

    8/19/2012 9:51 Server Registry startup parameters:

    8/19/2012 9:51 Server " -d D:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\master.mdf"

    8/19/2012 9:51 Server " -e D:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG"

    8/19/2012 9:51 Server " -l D:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\mastlog.ldf"

    8/19/2012 9:51 Server SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required.

    8/19/2012 9:51 Server Detected 16 CPUs. This is an informational message; no user action is required.

    8/19/2012 9:51 Server Address Windowing Extensions is enabled. This is an informational message only; no user action is required.

    8/19/2012 9:51 Server Using dynamic lock allocation. Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node. This is an informational message only. No user action is required.

    8/19/2012 9:51 Server Lock partitioning is enabled. This is an informational message only. No user action is required.

    8/19/2012 9:51 Server Multinode configuration: node 0: CPU mask: 0x0000aaaa Active CPU mask: 0x0000aaaa. This message provides a description of the NUMA configuration for this computer. This is an informational message only. No user action is required.

    8/19/2012 9:51 Server Multinode configuration: node 1: CPU mask: 0x00005555 Active CPU mask: 0x00005555. This message provides a description of the NUMA configuration for this computer. This is an informational message only. No user action is required.

    8/19/2012 9:51 Server Attempting to initialize Microsoft Distributed Transaction Coordinator (MS DTC). This is an informational message only. No user action is required.

    8/19/2012 9:51 Server Attempting to recover in-doubt distributed transactions involving Microsoft Distributed Transaction Coordinator (MS DTC). This is an informational message only. No user action is required.

    8/19/2012 9:51 Server Database mirroring has been enabled on this instance of SQL Server.

    8/19/2012 9:51 spid7s Starting up database 'master'.

    8/19/2012 9:51 spid7s 1 transactions rolled forward in database 'master' (1). This is an informational message only. No user action is required.

    8/19/2012 9:51 spid7s 0 transactions rolled back in database 'master' (1). This is an informational message only. No user action is required.

    8/19/2012 9:51 spid7s Recovery is writing a checkpoint in database 'master' (1). This is an informational message only. No user action is required.

    8/19/2012 9:51 spid7s CHECKDB for database 'master' finished without errors on 2009-09-20 18:00:01.870 (local time). This is an informational message only; no user action is required.

    8/19/2012 9:51 spid7s SQL Trace ID 1 was started by login "sa".

    8/19/2012 9:51 spid7s Starting up database 'mssqlsystemresource'.

    8/19/2012 9:51 spid7s The resource database build version is 9.00.4035. This is an informational message only. No user action is required.

    8/19/2012 9:51 spid11s Starting up database 'model'.

    8/19/2012 9:51 spid7s Server name is 'XXX-CRL-MSSQL01'. This is an informational message only. No user action is required.

    8/19/2012 9:51 Server A self-generated certificate was successfully loaded for encryption.

    8/19/2012 9:51 Server Server is listening on [ 'any' <ipv4> 1433].

    8/19/2012 9:51 Server Server local connection provider is ready to accept connection on [ \\.\pipe\SQLLocal\MSSQLSERVER ].

    8/19/2012 9:51 Server Server named pipe provider is ready to accept connection on [ \\.\pipe\sql\query ].

    8/19/2012 9:51 Server Server is listening on [ 'any' <ipv4> 1434].

    8/19/2012 9:51 Server Dedicated admin connection support was established for listening remotely on port 1434.

    8/19/2012 9:51 Server SQL Server is now ready for client connections. This is an informational message; no user action is required.

    8/19/2012 9:51 spid14s Starting up database 'Citrix-Performance'.

    8/19/2012 9:51 spid16s Starting up database 'SE Sharepoint DB'.

    8/19/2012 9:51 spid17s Starting up database 'NSMRulestat'.

    8/19/2012 9:51 spid15s Starting up database 'msdb'.

    8/19/2012 9:51 spid37s Starting up database 'ORData'.

    8/19/2012 9:51 spid38s Starting up database 'DiagramDB'.

    8/19/2012 9:51 spid19s Starting up database 'XPORT'.

    8/19/2012 9:51 spid20s Starting up database 'XXXXDW_TEST'.

    8/19/2012 9:51 spid18s Starting up database 'BEDB'.

    8/19/2012 9:51 spid27s Starting up database 'StopAudit'.

    8/19/2012 9:51 spid28s Starting up database 'dist_xport'.

    8/19/2012 9:51 spid30s Starting up database 'OnBase'.

    8/19/2012 9:51 spid29s Starting up database 'WORKFLOW'.

    8/19/2012 9:51 spid36s Starting up database 'VisibData'.

    8/19/2012 9:51 spid34s Starting up database 'HomeDepotPOS'.

    8/19/2012 9:51 spid35s Starting up database 'DW_Staging'.

    8/19/2012 9:51 spid32s Starting up database 'QRF'.

    8/19/2012 9:51 spid31s Starting up database 'Suppliers'.

    8/19/2012 9:51 spid33s Starting up database 'AlloyNav'.

    8/19/2012 9:51 spid26s Starting up database 'Scorecard'.

    8/19/2012 9:51 spid23s Starting up database 'se config DB'.

    8/19/2012 9:51 spid25s Starting up database 'Maint'.

    8/19/2012 9:51 spid24s Starting up database 'BI_Reporting'.

    8/19/2012 9:51 spid22s Starting up database 'landesk'.

    8/19/2012 9:51 spid21s Starting up database 'XXX'.

    8/19/2012 9:51 spid32s Analysis of database 'QRF' (27) is 100% complete (approximately 0 seconds remain). This is an informational message only. No user action is required.

    8/19/2012 9:51 spid17s Recovery is writing a checkpoint in database 'NSMRulestat' (5). This is an informational message only. No user action is required.

    8/19/2012 9:51 spid32s CHECKDB for database 'QRF' finished without errors on 2012-08-19 03:10:03.917 (local time). This is an informational message only; no user action is required.

    8/19/2012 9:51 spid26s CHECKDB for database 'Scorecard' finished without errors on 2012-08-19 03:10:05.117 (local time). This is an informational message only; no user action is required.

    8/19/2012 9:51 spid38s Analysis of database 'DiagramDB' (34) is 100% complete (approximately 0 seconds remain). This is an informational message only. No user action is required.

    8/19/2012 9:51 spid17s CHECKDB for database 'NSMRulestat' finished without errors on 2009-09-20 18:00:09.840 (local time). This is an informational message only; no user action is required.

    8/19/2012 9:51 spid25s CHECKDB for database 'Maint' finished without errors on 2012-08-19 03:14:55.117 (local time). This is an informational message only; no user action is required.

    8/19/2012 9:51 spid36s CHECKDB for database 'VisibData' finished without errors on 2012-08-19 03:10:05.883 (local time). This is an informational message only; no user action is required.

    8/19/2012 9:51 spid11s CHECKDB for database 'model' finished without errors on 2009-09-20 18:00:06.150 (local time). This is an informational message only; no user action is required.

    8/19/2012 9:51 spid29s CHECKDB for database 'WORKFLOW' finished without errors on 2009-09-20 18:00:06.150 (local time). This is an informational message only; no user action is required.

    8/19/2012 9:51 spid31s CHECKDB for database 'Suppliers' finished without errors on 2012-04-27 08:41:05.063 (local time). This is an informational message only; no user action is required.

    8/19/2012 9:51 spid11s Clearing tempdb database.

    8/19/2012 9:51 spid18s CHECKDB for database 'BEDB' finished without errors on 2009-09-20 18:04:30.660 (local time). This is an informational message only; no user action is required.

    8/19/2012 9:51 spid22s Recovery is writing a checkpoint in database 'landesk' (12). This is an informational message only. No user action is required.

    8/19/2012 9:51 spid33s CHECKDB for database 'AlloyNav' finished without errors on 2009-09-20 18:00:06.150 (local time). This is an informational message only; no user action is required.

    8/19/2012 9:51 spid27s CHECKDB for database 'StopAudit' finished without errors on 2012-08-19 03:10:04.650 (local time). This is an informational message only; no user action is required.

    8/19/2012 9:51 spid34s CHECKDB for database 'HomeDepotPOS' finished without errors on 2009-09-20 18:00:06.150 (local time). This is an informational message only; no user action is required.

    8/19/2012 9:51 spid21s CHECKDB for database 'XXX' finished without errors on 2009-09-20 18:05:31.600 (local time). This is an informational message only; no user action is required.

    8/19/2012 9:51 spid24s CHECKDB for database 'BI_Reporting' finished without errors on 2012-08-19 03:14:55.860 (local time). This is an informational message only; no user action is required.

    8/19/2012 9:51 spid38s CHECKDB for database 'DiagramDB' finished without errors on 2009-09-20 18:00:06.150 (local time). This is an informational message only; no user action is required.

    8/19/2012 9:51 spid22s CHECKDB for database 'landesk' finished without errors on 2009-09-20 18:05:32.457 (local time). This is an informational message only; no user action is required.

    8/19/2012 9:51 spid23s CHECKDB for database 'se config DB' finished without errors on 2009-09-20 18:05:51.863 (local time). This is an informational message only; no user action is required.

    8/19/2012 9:51 spid11s Starting up database 'tempdb'.

    8/19/2012 9:51 spid11s CHECKDB for database 'tempdb' finished without errors on 2009-09-20 18:00:06.150 (local time). This is an informational message only; no user action is required.

    8/19/2012 9:51 spid17s The Service Broker protocol transport is disabled or not configured.

    8/19/2012 9:51 spid17s Server is listening on [ 'any' <ipv4> 5022].

    8/19/2012 9:51 spid17s The Database Mirroring protocol transport is now listening for connections.

    8/19/2012 9:51 spid17s Service Broker manager has started.

    8/19/2012 9:51 spid15s CHECKDB for database 'msdb' finished without errors on 2009-09-20 18:00:06.637 (local time). This is an informational message only; no user action is required.

    8/19/2012 9:51 spid28s Recovery is writing a checkpoint in database 'dist_xport' (21). This is an informational message only. No user action is required.

    8/19/2012 9:51 spid28s CHECKDB for database 'dist_xport' finished without errors on 2009-09-20 18:00:06.150 (local time). This is an informational message only; no user action is required.

    8/19/2012 9:51 spid14s Recovery is writing a checkpoint in database 'Citrix-Performance' (6). This is an informational message only. No user action is required.

    8/19/2012 9:51 spid14s CHECKDB for database 'Citrix-Performance' finished without errors on 2009-09-20 18:00:11.713 (local time). This is an informational message only; no user action is required.

    8/19/2012 9:51 spid35s CHECKDB for database 'DW_Staging' finished without errors on 2009-09-20 18:00:06.150 (local time). This is an informational message only; no user action is required.

    8/19/2012 9:51 spid16s CHECKDB for database 'SE Sharepoint DB' finished without errors on 2012-08-19 03:00:00.803 (local time). This is an informational message only; no user action is required.

    8/19/2012 9:51 spid30s Analysis of database 'OnBase' (24) is 100% complete (approximately 0 seconds remain). This is an informational message only. No user action is required.

    8/19/2012 9:51 spid20s CHECKDB for database 'XXXXDW_TEST' finished without errors on 2009-09-20 18:00:06.150 (local time). This is an informational message only; no user action is required.

    8/19/2012 9:51 spid30s CHECKDB for database 'OnBase' finished without errors on 2012-06-15 12:22:43.653 (local time). This is an informational message only; no user action is required.

    8/19/2012 9:51 spid37s Analysis of database 'ORData' (33) is 100% complete (approximately 0 seconds remain). This is an informational message only. No user action is required.

    8/19/2012 9:51 spid37s CHECKDB for database 'ORData' finished without errors on 2012-08-19 03:00:00.850 (local time). This is an informational message only; no user action is required.

    *****

    Give a man a fish, and you've given him a meal. Teach a man to fish and he'll ask to borrow your boat.:-P

  • eric.lyons (8/28/2012)


    dbcc checkdb runs on startup. This is an issue for any VLDB. It particularly is bad for mirroring and cluster failovers.

    No it does not. SQL does not ever run checkDB automatically

    What SQL does do on startup is log the date checkDB last ran without error into the error log. The log message is different to the one written by the execution of CheckDB.

    eg

    2012-06-09 13:01:28.02 spid20s CHECKDB for database 'Testing' finished without errors on 2012-01-24 18:08:24.677 (local time). This is an informational message only; no user action is required.

    Note the difference in the two dates.

    When CheckDB is run, the message is this one:

    2012-08-28 22:10:45.37 spid62 DBCC CHECKDB (Testing) executed by AVALON\Gail found 0 errors and repaired 0 errors. Elapsed time: 0 hours 0 minutes 34 seconds. Internal database snapshot has split point LSN = 000039d7:00000056:0001 and first LSN = 000039d7:00000055:0001.

    Two very different messages.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • eric.lyons (8/28/2012)


    8/19/2012 9:51 spid17s CHECKDB for database 'NSMRulestat' finished without errors on 2009-09-20 18:00:09.840 (local time).

    8/19/2012 9:51 spid25s CHECKDB for database 'Maint' finished without errors on 2012-08-19 03:14:55.117 (local time).

    8/19/2012 9:51 spid36s CHECKDB for database 'VisibData' finished without errors on 2012-08-19 03:10:05.883 (local time).

    Look at the highlighted dates.

    Btw, some of your databases have not had a successful checkDB in 3 years, you may want to rectify that.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • And yet, on a job interview I was very surprised to learn about the HOURS passing waiting for a VLDB to come on line because of dbcc.

    *****

    Give a man a fish, and you've given him a meal. Teach a man to fish and he'll ask to borrow your boat.:-P

Viewing 15 posts - 1 through 15 (of 21 total)

You must be logged in to reply to this topic. Login to reply