

Mr or Mrs. 500
Group: General Forum Members
Last Login: Today @ 1:24 AM
Points: 567,
Visits: 2,360


Have been playing around with intentionally corrupting database files and database backup files to see how the various commands that have been discussed so far will behave. This is on a 1GB database.
Changing the first byte or a byte some where in the middle causes DBCC CHECKDB and BACKUP WITH CHECKSUM to fail. Changing the last byte or a byte 'near the end' generates no errors.
This is true also of RESTORE VERIFYONLY WITH CHECKSUM. For this to generate an error I had to change a byte as far as 20% from the end. Interesting.
Now I'm trying to catch errors using this simple code.
declare @err int begin try dbcc checkdb('mydatabase') restore verifyonly from disk='mydatabase.bak' with checksum end try begin catch set @err=@@error if @err<>0 select @err end catch
RESTORE VERIFYONLY correctly shows error 3013.
DBCC CHECKDB does not generate any red error messages. But if you run it all by itself the output shows red error messages. Why is this?




SSCrazy
Group: General Forum Members
Last Login: Saturday, August 8, 2015 1:22 PM
Points: 2,047,
Visits: 1,685


Too many ambiguities in your post and question. For instance, the 'end' of what? Page? Database? Backup file?
Can you give the exact set of steps and TSQL, from creating the database to running the commands that do/do not fail? Only then can I explain the behavior you're seeing.
Thanks
Paul Randal CEO, SQLskills.com: Check out SQLskills online training! Blog:www.SQLskills.com/blogs/paul Twitter: @PaulRandal SQL MVP, Microsoft RD, Contributing Editor of TechNet Magazine Author of DBCC CHECKDB/repair (and other Storage Engine) code of SQL Server 2005




Mr or Mrs. 500
Group: General Forum Members
Last Login: Today @ 1:24 AM
Points: 567,
Visits: 2,360


