| A community of more than 1,600,000 database professionals and growing |
| | Checking CHECKDB One of the recommendations for SQLServer is that you run a DBCC CHECKDB regularly on your system. Those individuals that have worked with SQL Server for some time and worked on learning more about the system know to schedule this check, and even ensure that you restore backups to check them on a regular basis. Note, running these checks on secondary systems may or may not be valid. You might want to read Paul Randal's post on this. Experienced DBAs know that when corruption strikes, you can find yourself in a very problematic situation. Corruption can be captured in backups, which means that if it appears, it's entirely possible that if this has been in your system for some time, all the backup files you have contain the same corruption. If this is inside a table, you might end up losing data, which is never what any of us want. Those that might not be familiar with SQL Server, or have never learned about regular maintenance might not realize that DBCC is needed. In fact, they might not know if CHECKDB has ever been run on their system. It used to be hard to find this, but things became easier over the years. When checkdb runs, it does write a note in the error log, but that's not a great way to track this information for administrators, especially if the instance has been restarted. Without a set of tools in place, this becomes a project for anyone that starts working with a new system to track down. That changes in SQL Server 2016 SP2. There's a new property for your database, a parameter for DatabasePropertyEx(). The value is LastGoodCheckDbTime, which in this case, you can get the last datetime when a checkdb was run. To me, this should be some sort of alert that your monitoring system has in place that lets you know if this value is too old. The problem is that for many of us, we may run DBCC CHECKDB on another machine, perhaps on a restored copy of production, so how can we track this? Is there a way that would make sense? I'd like to think that perhaps any script testing a backup should connect back to the primary database and update this value. There isn't a specific place for this, but I certainly could see using extended properties for this. At least then we could more easily determine if we haven't been regularly checking a particular database for corruption. If you have other ideas, I'd be interested in how one might actually track this. For now, use this property to ensure you're checking those databases where you do execute CHECKDB, and if you aren't sure if you should do this, you should. Go learn about what CHECKDB does and why it's important for your production systems. Steve Jones from SQLServerCentral.comJoin the debate, and respond to today's editorial on the forums |
|
| ADVERTISEMENT | | How to track every change to your SQL Server database See who’s changing your database, alongside affected objects, date, time, and reason for the change with SQL Source Control. Get a full change history in your source control system. Learn more |
| |
|
|
| | | Vishnu Gupthan from SQLServerCentral.com This article will give you insight to understand how you can schedule a powershell script you have written using SQL Server Agent. More » |
| Redgate is joining forces with DevOps Research and Assessment (DORA) and Google Cloud to support the pursuit of DevOps excellence. The research aim is to better understand the DevOps landscape, and to surface new findings that provide guidance for improvement in resource management, productivity, and quality of technology delivery teams. To have your say and be part of the research, simply take the survey - there are even some great prizes up for grabs! More » |
| Additional Articles from Database Journal Do you have data load processes that drop indexes to optimize the load process? Are you dropping those indexes in one step, then loading data into your table, only to recreate the indexes in a post data load step? More » |
| Many organizations are experiencing rapid expansion and diversification of their SQL Server estate to include Cloud, VMWare and other platforms, alongside traditional on-premise servers. This article explains the basic architecture and components of SQL Monitor, and then how to set up a distributed monitoring solution. More » |
| Devin Knight from SQLServerCentral Blogs In this module you will learn how to use the Slim Data Bar KPI Visual. The Slim Data Bar KPI... More » |
|
|
| | Today's Question (by Junior Galvão - MVP): A page is considered "suspect" when the SQL Server Database Engine encounters one of the following errors when it tries to read a data page. Select the three alternatives that you consider to be correct: |
Think you know the answer? Click here, and find out if you are right. We keep track of your score to give you bragging rights against your peers. This question is worth 1 point in this category: suspect page. We'd love to give you credit for your own question and answer. To submit a QOTD, simply log in to the Contribution Center. |
|
|
| |
ADVERTISEMENT | Exam Ref 70-765 Provisioning SQL Databases Prepare for Microsoft Exam 70-765–and help demonstrate your real-world mastery of provisioning SQL Server databases both on premise and in SQL Azure. Designed for experienced IT professionals ready to advance their status, Exam Ref focuses on the critical thinking and decision-making acumen needed for success at the MCSA level. Get your copy from Amazon today. | | |
|
|
|
|
|
| Yesterday's Question of the Day |
| Yesterday's Question (by Steve Jones): I have a database in which the last DBCC CHECKDB reported corruption errors. Before I try to repair this, I want to be sure I have a copy of the data in the event something goes wrong. I try to run BACKUP DATABASE MyImportantDB to DISK = 'MyImportantDB_PreRepair.bak' but I get an error. What can I do to get a full database backup? Answer: use the WITH CONTINUE_AFTER_ERROR option for the backup command Explanation: While you can set the database to offline and copy thefiles, this is not your only option. You can use the CONTINUE_AFTER_ERROR option. Ref: BACKUP - click here » Discuss this question and answer on the forums |
|
|
| Database Pros Who Need Your Help |
| Here's a few of the new posts today on the forums. To see more, visit the forums. SSIS Package Execution issue using ODBC Oracle Source - Hi, I'm having an issue running a package when I have an ODBC Oracle Source. When I manually execute the package... Return 2 lines of text from a row - My SQL query is: SELECT * FROM .. WHERE = 0 AND ='James' This pulls all the correct data... RE: SSL encryption. When is installing certificate on client necessary? - Some MSDN documentation when explaining how to setup SSL encryption for SQL Server, include a step similar to the following: "..... Regex in SQL - Greetings, I am what you will call an accidental DBA. I was a Systems Engineer and now I have to watch... In what twisted SQL world will a JOIN result in more records than a LEFT JOIN - I have never seen this before and it goes against everything that I know about SQL data sets. I have... Is there a maximum number of joins allowed in SQL 2016? - I have reports that are between 6 and 100 User DefinedFunctions joined together. When I have the compatibility level set... Storing multiple variations of the same data? - Can anyone weigh in on why you would want to store multiple variations of the same data? In all of... Importing from XML to SQL 2014 - This is my 4th day on SQL so I am a newbie. I created a query to import from an... Strng Help Again Needed. - Moving Databases from SQL 2008 Enterprise on Windows 2008 R2 Enterprise server To SQL 2014 Enterprise Windows 2012 R2 Cluster... Friday Fun - Excel Formula to SQL Functions - I recently found a nifty Excel Formula that worked out if a datetime was UTC or BST (British Summer time)... Change formatting of SSMS generated code - Hi all, not exactly the most pressing query ever, but after all these years I've finally cracked. Is there any way... Adding a SQL Server instance to existing 2012 cluster - I have a 3 node, active-active-passive cluster. Node A host 2 SQL Server instances, node B 3rd instance. All are... Restoring database A also tries to Restore database B - Hi Guys, Had a very strange is happen to me, I was required to restore our production db to a specific... Log shipping and database backups - Hi all We've got a few databases that we want to start log-shipping from. Normally, we'd use replication but the 3rd-party software... No alternative but row-by-row processing? - I know how to do this with a loop or cursor, but wondered if there was a brilliant mind out... simple select * from table takes around 15 secons - I have a table with like 115+ columns and it got the data around 76000 records I ran the query, Select... Transaction Log Too Big and Won't Shrink - I have been tasked with figuring out haw to shrink a 2.5 Terrabyte log file. When I took it over... TRY_CONVERT - A short look at this T-SQL function, and where it can help write better code. Practical examples preferred. create temp view - Is it possible to create a temporary view from within a stored procedure for the life of the stored procedure.... The SQL Saturday Thread - As popular as SQL Saturday is, I'm surprised that nobody created a thread dedicated to SQL Saturday, so I created... |
|
| This email has been sent to newsletter@newslettercollector.com. To be removed from this list, please click here. If you have any problems leaving the list, please contact the webmaster@sqlservercentral.com. | This newsletter was sent to you because you signed up at SQLServerCentral.com. Feel free to forward this to any colleagues that you think might be interested. If you have received this email from a colleague, you can register to receive it here. | This transmission is ©2018 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved. Contact: webmaster@sqlservercentral.com |
|
|