T-SQL Tuesday #86   Adding when DBCC CHECKDB last ran to the SYS.DATABASES cata ...
SQLvariant T-SQL Tuesday #86 Adding when DBCC CHECKDB last ran to the SYS.DATABASES catalog view Posted on 10 January 2017 Comments Brent Ozar is hosting TSQL2sDay #86 this month and in response to Brent Ozar’s Call for Important Connect Items I wanted to highlight this one about adding the date of the last known good DBCC CHECKDB to SYS.DATABASES. This one seems like a no-brainer to me. When you NEED this information, you don’t want to have to go hunting for it, and ever Microsoft agreed: “Posted by Sunil [MSFT] on 8/20/2008 at 11:05 AM This issue has been approved/fixed and should be available in a future release of SQL Server. Thanks for providing us your feedback to SQL Server. ” https://connect.microsoft.com/SQLServer/feedback/details/350596/ Adding when DBCC CHECKDB last ran to the SYS.DATABASES catalog view Description Currently it is not easy to determine when DBCC CHECKDB last ran successfully on a database. Of if you like when it last ran and the state value of that execution in the case of a failure. (The state values that are discussed in BOL at http://msdn.microsoft.com/en-us/library/ms176064.aspx) Sure the information is written to the error log. You can also examine the dbi_dbccLastKnownGood value in page 9 of the database. But it should be easier to get this critical information. The Good News: The good news is that someone Sankar Reddy figured out an easy way how to do it and posted their query in the comments on the Connect Item: CREATE TABLE #temp (Id INTIDENTITY(1,1), ParentObject VARCHAR(255), [Object] VARCHAR(255), Field VARCHAR(255), [Value] VARCHAR(255) ) INSERT INTO #temp EXECUTE SP_MSFOREACHDB‘DBCC DBINFO ( ”?”) WITH TABLERESULTS’; ;WITH CHECKDB1 AS ( […]

本文数据库(mssql)相关术语:熊片数据库 mssql数据库 oracle数据库 pubmed数据库 access数据库 万方数据库

主题: SQLSQL ServerTISUUTCU
分页:12
转载请注明
本文标题:T-SQL Tuesday #86 Adding when DBCC CHECKDB last ran to the SYS.DATABASES cata ...
本站链接:http://www.codesec.net/view/523976.html
分享请点击:


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 数据库(mssql) | 评论(0) | 阅读(42)