Paul Randal (9/28/2012) Too many ambiguities in your post and question. For instance, the 'end' of what? Page? Database? Backup file?
Can you give the exact set of steps and TSQL, from creating the database to running the commands that do/do not fail? Only then can I explain the behavior you're seeing.
Thanks OK, let's do one at a time: DBCC CHECKDB('...') run on a corrupted database (via a single byte change in the physical file).
When I run the above single comand directly I get 'Level 16' errors:
DBCC results for 'A7RETE'. 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. DBCC results for 'sys.sysrowsetcolumns'. There are 3638 rows in 24 pages for object "sys.sysrowsetcolumns". DBCC results for 'sys.sysrowsets'. There are 431 rows in 6 pages for object "sys.sysrowsets". DBCC results for 'sysallocunits'. There are 510 rows in 9 pages for object "sysallocunits". DBCC results for 'sys.sysfiles1'. There are 2 rows in 1 pages for object "sys.sysfiles1". DBCC results for 'sys.syshobtcolumns'. There are 3638 rows in 27 pages for object "sys.syshobtcolumns". DBCC results for 'sys.syshobts'. There are 431 rows in 5 pages for object "sys.syshobts". DBCC results for 'sys.sysftinds'. There are 0 rows in 0 pages for object "sys.sysftinds". DBCC results for 'sys.sysserefs'. There are 510 rows in 2 pages for object "sys.sysserefs". DBCC results for 'sys.sysowners'. There are 14 rows in 1 pages for object "sys.sysowners". DBCC results for 'sys.sysprivs'. There are 153 rows in 1 pages for object "sys.sysprivs". DBCC results for 'sys.sysschobjs'. There are 1128 rows in 16 pages for object "sys.sysschobjs". DBCC results for 'sys.syscolpars'. There are 3181 rows in 38 pages for object "sys.syscolpars". DBCC results for 'sys.sysnsobjs'. There are 1 rows in 1 pages for object "sys.sysnsobjs". DBCC results for 'sys.syscerts'. There are 0 rows in 0 pages for object "sys.syscerts". DBCC results for 'sys.sysxprops'. There are 0 rows in 0 pages for object "sys.sysxprops". DBCC results for 'sys.sysscalartypes'. There are 27 rows in 1 pages for object "sys.sysscalartypes". DBCC results for 'sys.systypedsubobjs'. There are 0 rows in 0 pages for object "sys.systypedsubobjs". DBCC results for 'sys.sysidxstats'. There are 742 rows in 12 pages for object "sys.sysidxstats". DBCC results for 'sys.sysiscols'. There are 1071 rows in 7 pages for object "sys.sysiscols". DBCC results for 'sys.sysbinobjs'. There are 23 rows in 1 pages for object "sys.sysbinobjs". DBCC results for 'sys.sysobjvalues'. There are 1416 rows in 158 pages for object "sys.sysobjvalues". DBCC results for 'sys.sysclsobjs'. There are 14 rows in 1 pages for object "sys.sysclsobjs". DBCC results for 'sys.sysrowsetrefs'. There are 0 rows in 0 pages for object "sys.sysrowsetrefs". DBCC results for 'sys.sysremsvcbinds'. There are 0 rows in 0 pages for object "sys.sysremsvcbinds". DBCC results for 'sys.sysxmitqueue'. There are 0 rows in 0 pages for object "sys.sysxmitqueue". DBCC results for 'sys.sysrts'. There are 1 rows in 1 pages for object "sys.sysrts". DBCC results for 'sys.sysconvgroup'. There are 0 rows in 0 pages for object "sys.sysconvgroup". DBCC results for 'sys.sysdesend'. There are 0 rows in 0 pages for object "sys.sysdesend". DBCC results for 'sys.sysdercv'. There are 0 rows in 0 pages for object "sys.sysdercv". DBCC results for 'sys.syssingleobjrefs'. There are 1033 rows in 6 pages for object "sys.syssingleobjrefs". DBCC results for 'sys.sysmultiobjrefs'. There are 1346 rows in 12 pages for object "sys.sysmultiobjrefs". DBCC results for 'sys.sysdbfiles'. There are 2 rows in 1 pages for object "sys.sysdbfiles". DBCC results for 'sys.sysguidrefs'. There are 0 rows in 0 pages for object "sys.sysguidrefs". DBCC results for 'sys.sysqnames'. There are 91 rows in 1 pages for object "sys.sysqnames". DBCC results for 'sys.sysxmlcomponent'. There are 93 rows in 1 pages for object "sys.sysxmlcomponent". DBCC results for 'sys.sysxmlfacet'. There are 97 rows in 1 pages for object "sys.sysxmlfacet". DBCC results for 'sys.sysxmlplacement'. There are 17 rows in 1 pages for object "sys.sysxmlplacement". DBCC results for 'sys.sysobjkeycrypts'. There are 0 rows in 0 pages for object "sys.sysobjkeycrypts". DBCC results for 'sys.sysasymkeys'. There are 0 rows in 0 pages for object "sys.sysasymkeys". DBCC results for 'sys.syssqlguides'. There are 0 rows in 0 pages for object "sys.syssqlguides". DBCC results for 'sys.sysbinsubobjs'. There are 0 rows in 0 pages for object "sys.sysbinsubobjs". DBCC results for 'tr_action'. There are 1 rows in 1 pages for object "tr_action". DBCC results for 'tr_processlog'. There are 0 rows in 0 pages for object "tr_processlog". DBCC results for 'tr_ppbackup'. There are 0 rows in 0 pages for object "tr_ppbackup". DBCC results for 'tr_linkheader'. There are 141 rows in 4 pages for object "tr_linkheader". DBCC results for 'tr_mapping'. There are 14 rows in 1 pages for object "tr_mapping". DBCC results for 'tr_processparamvalue'. There are 0 rows in 0 pages for object "tr_processparamvalue". DBCC results for 'tr_demandtypecount'. There are 0 rows in 0 pages for object "tr_demandtypecount". DBCC results for 'tr_resourcerole'. There are 124 rows in 7 pages for object "tr_resourcerole". DBCC results for 'tr_teammember'. There are 0 rows in 0 pages for object "tr_teammember". DBCC results for 'tr_resourcebudget'. There are 0 rows in 0 pages for object "tr_resourcebudget". DBCC results for 'tr_milestonetrend'. There are 0 rows in 0 pages for object "tr_milestonetrend". DBCC results for 'tr_approver'. There are 0 rows in 0 pages for object "tr_approver". DBCC results for 'tr_activityactionmap'. There are 0 rows in 0 pages for object "tr_activityactionmap". DBCC results for 'tr_method'. There are 3 rows in 1 pages for object "tr_method". DBCC results for 'tr_userfield'. There are 43 rows in 2 pages for object "tr_userfield". DBCC results for 'tr_currencyrate'. There are 0 rows in 0 pages for object "tr_currencyrate". DBCC results for 'tr_requirevalue'. There are 0 rows in 0 pages for object "tr_requirevalue". DBCC results for 'tr_request'. There are 2 rows in 1 pages for object "tr_request". DBCC results for 'tr_demandactivityvalue'. There are 0 rows in 0 pages for object "tr_demandactivityvalue". DBCC results for 'tr_benefittype'. There are 0 rows in 0 pages for object "tr_benefittype". DBCC results for 'tr_flow'. There are 0 rows in 0 pages for object "tr_flow". DBCC results for 'tr_costtype'. There are 0 rows in 0 pages for object "tr_costtype". DBCC results for 'tr_usercategory'. There are 23 rows in 1 pages for object "tr_usercategory". DBCC results for 'tr_activity'. There are 0 rows in 0 pages for object "tr_activity". DBCC results for 'tr_milestonevalue'. There are 0 rows in 0 pages for object "tr_milestonevalue". DBCC results for 'trx_file'. There are 729 rows in 9 pages for object "trx_file". DBCC results for 'tr_bucketbudget'. There are 0 rows in 0 pages for object "tr_bucketbudget". DBCC results for 'tr_subscription'. There are 0 rows in 0 pages for object "tr_subscription". DBCC results for 'tr_teamvalue'. There are 0 rows in 0 pages for object "tr_teamvalue". DBCC results for 'trx_taonet'. There are 739043 rows in 27119 pages for object "trx_taonet". DBCC results for 'tr_requestdemand'. There are 0 rows in 0 pages for object "tr_requestdemand". DBCC results for 'tr_link'. There are 142 rows in 2 pages for object "tr_link". DBCC results for 'tr_xlreport'. There are 25 rows in 1 pages for object "tr_xlreport". DBCC results for 'tr_resourcecharac'. There are 55 rows in 3 pages for object "tr_resourcecharac". DBCC results for 'trx_eventlog9'. There are 2103 rows in 22 pages for object "trx_eventlog9". DBCC results for 'tr_stepbudget'. There are 0 rows in 0 pages for object "tr_stepbudget". DBCC results for 'tr_requirement'. There are 0 rows in 0 pages for object "tr_requirement". DBCC results for 'trx_eventlog6'. There are 577 rows in 6 pages for object "trx_eventlog6". DBCC results for 'tr_budgetgraph'. There are 1 rows in 1 pages for object "tr_budgetgraph". DBCC results for 'tr_fiscalperiod'. There are 0 rows in 0 pages for object "tr_fiscalperiod". DBCC results for 'tr_benefit'. There are 0 rows in 0 pages for object "tr_benefit". DBCC results for 'tr_timesheetvalue'. There are 0 rows in 0 pages for object "tr_timesheetvalue". DBCC results for 'tr_statenode'. There are 0 rows in 0 pages for object "tr_statenode". DBCC results for 'tr_assignment'. There are 0 rows in 0 pages for object "tr_assignment". DBCC results for 'tr_xlreportsql'. There are 35 rows in 3 pages for object "tr_xlreportsql". DBCC results for 'tr_demandtypecodemap'. There are 0 rows in 0 pages for object "tr_demandtypecodemap". DBCC results for 'tr_currency'. There are 1 rows in 1 pages for object "tr_currency". DBCC results for 'tr_milestone'. There are 0 rows in 0 pages for object "tr_milestone". DBCC results for 'tr_milestonemap'. There are 0 rows in 0 pages for object "tr_milestonemap". DBCC results for 'tr_stepaccess'. There are 621 rows in 6 pages for object "tr_stepaccess". DBCC results for 'tr_budgetcostpref'. There are 0 rows in 0 pages for object "tr_budgetcostpref". DBCC results for 'tr_resgroup'. There are 0 rows in 0 pages for object "tr_resgroup". DBCC results for 'tr_demandactivitycharac'. There are 0 rows in 0 pages for object "tr_demandactivitycharac". DBCC results for 'tr_resource'. There are 101 rows in 5 pages for object "tr_resource". DBCC results for 'tr_characvalue'. There are 1348 rows in 40 pages for object "tr_characvalue". DBCC results for 'tr_demandactivityinfo'. There are 0 rows in 0 pages for object "tr_demandactivityinfo". DBCC results for 'tr_processparam'. There are 0 rows in 0 pages for object "tr_processparam". DBCC results for 'tr_dataread'. There are 107 rows in 1 pages for object "tr_dataread". DBCC results for 'tr_demandtypecharac'. There are 0 rows in 0 pages for object "tr_demandtypecharac". DBCC results for 'tr_timesheet'. There are 0 rows in 0 pages for object "tr_timesheet". DBCC results for 'tr_costexplanation'. There are 0 rows in 0 pages for object "tr_costexplanation". DBCC results for 'tr_comment'. There are 0 rows in 1 pages for object "tr_comment". DBCC results for 'tr_releasestatus'. There are 11 rows in 1 pages for object "tr_releasestatus". DBCC results for 'tr_alert'. There are 724 rows in 28 pages for object "tr_alert". DBCC results for 'tr_taskrelation'. There are 0 rows in 1 pages for object "tr_taskrelation". DBCC results for 'tr_bucket'. There are 0 rows in 0 pages for object "tr_bucket". DBCC results for 'tr_deptresource'. There are 0 rows in 0 pages for object "tr_deptresource". DBCC results for 'tr_teamcharac'. There are 0 rows in 0 pages for object "tr_teamcharac". DBCC results for 'sys.queue_messages_761105802'. There are 0 rows in 0 pages for object "sys.queue_messages_761105802". DBCC results for 'tr_budgetrespref'. There are 0 rows in 0 pages for object "tr_budgetrespref". DBCC results for 'tr_departmentaccess'. There are 0 rows in 0 pages for object "tr_departmentaccess". DBCC results for 'tr_demandflowinfo'. There are 0 rows in 0 pages for object "tr_demandflowinfo". DBCC results for 'sys.queue_messages_793105916'. There are 0 rows in 0 pages for object "sys.queue_messages_793105916". DBCC results for 'tr_statelink'. There are 0 rows in 0 pages for object "tr_statelink". DBCC results for 'tr_milestonecharac'. There are 0 rows in 0 pages for object "tr_milestonecharac". DBCC results for 'sys.queue_messages_825106030'. There are 0 rows in 0 pages for object "sys.queue_messages_825106030". DBCC results for 'tr_activitycharacmap'. There are 0 rows in 0 pages for object "tr_activitycharacmap". DBCC results for 'tr_riskvalue'. There are 0 rows in 0 pages for object "tr_riskvalue". DBCC results for 'tr_audit'. There are 0 rows in 0 pages for object "tr_audit". DBCC results for 'tr_timesheetcharac'. There are 0 rows in 0 pages for object "tr_timesheetcharac". DBCC results for 'tr_roleaccess'. There are 311 rows in 3 pages for object "tr_roleaccess". DBCC results for 'tr_demandtypecharacgroup'. There are 0 rows in 0 pages for object "tr_demandtypecharacgroup". DBCC results for 'tr_requestcalcfactor'. There are 66 rows in 1 pages for object "tr_requestcalcfactor". DBCC results for 'tr_system'. There are 1 rows in 1 pages for object "tr_system". DBCC results for 'tr_dependency'. There are 0 rows in 0 pages for object "tr_dependency". DBCC results for 'tr_budget'. There are 0 rows in 0 pages for object "tr_budget". DBCC results for 'tr_teamaccess'. There are 0 rows in 0 pages for object "tr_teamaccess". DBCC results for 'tr_demandtype'. There are 0 rows in 0 pages for object "tr_demandtype". DBCC results for 'tr_demandresgroup'. There are 0 rows in 0 pages for object "tr_demandresgroup". DBCC results for 'tr_requestvalue'. There are 0 rows in 0 pages for object "tr_requestvalue". DBCC results for 'tr_investmentallocation'. There are 0 rows in 0 pages for object "tr_investmentallocation". DBCC results for 'tr_step'. There are 14 rows in 1 pages for object "tr_step". DBCC results for 'tr_resourcecost'. There are 0 rows in 0 pages for object "tr_resourcecost". DBCC results for 'tr_indexerqueue'. Msg 8951, Level 16, State 1, Line 1 Table error: table 'tr_indexerqueue' (ID 1157579162). Data row does not have a matching index row in the index 'tr_indexerqueue1' (ID 2). Possible missing or invalid keys for the index row matching: Msg 8955, Level 16, State 1, Line 1 Data row (1:36621:29) identified by (HEAP RID = (1:36621:29)) with index values 'tkey = 21587 and tkey2 = 0 and HEAP RID = (1:36621:29)'. Msg 8952, Level 16, State 1, Line 1 Table error: table 'tr_indexerqueue' (ID 1157579162). Index row in index 'tr_indexerqueue1' (ID 2) does not match any data row. Possible extra or invalid keys for: Msg 8956, Level 16, State 1, Line 1 Index row (1:18399:113) with values (tkey = 21586 and tkey2 = 0 and HEAP RID = (1:36621:29)) pointing to the data row identified by (HEAP RID = (1:36621:29)). There are 2922595 rows in 10751 pages for object "tr_indexerqueue". CHECKDB found 0 allocation errors and 2 consistency errors in table 'tr_indexerqueue' (object ID 1157579162). DBCC results for 'tr_demandtypemap'. There are 0 rows in 0 pages for object "tr_demandtypemap". DBCC results for 'tr_demandhistory'. There are 0 rows in 0 pages for object "tr_demandhistory". DBCC results for 'tr_rate'. There are 0 rows in 0 pages for object "tr_rate". DBCC results for 'tr_task'. There are 25669 rows in 1470 pages for object "tr_task". DBCC results for 'tr_requestinherit'. There are 0 rows in 0 pages for object "tr_requestinherit". DBCC results for 'trx_eventlog'. There are 132115 rows in 1456 pages for object "trx_eventlog". DBCC results for 'tr_characgroup'. There are 4 rows in 1 pages for object "tr_characgroup". DBCC results for 'trx_v_element_full'. There are 0 rows in 0 pages for object "trx_v_element_full". DBCC results for 'tr_riskcharac'. There are 0 rows in 0 pages for object "tr_riskcharac". DBCC results for 'trx_v_element'. There are 82595 rows in 381 pages for object "trx_v_element". DBCC results for 'trx_wsloc'. There are 6948 rows in 51 pages for object "trx_wsloc". DBCC results for 'tr_stepcharac'. There are 11 rows in 1 pages for object "tr_stepcharac". DBCC results for 'trx_wslocdata'. There are 14761 rows in 91 pages for object "trx_wslocdata". DBCC results for 'tr_genericresource'. There are 0 rows in 0 pages for object "tr_genericresource". DBCC results for 'trx_wsextdata'. There are 50790 rows in 305 pages for object "trx_wsextdata". DBCC results for 'trx_wsrouting'. There are 2 rows in 1 pages for object "trx_wsrouting". DBCC results for 'trx_wsoperation'. There are 8 rows in 1 pages for object "trx_wsoperation". DBCC results for 'tr_taskvalue'. There are 334023 rows in 5420 pages for object "tr_taskvalue". DBCC results for 'trx_wsitem'. There are 45 rows in 1 pages for object "trx_wsitem". DBCC results for 'tr_team'. There are 0 rows in 0 pages for object "tr_team". DBCC results for 'tr_prioritytype'. There are 3 rows in 1 pages for object "tr_prioritytype". DBCC results for 'trx_usersetting'. There are 136 rows in 2 pages for object "trx_usersetting". DBCC results for 'trx_wsext'. There are 5200 rows in 49 pages for object "trx_wsext". DBCC results for 'tr_charac'. There are 17 rows in 1 pages for object "tr_charac". DBCC results for 'tr_departmentvalue'. There are 0 rows in 0 pages for object "tr_departmentvalue". DBCC results for 'tr_statusreport'. There are 0 rows in 0 pages for object "tr_statusreport". DBCC results for 'tr_requestcharac'. There are 1 rows in 1 pages for object "tr_requestcharac". DBCC results for 'av_activity'. There are 47973 rows in 3548 pages for object "av_activity". DBCC results for 'av_actres'. There are 50178 rows in 963 pages for object "av_actres". DBCC results for 'tr_bucketcosttype'. There are 0 rows in 0 pages for object "tr_bucketcosttype". DBCC results for 'tr_opitem'. There are 0 rows in 0 pages for object "tr_opitem". DBCC results for 'av_project'. There are 499 rows in 24 pages for object "av_project". DBCC results for 'tr_demandtypevalue'. There are 0 rows in 0 pages for object "tr_demandtypevalue". DBCC results for 'tr_fountain'. There are 0 rows in 1 pages for object "tr_fountain". DBCC results for 'tr_statustype'. There are 3 rows in 1 pages for object "tr_statustype". DBCC results for 'tr_role'. There are 18 rows in 1 pages for object "tr_role". DBCC results for 'tr_departmentcharac'. There are 0 rows in 0 pages for object "tr_departmentcharac". DBCC results for 'tr_bucketvalue'. There are 0 rows in 0 pages for object "tr_bucketvalue". DBCC results for 'tr_deptbudget'. There are 0 rows in 0 pages for object "tr_deptbudget". DBCC results for 'tr_resourcetype'. There are 0 rows in 0 pages for object "tr_resourcetype". DBCC results for 'tr_taskresource'. There are 0 rows in 0 pages for object "tr_taskresource". DBCC results for 'avx_dbinfo'. There are 2 rows in 1 pages for object "avx_dbinfo". DBCC results for 'tr_stepvalue'. There are 0 rows in 0 pages for object "tr_stepvalue". DBCC results for 'tr_process'. There are 0 rows in 0 pages for object "tr_process". DBCC results for 'tr_execoption'. There are 0 rows in 0 pages for object "tr_execoption". DBCC results for 'av_respool'. There are 1518 rows in 11 pages for object "av_respool". DBCC results for 'av_resource'. There are 1537 rows in 18 pages for object "av_resource". DBCC results for 'tr_guestroleaccess'. There are 7 rows in 1 pages for object "tr_guestroleaccess". DBCC results for 'tr_risk'. There are 0 rows in 0 pages for object "tr_risk". DBCC results for 'tr_restypeassoc'. There are 0 rows in 0 pages for object "tr_restypeassoc". DBCC results for 'tr_allocbucketpref'. There are 0 rows in 0 pages for object "tr_allocbucketpref". DBCC results for 'tr_deptassociation'. There are 0 rows in 0 pages for object "tr_deptassociation". DBCC results for 'tr_releasefunction'. There are 122 rows in 1 pages for object "tr_releasefunction". DBCC results for 'tr_stepresbudget'. There are 0 rows in 0 pages for object "tr_stepresbudget". DBCC results for 'tr_requirecharac'. There are 0 rows in 0 pages for object "tr_requirecharac". DBCC results for 'tr_etl_event'. There are 0 rows in 0 pages for object "tr_etl_event". DBCC results for 'tr_requestaccess'. There are 6 rows in 1 pages for object "tr_requestaccess". DBCC results for 'tr_usersetting'. There are 253 rows in 9 pages for object "tr_usersetting". DBCC results for 'tr_budgetallocation'. There are 0 rows in 0 pages for object "tr_budgetallocation". DBCC results for 'tr_resourcevalue'. There are 10 rows in 1 pages for object "tr_resourcevalue". DBCC results for 'tr_budgetbenpref'. There are 0 rows in 0 pages for object "tr_budgetbenpref". DBCC results for 'tr_execreport'. There are 0 rows in 0 pages for object "tr_execreport". DBCC results for 'tr_department'. There are 1 rows in 1 pages for object "tr_department". DBCC results for 'tr_filter'. There are 0 rows in 1 pages for object "tr_filter". DBCC results for 'tr_demand'. There are 0 rows in 0 pages for object "tr_demand". DBCC results for 'tr_resgroupuser'. There are 0 rows in 0 pages for object "tr_resgroupuser". DBCC results for 'tr_taskcharac'. There are 86744 rows in 754 pages for object "tr_taskcharac". DBCC results for 'tr_approvalaudit'. There are 0 rows in 0 pages for object "tr_approvalaudit". DBCC results for 'tr_bucketcharac'. There are 0 rows in 0 pages for object "tr_bucketcharac". CHECKDB found 0 allocation errors and 2 consistency errors in database 'A7RETE'. repair_rebuild is the minimum repair level for the errors found by DBCC CHECKDB (A7RETE). DBCC execution completed. If DBCC printed error messages, contact your system administrator.
When I run the following code (directly or in a procedure):
declare @err int begin try dbcc checkdb('A7RETE') end try begin catch set @err=@@error if @err<>0 select @err end catch
I get the following messages with no 'Level 16' errors:
DBCC results for 'A7RETE'. 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. DBCC results for 'sys.sysrowsetcolumns'. There are 3638 rows in 24 pages for object "sys.sysrowsetcolumns". DBCC results for 'sys.sysrowsets'. There are 431 rows in 6 pages for object "sys.sysrowsets". DBCC results for 'sysallocunits'. There are 510 rows in 9 pages for object "sysallocunits". DBCC results for 'sys.sysfiles1'. There are 2 rows in 1 pages for object "sys.sysfiles1". DBCC results for 'sys.syshobtcolumns'. There are 3638 rows in 27 pages for object "sys.syshobtcolumns". DBCC results for 'sys.syshobts'. There are 431 rows in 5 pages for object "sys.syshobts". DBCC results for 'sys.sysftinds'. There are 0 rows in 0 pages for object "sys.sysftinds". DBCC results for 'sys.sysserefs'. There are 510 rows in 2 pages for object "sys.sysserefs". DBCC results for 'sys.sysowners'. There are 14 rows in 1 pages for object "sys.sysowners". DBCC results for 'sys.sysprivs'. There are 153 rows in 1 pages for object "sys.sysprivs". DBCC results for 'sys.sysschobjs'. There are 1128 rows in 16 pages for object "sys.sysschobjs". DBCC results for 'sys.syscolpars'. There are 3181 rows in 38 pages for object "sys.syscolpars". DBCC results for 'sys.sysnsobjs'. There are 1 rows in 1 pages for object "sys.sysnsobjs". DBCC results for 'sys.syscerts'. There are 0 rows in 0 pages for object "sys.syscerts". DBCC results for 'sys.sysxprops'. There are 0 rows in 0 pages for object "sys.sysxprops". DBCC results for 'sys.sysscalartypes'. There are 27 rows in 1 pages for object "sys.sysscalartypes". DBCC results for 'sys.systypedsubobjs'. There are 0 rows in 0 pages for object "sys.systypedsubobjs". DBCC results for 'sys.sysidxstats'. There are 742 rows in 12 pages for object "sys.sysidxstats". DBCC results for 'sys.sysiscols'. There are 1071 rows in 7 pages for object "sys.sysiscols". DBCC results for 'sys.sysbinobjs'. There are 23 rows in 1 pages for object "sys.sysbinobjs". DBCC results for 'sys.sysobjvalues'. There are 1416 rows in 158 pages for object "sys.sysobjvalues". DBCC results for 'sys.sysclsobjs'. There are 14 rows in 1 pages for object "sys.sysclsobjs". DBCC results for 'sys.sysrowsetrefs'. There are 0 rows in 0 pages for object "sys.sysrowsetrefs". DBCC results for 'sys.sysremsvcbinds'. There are 0 rows in 0 pages for object "sys.sysremsvcbinds". DBCC results for 'sys.sysxmitqueue'. There are 0 rows in 0 pages for object "sys.sysxmitqueue". DBCC results for 'sys.sysrts'. There are 1 rows in 1 pages for object "sys.sysrts". DBCC results for 'sys.sysconvgroup'. There are 0 rows in 0 pages for object "sys.sysconvgroup". DBCC results for 'sys.sysdesend'. There are 0 rows in 0 pages for object "sys.sysdesend". DBCC results for 'sys.sysdercv'. There are 0 rows in 0 pages for object "sys.sysdercv". DBCC results for 'sys.syssingleobjrefs'. There are 1033 rows in 6 pages for object "sys.syssingleobjrefs". DBCC results for 'sys.sysmultiobjrefs'. There are 1346 rows in 12 pages for object "sys.sysmultiobjrefs". DBCC results for 'sys.sysdbfiles'. There are 2 rows in 1 pages for object "sys.sysdbfiles". DBCC results for 'sys.sysguidrefs'. There are 0 rows in 0 pages for object "sys.sysguidrefs". DBCC results for 'sys.sysqnames'. There are 91 rows in 1 pages for object "sys.sysqnames". DBCC results for 'sys.sysxmlcomponent'. There are 93 rows in 1 pages for object "sys.sysxmlcomponent". DBCC results for 'sys.sysxmlfacet'. There are 97 rows in 1 pages for object "sys.sysxmlfacet". DBCC results for 'sys.sysxmlplacement'. There are 17 rows in 1 pages for object "sys.sysxmlplacement". DBCC results for 'sys.sysobjkeycrypts'. There are 0 rows in 0 pages for object "sys.sysobjkeycrypts". DBCC results for 'sys.sysasymkeys'. There are 0 rows in 0 pages for object "sys.sysasymkeys". DBCC results for 'sys.syssqlguides'. There are 0 rows in 0 pages for object "sys.syssqlguides". DBCC results for 'sys.sysbinsubobjs'. There are 0 rows in 0 pages for object "sys.sysbinsubobjs". DBCC results for 'tr_action'. There are 1 rows in 1 pages for object "tr_action". DBCC results for 'tr_processlog'. There are 0 rows in 0 pages for object "tr_processlog". DBCC results for 'tr_ppbackup'. There are 0 rows in 0 pages for object "tr_ppbackup". DBCC results for 'tr_linkheader'. There are 141 rows in 4 pages for object "tr_linkheader". DBCC results for 'tr_mapping'. There are 14 rows in 1 pages for object "tr_mapping". DBCC results for 'tr_processparamvalue'. There are 0 rows in 0 pages for object "tr_processparamvalue". DBCC results for 'tr_demandtypecount'. There are 0 rows in 0 pages for object "tr_demandtypecount". DBCC results for 'tr_resourcerole'. There are 124 rows in 7 pages for object "tr_resourcerole". DBCC results for 'tr_teammember'. There are 0 rows in 0 pages for object "tr_teammember". DBCC results for 'tr_resourcebudget'. There are 0 rows in 0 pages for object "tr_resourcebudget". DBCC results for 'tr_milestonetrend'. There are 0 rows in 0 pages for object "tr_milestonetrend". DBCC results for 'tr_approver'. There are 0 rows in 0 pages for object "tr_approver". DBCC results for 'tr_activityactionmap'. There are 0 rows in 0 pages for object "tr_activityactionmap". DBCC results for 'tr_method'. There are 3 rows in 1 pages for object "tr_method". DBCC results for 'tr_userfield'. There are 43 rows in 2 pages for object "tr_userfield". DBCC results for 'tr_currencyrate'. There are 0 rows in 0 pages for object "tr_currencyrate". DBCC results for 'tr_requirevalue'. There are 0 rows in 0 pages for object "tr_requirevalue". DBCC results for 'tr_request'. There are 2 rows in 1 pages for object "tr_request". DBCC results for 'tr_demandactivityvalue'. There are 0 rows in 0 pages for object "tr_demandactivityvalue". DBCC results for 'tr_benefittype'. There are 0 rows in 0 pages for object "tr_benefittype". DBCC results for 'tr_flow'. There are 0 rows in 0 pages for object "tr_flow". DBCC results for 'tr_costtype'. There are 0 rows in 0 pages for object "tr_costtype". DBCC results for 'tr_usercategory'. There are 23 rows in 1 pages for object "tr_usercategory". DBCC results for 'tr_activity'. There are 0 rows in 0 pages for object "tr_activity". DBCC results for 'tr_milestonevalue'. There are 0 rows in 0 pages for object "tr_milestonevalue". DBCC results for 'trx_file'. There are 729 rows in 9 pages for object "trx_file". DBCC results for 'tr_bucketbudget'. There are 0 rows in 0 pages for object "tr_bucketbudget". DBCC results for 'tr_subscription'. There are 0 rows in 0 pages for object "tr_subscription". DBCC results for 'tr_teamvalue'. There are 0 rows in 0 pages for object "tr_teamvalue". DBCC results for 'trx_taonet'. There are 739043 rows in 27119 pages for object "trx_taonet". DBCC results for 'tr_requestdemand'. There are 0 rows in 0 pages for object "tr_requestdemand". DBCC results for 'tr_link'. There are 142 rows in 2 pages for object "tr_link". DBCC results for 'tr_xlreport'. There are 25 rows in 1 pages for object "tr_xlreport". DBCC results for 'tr_resourcecharac'. There are 55 rows in 3 pages for object "tr_resourcecharac". DBCC results for 'trx_eventlog9'. There are 2103 rows in 22 pages for object "trx_eventlog9". DBCC results for 'tr_stepbudget'. There are 0 rows in 0 pages for object "tr_stepbudget". DBCC results for 'tr_requirement'. There are 0 rows in 0 pages for object "tr_requirement". DBCC results for 'trx_eventlog6'. There are 577 rows in 6 pages for object "trx_eventlog6". DBCC results for 'tr_budgetgraph'. There are 1 rows in 1 pages for object "tr_budgetgraph". DBCC results for 'tr_fiscalperiod'. There are 0 rows in 0 pages for object "tr_fiscalperiod". DBCC results for 'tr_benefit'. There are 0 rows in 0 pages for object "tr_benefit". DBCC results for 'tr_timesheetvalue'. There are 0 rows in 0 pages for object "tr_timesheetvalue". DBCC results for 'tr_statenode'. There are 0 rows in 0 pages for object "tr_statenode". DBCC results for 'tr_assignment'. There are 0 rows in 0 pages for object "tr_assignment". DBCC results for 'tr_xlreportsql'. There are 35 rows in 3 pages for object "tr_xlreportsql". DBCC results for 'tr_demandtypecodemap'. There are 0 rows in 0 pages for object "tr_demandtypecodemap". DBCC results for 'tr_currency'. There are 1 rows in 1 pages for object "tr_currency". DBCC results for 'tr_milestone'. There are 0 rows in 0 pages for object "tr_milestone". DBCC results for 'tr_milestonemap'. There are 0 rows in 0 pages for object "tr_milestonemap". DBCC results for 'tr_stepaccess'. There are 621 rows in 6 pages for object "tr_stepaccess". DBCC results for 'tr_budgetcostpref'. There are 0 rows in 0 pages for object "tr_budgetcostpref". DBCC results for 'tr_resgroup'. There are 0 rows in 0 pages for object "tr_resgroup". DBCC results for 'tr_demandactivitycharac'. There are 0 rows in 0 pages for object "tr_demandactivitycharac". DBCC results for 'tr_resource'. There are 101 rows in 5 pages for object "tr_resource". DBCC results for 'tr_characvalue'. There are 1348 rows in 40 pages for object "tr_characvalue". DBCC results for 'tr_demandactivityinfo'. There are 0 rows in 0 pages for object "tr_demandactivityinfo". DBCC results for 'tr_processparam'. There are 0 rows in 0 pages for object "tr_processparam". DBCC results for 'tr_dataread'. There are 107 rows in 1 pages for object "tr_dataread". DBCC results for 'tr_demandtypecharac'. There are 0 rows in 0 pages for object "tr_demandtypecharac". DBCC results for 'tr_timesheet'. There are 0 rows in 0 pages for object "tr_timesheet". DBCC results for 'tr_costexplanation'. There are 0 rows in 0 pages for object "tr_costexplanation". DBCC results for 'tr_comment'. There are 0 rows in 1 pages for object "tr_comment". DBCC results for 'tr_releasestatus'. There are 11 rows in 1 pages for object "tr_releasestatus". DBCC results for 'tr_alert'. There are 724 rows in 28 pages for object "tr_alert". DBCC results for 'tr_taskrelation'. There are 0 rows in 1 pages for object "tr_taskrelation". DBCC results for 'tr_bucket'. There are 0 rows in 0 pages for object "tr_bucket". DBCC results for 'tr_deptresource'. There are 0 rows in 0 pages for object "tr_deptresource". DBCC results for 'tr_teamcharac'. There are 0 rows in 0 pages for object "tr_teamcharac". DBCC results for 'sys.queue_messages_761105802'. There are 0 rows in 0 pages for object "sys.queue_messages_761105802". DBCC results for 'tr_budgetrespref'. There are 0 rows in 0 pages for object "tr_budgetrespref". DBCC results for 'tr_departmentaccess'. There are 0 rows in 0 pages for object "tr_departmentaccess". DBCC results for 'tr_demandflowinfo'. There are 0 rows in 0 pages for object "tr_demandflowinfo". DBCC results for 'sys.queue_messages_793105916'. There are 0 rows in 0 pages for object "sys.queue_messages_793105916". DBCC results for 'tr_statelink'. There are 0 rows in 0 pages for object "tr_statelink". DBCC results for 'tr_milestonecharac'. There are 0 rows in 0 pages for object "tr_milestonecharac". DBCC results for 'sys.queue_messages_825106030'. There are 0 rows in 0 pages for object "sys.queue_messages_825106030". DBCC results for 'tr_activitycharacmap'. There are 0 rows in 0 pages for object "tr_activitycharacmap". DBCC results for 'tr_riskvalue'. There are 0 rows in 0 pages for object "tr_riskvalue". DBCC results for 'tr_audit'. There are 0 rows in 0 pages for object "tr_audit". DBCC results for 'tr_timesheetcharac'. There are 0 rows in 0 pages for object "tr_timesheetcharac". DBCC results for 'tr_roleaccess'. There are 311 rows in 3 pages for object "tr_roleaccess". DBCC results for 'tr_demandtypecharacgroup'. There are 0 rows in 0 pages for object "tr_demandtypecharacgroup". DBCC results for 'tr_requestcalcfactor'. There are 66 rows in 1 pages for object "tr_requestcalcfactor". DBCC results for 'tr_system'. There are 1 rows in 1 pages for object "tr_system". DBCC results for 'tr_dependency'. There are 0 rows in 0 pages for object "tr_dependency". DBCC results for 'tr_budget'. There are 0 rows in 0 pages for object "tr_budget". DBCC results for 'tr_teamaccess'. There are 0 rows in 0 pages for object "tr_teamaccess". DBCC results for 'tr_demandtype'. There are 0 rows in 0 pages for object "tr_demandtype". DBCC results for 'tr_demandresgroup'. There are 0 rows in 0 pages for object "tr_demandresgroup". DBCC results for 'tr_requestvalue'. There are 0 rows in 0 pages for object "tr_requestvalue". DBCC results for 'tr_investmentallocation'. There are 0 rows in 0 pages for object "tr_investmentallocation". DBCC results for 'tr_step'. There are 14 rows in 1 pages for object "tr_step". DBCC results for 'tr_resourcecost'. There are 0 rows in 0 pages for object "tr_resourcecost". DBCC results for 'tr_indexerqueue'. There are 2922595 rows in 10751 pages for object "tr_indexerqueue". CHECKDB found 0 allocation errors and 2 consistency errors in table 'tr_indexerqueue' (object ID 1157579162). DBCC results for 'tr_demandtypemap'. There are 0 rows in 0 pages for object "tr_demandtypemap". DBCC results for 'tr_demandhistory'. There are 0 rows in 0 pages for object "tr_demandhistory". DBCC results for 'tr_rate'. There are 0 rows in 0 pages for object "tr_rate". DBCC results for 'tr_task'. There are 25669 rows in 1470 pages for object "tr_task". DBCC results for 'tr_requestinherit'. There are 0 rows in 0 pages for object "tr_requestinherit". DBCC results for 'trx_eventlog'. There are 132115 rows in 1456 pages for object "trx_eventlog". DBCC results for 'tr_characgroup'. There are 4 rows in 1 pages for object "tr_characgroup". DBCC results for 'trx_v_element_full'. There are 0 rows in 0 pages for object "trx_v_element_full". DBCC results for 'tr_riskcharac'. There are 0 rows in 0 pages for object "tr_riskcharac". DBCC results for 'trx_v_element'. There are 82595 rows in 381 pages for object "trx_v_element". DBCC results for 'trx_wsloc'. There are 6948 rows in 51 pages for object "trx_wsloc". DBCC results for 'tr_stepcharac'. There are 11 rows in 1 pages for object "tr_stepcharac". DBCC results for 'trx_wslocdata'. There are 14761 rows in 91 pages for object "trx_wslocdata". DBCC results for 'tr_genericresource'. There are 0 rows in 0 pages for object "tr_genericresource". DBCC results for 'trx_wsextdata'. There are 50790 rows in 305 pages for object "trx_wsextdata". DBCC results for 'trx_wsrouting'. There are 2 rows in 1 pages for object "trx_wsrouting". DBCC results for 'trx_wsoperation'. There are 8 rows in 1 pages for object "trx_wsoperation". DBCC results for 'tr_taskvalue'. There are 334023 rows in 5420 pages for object "tr_taskvalue". DBCC results for 'trx_wsitem'. There are 45 rows in 1 pages for object "trx_wsitem". DBCC results for 'tr_team'. There are 0 rows in 0 pages for object "tr_team". DBCC results for 'tr_prioritytype'. There are 3 rows in 1 pages for object "tr_prioritytype". DBCC results for 'trx_usersetting'. There are 136 rows in 2 pages for object "trx_usersetting". DBCC results for 'trx_wsext'. There are 5200 rows in 49 pages for object "trx_wsext". DBCC results for 'tr_charac'. There are 17 rows in 1 pages for object "tr_charac". DBCC results for 'tr_departmentvalue'. There are 0 rows in 0 pages for object "tr_departmentvalue". DBCC results for 'tr_statusreport'. There are 0 rows in 0 pages for object "tr_statusreport". DBCC results for 'tr_requestcharac'. There are 1 rows in 1 pages for object "tr_requestcharac". DBCC results for 'av_activity'. There are 47973 rows in 3548 pages for object "av_activity". DBCC results for 'av_actres'. There are 50178 rows in 963 pages for object "av_actres". DBCC results for 'tr_bucketcosttype'. There are 0 rows in 0 pages for object "tr_bucketcosttype". DBCC results for 'tr_opitem'. There are 0 rows in 0 pages for object "tr_opitem". DBCC results for 'av_project'. There are 499 rows in 24 pages for object "av_project". DBCC results for 'tr_demandtypevalue'. There are 0 rows in 0 pages for object "tr_demandtypevalue". DBCC results for 'tr_fountain'. There are 0 rows in 1 pages for object "tr_fountain". DBCC results for 'tr_statustype'. There are 3 rows in 1 pages for object "tr_statustype". DBCC results for 'tr_role'. There are 18 rows in 1 pages for object "tr_role". DBCC results for 'tr_departmentcharac'. There are 0 rows in 0 pages for object "tr_departmentcharac". DBCC results for 'tr_bucketvalue'. There are 0 rows in 0 pages for object "tr_bucketvalue". DBCC results for 'tr_deptbudget'. There are 0 rows in 0 pages for object "tr_deptbudget". DBCC results for 'tr_resourcetype'. There are 0 rows in 0 pages for object "tr_resourcetype". DBCC results for 'tr_taskresource'. There are 0 rows in 0 pages for object "tr_taskresource". DBCC results for 'avx_dbinfo'. There are 2 rows in 1 pages for object "avx_dbinfo". DBCC results for 'tr_stepvalue'. There are 0 rows in 0 pages for object "tr_stepvalue". DBCC results for 'tr_process'. There are 0 rows in 0 pages for object "tr_process". DBCC results for 'tr_execoption'. There are 0 rows in 0 pages for object "tr_execoption". DBCC results for 'av_respool'. There are 1518 rows in 11 pages for object "av_respool". DBCC results for 'av_resource'. There are 1537 rows in 18 pages for object "av_resource". DBCC results for 'tr_guestroleaccess'. There are 7 rows in 1 pages for object "tr_guestroleaccess". DBCC results for 'tr_risk'. There are 0 rows in 0 pages for object "tr_risk". DBCC results for 'tr_restypeassoc'. There are 0 rows in 0 pages for object "tr_restypeassoc". DBCC results for 'tr_allocbucketpref'. There are 0 rows in 0 pages for object "tr_allocbucketpref". DBCC results for 'tr_deptassociation'. There are 0 rows in 0 pages for object "tr_deptassociation". DBCC results for 'tr_releasefunction'. There are 122 rows in 1 pages for object "tr_releasefunction". DBCC results for 'tr_stepresbudget'. There are 0 rows in 0 pages for object "tr_stepresbudget". DBCC results for 'tr_requirecharac'. There are 0 rows in 0 pages for object "tr_requirecharac". DBCC results for 'tr_etl_event'. There are 0 rows in 0 pages for object "tr_etl_event". DBCC results for 'tr_requestaccess'. There are 6 rows in 1 pages for object "tr_requestaccess". DBCC results for 'tr_usersetting'. There are 253 rows in 9 pages for object "tr_usersetting". DBCC results for 'tr_budgetallocation'. There are 0 rows in 0 pages for object "tr_budgetallocation". DBCC results for 'tr_resourcevalue'. There are 10 rows in 1 pages for object "tr_resourcevalue". DBCC results for 'tr_budgetbenpref'. There are 0 rows in 0 pages for object "tr_budgetbenpref". DBCC results for 'tr_execreport'. There are 0 rows in 0 pages for object "tr_execreport". DBCC results for 'tr_department'. There are 1 rows in 1 pages for object "tr_department". DBCC results for 'tr_filter'. There are 0 rows in 1 pages for object "tr_filter". DBCC results for 'tr_demand'. There are 0 rows in 0 pages for object "tr_demand". DBCC results for 'tr_resgroupuser'. There are 0 rows in 0 pages for object "tr_resgroupuser". DBCC results for 'tr_taskcharac'. There are 86744 rows in 754 pages for object "tr_taskcharac". DBCC results for 'tr_approvalaudit'. There are 0 rows in 0 pages for object "tr_approvalaudit". DBCC results for 'tr_bucketcharac'. There are 0 rows in 0 pages for object "tr_bucketcharac". CHECKDB found 0 allocation errors and 2 consistency errors in database 'A7RETE'. repair_rebuild is the minimum repair level for the errors found by DBCC CHECKDB (A7RETE). DBCC execution completed. If DBCC printed error messages, contact your system administrator.
So how do I trap this error in a script or procedure?




SSC Eights!
Group: General Forum Members
Last Login: Yesterday @ 6:32 AM
Points: 835,
Visits: 3,276


Did you see my post on page 3 of the comments? Rich




Mr or Mrs. 500
Group: General Forum Members
Last Login: Today @ 1:24 AM
Points: 567,
Visits: 2,360


rmechaber (9/28/2012) Did you see my post on page 3 of the comments? Rich Yes, it's 200 lines of code and comments (I like those!) But I'm comparing 1 line of my code (a single DBCC CHECKDATABSE) with 8 lines of my trivial code trying to trap an error. Why are they getting different results in the Messages window? Where am I going wrong?




SSC Eights!
Group: General Forum Members
Last Login: Yesterday @ 6:32 AM
Points: 835,
Visits: 3,276


Michael Meierruth (9/28/2012)
rmechaber (9/28/2012) Did you see my post on page 3 of the comments? RichYes, it's 200 lines of code and comments (I like those!) But I'm comparing 1 line of my code (a single DBCC CHECKDATABSE) with 8 lines of my trivial code trying to trap an error. Why are they getting different results in the Messages window? Where am I going wrong? Sorry Michael, I didn't read your post closely enough to realize that you were getting different results back when checking the same database. I have no idea, and I'll look forward to Paul Randal's reply.
I just tried running your code block against a Broken database I downloaded from Paul's website and compared the output from a direct run [DBCC CHECKDB('broken')] with your code block (also checking DB 'broken'). I saved the output from both runs to text files and ran them through a text comparison utility; the direct run had the following lines in the output that were missing from the TRY..CATCH attempt:
Msg 8928, Level 16, State 1, Line 1 Object ID 2073058421, index ID 0, partition ID 72057594038321152, alloc unit ID 72057594042318848 (type Inrow data): Page (1:143) could not be processed. See other errors for details. Msg 8939, Level 16, State 98, Line 1 Table error: Object ID 2073058421, index ID 0, partition ID 72057594038321152, alloc unit ID 72057594042318848 (type Inrow data), page (1:143). Test (IS_OFF (BUF_IOERR, pBUF>bstat)) failed. Values are 29493257 and 4.
Rich
P.S. Add'l: I am wondering if this is an artifact of the TRY..CATCH block itself. I don't use it enough myself to know if this is related, but you might want to look here and here.




SSCrazy
Group: General Forum Members
Last Login: Saturday, August 8, 2015 1:22 PM
Points: 2,047,
Visits: 1,685


It's nothing to do with DBCC  it's the try/catch eating the errors being printed. No idea how to use that correctly  it has some weird behavior.
Nothing changes the behavior of DBCC, but you're changing the way the DBCC output is consumed.
All I said was after running DBCC, the value of @@error will be nonzero if errors were found.
Paul Randal CEO, SQLskills.com: Check out SQLskills online training! Blog:www.SQLskills.com/blogs/paul Twitter: @PaulRandal SQL MVP, Microsoft RD, Contributing Editor of TechNet Magazine Author of DBCC CHECKDB/repair (and other Storage Engine) code of SQL Server 2005




SSC Eights!
Group: General Forum Members
Last Login: Yesterday @ 6:32 AM
Points: 835,
Visits: 3,276


Paul Randal (9/28/2012) It's nothing to do with DBCC  it's the try/catch eating the errors being printed. No idea how to use that correctly  it has some weird behavior.
Nothing changes the behavior of DBCC, but you're changing the way the DBCC output is consumed.
All I said was after running DBCC, the value of @@error will be nonzero if errors were found.
Thanks for confirming my suspicions Paul. As I said, I don't use it often enough to understand why that happens, but it looks like TRY..CATCH has trouble handling multiple errors in one go.
Michael: I ran my SP that I had posted against a broken DB, and b/c there is no TRY..CATCH involved, the Level 16 errors do get dumped to the output table, which means you could then query that output table. The only reason I included the final TRY..CATCH in the SP is to handle the rare possibility that DBCC CHECKDB itself fails b/c the DB errors are so severe.
Rich




SSC Journeyman
Group: General Forum Members
Last Login: Yesterday @ 4:08 AM
Points: 93,
Visits: 1,143


Another significant problem with maintenance plans, well documented, is that the 'Verify Backups' check box doesn't translate to backups WITH CHECKSUM. It actuall runs a restore verify only immediately after the backup, I don't understand why they don't use WITH CHECKSUM (when possible) if this option is enabled.
If you assume some responsibility for mature production database servers with maintenance plans that have been running for years, its difficult to make the case to management that they should all be replaced with TSQL jobs so they can use CHECKSUM.




Mr or Mrs. 500
Group: General Forum Members
Last Login: Today @ 1:24 AM
Points: 567,
Visits: 2,360


Paul Randal (9/28/2012) It's nothing to do with DBCC  it's the try/catch eating the errors being printed. No idea how to use that correctly  it has some weird behavior.
Nothing changes the behavior of DBCC, but you're changing the way the DBCC output is consumed.
All I said was after running DBCC, the value of @@error will be nonzero if errors were found.
Paul,
OK, I confirm what you say about @@error after 'dbcc checkdb'. So now I can catch all 3 situations:
dbcc checkdb backup database with checksum restore verifyonly with checksum
and if something goes wrong I get an email  heaven forbid.
One thing that still leaves me a bit puzzled is that sometimes modifying a single byte somewhere in the database (MDF file) checkdb does not detect the database to be 'corrupt' (nor does backup with checksum). Maybe it's because the page is 'inactive', so I do a shrinkfile but I can still get this phenomena to occur. If every page (8192 bytes) in the file has a checksum then modifying a single byte at random should corrupt the database. I can only assume that not all pages get checked because they are 'not important' in some deep down technical sense.
Regarding 'restore verifyonly', there seems to be no difference between having 'with checksum' and not having it. I can corrupt a backup and I get the same error message with 'with checksum' and without it. But I'm happy doing it with 'with checksum'.
I will now stop corrupting things...



