| A community of more than 1,600,000 database professionals and growing |
| | Handling Data Corruption I wrote about dealing with data loss recently, ansking what your plans are for a situation. Some of you might rely on digital systems, some rely on humans, and some just accept some data loss. All of those are valid responses, depending on your environment. Today I wanted to take another step on this journey. Imagine that one of your systems has data corruption. Any system you have, but pick one that might cause you some anxiety. Maybe you discover it from a failed query, maybe from an entry in the error log, maybe from a DBCC execution (I hope you use these). You have no idea how long the corruption has been there. Therefore, you don't know how many backups are valid. What do you do? What are your plans? Certainly there could be data loss potential here. There will likely be some questions about why this wasn't known immediately, and maybe you'll experience some embarrassment in the moment. This will be a stressful moment in your career, and one with which you will want to be able to cope. The question today is to get you to prepare a bit and game the possibilities. Some of you might never experience corruption, but you never know, so it does make some sense to think in advance and anticipate the reaction you want to have in the moment. We always want to be prepared, but we won't have actual preparation plans (scripts, documents, etc) for all situations. It's much easier to think about the possibilities, rather that actually build plans for every possibility. Maybe you want to even discuss and debate them among your peers. Today's question is good practice for the real situation, and great mental preparation for a real event. Plus it can be a bit fun to brainstorm, have someone shoot holes in your ideas, you do the same for them, and then come up with another solution. Steve Jones from SQLServerCentral.comJoin the debate, and respond to today's editorial on the forums |
| The Voice of the DBA Podcast Listen to the MP3 Audio ( 3.0MB) podcast or subscribe to the feed at iTunes and Libsyn. The Voice of the DBA podcast features music by Everyday Jones. No relation, but I stumbled on to them and really like the music. | |
|
|
| ADVERTISEMENT | | New SQL Monitor Reporting Module SQL Monitor now includes a new Reporting module. It allows you to create customized reports, combining the individual server performance metrics available in SQL Monitor with summary information on your entire SQL Server estate. These reports can then be exported to pdf and emailed to you on a scheduled basis. Download SQL Monitor now and get a 14 day free trial |
| | Could your SQL coding be more efficient? Data Platform MVPs and SQL Server experts share their tips on how to standardize formatting whilst stripping out the repetition of coding with SQL Prompt. Over these 20 short videos we will help you write better, shareable SQL faster. Check out the tips |
|
|
|
| | | Nick Burns from SQLServerCentral.com Using R to detect outliers is relatively easy, but most methods assume your data is normally distributed. How do you handle skewed datasets? More » |
| Additional Articles from SQLPerformance.com Tim Radney of SQLskills walks through multiple automation methods you can use to manage and maintain your Azure SQL Databases. More » |
| The recent launch of Redgate SQL Clone v2 has removed the previous 2TB size limit, as the tool now supports cloning databases up to a whopping 64TB. In this post, Karis Brummit explains how the increase has been possible. More » |
| Andrew Pruski from SQLServerCentral Blogs Normally when I work with SQL instances within containers I treat them as throw-away objects. Any modifications that I make... More » |
|
|
| | Today's Question (by Steve Knox): In your Play database, you have two tables, dbo.Stage and dbo.Live. They have the same columns and indexes (and meet all other metadata requirements for ALTER TABLE ... SWITCH), but they are NOT partitioned. Stage has 300 rows of data, and Live has 0. You issue the following command: ALTER TABLE dbo.Stage SWITCH PARTITION 1 TO dbo.Live PARTITION 5; What happens? (Choose 3.) |
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 3 points in this category: Alter table. 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 | T-SQL Querying (Developer Reference) Squeeze maximum performance and efficiency from every T-SQL query you write or tune. Four leading experts take an in-depth look at T-SQL’s internal architecture and offer advanced practical techniques for optimizing response time and resource usage. Get your copy from Amazon today. | | |
|
|
|
|
|
| Yesterday's Question of the Day |
| Yesterday's Question (by Matt Crowley): What is the value of @@ROWCOUNT after each of statements are run: SET NOCOUNT ON CREATE TABLE #temp (col1 int) CREATE TABLE #tempout (col1 int) INSERT INTO #temp OUTPUT inserted.col1 INTO #tempout VALUES (1), (2), (3) SELECT @@rowcount UPDATE #temp SET col1 += 1 OUTPUT inserted.col1 INTO #tempout SELECT @@rowcount Answer: 3, 3 Explanation: SET NOCOUNT only affects messages sent to the calling process. It has no effect on the value of @@ROWCOUNT: click here While twice the number of rows are manipulated, @@ROWCOUNT only represents the results of the parent statement. The documentation for the OUTPUT clause contains this caveat: @@ROWCOUNT returns the rows inserted only by the outer INSERT statement. This apparently also applies to outer UPDATE and DELETE statements as well, but this is not explicitly stated. There are a number or restrictions on the table you can output to, (e.g. the table can not have triggers, check constraints, or participate in foreign key constraints as a parent or a child, nor can you output to a view), but a temporary table is valid. You can even return the results of the OUTPUT clause as a recordset to the calling process. 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. Untrusted Constraints - Morning All, I have a need to demonstrate the difference between execution plans when a constraint is trusted and untrusted. I've set... LOOPING a Delete Store Procedure - Hi, I have the Following SP that will be sending the data to archive data before deleting data from tables, I'm... Help needed in resolving dead lock - Hello All, We are getting frequent deadlocks on one of sql server instance. Any help\suggestions will be greatly appreciated. Below is the deadlock... DBCC Check hanging, killed but does not roll back. - Hi everyone. I have a problem with a Killed session. The command Issued was DBCC CHECKDB () WITH NO_INFOMSGS, ALL_ERRORMSGS (Ola Halengrens... replacing hard coded value with column name fails the query - Below I've commented out what is failing to work. By fail, i mean no result set. when i substitute o.Datekey for '2017-05-17'... SUBSTRING and CHARINDEX query.... please help. - Hi, I have this table, column, and string: Table = audit_log Column named = request_u Example column value = http://stable-test.test.net/api/files/fs.testcollection/TP-0000000.pdf/download/ What I need to do is return the... Copy Table Data - I have a large table that I need to copy. (insert into , select, from ) It brakes with the following... Meaning of SSMS 2014 "Register Data-tier Application..." ?? - I have created dacpac files and am familiar with the technology but I don't under what a "Data-tier App" is.... More problems with SQL 2014's new Cardinality Estimator - We have an established SQL-based product which has been running just fine (with the occasional problem!) on SQL 2005 ... 2012... Using Cursors And Fetch - Hi Guys, I'm writing a basic data entry app with VB.Net. I'm in the process of attempting to convert client side... Convert integer to date - Hello, In a flat file source (that comes from a Microsoft publishing "Training Kit - Implementing a Data Warehouse with Microsoft SQL... Order of Data and Cursor Fetch Next Order - I have inherited some SQL code. The stored proc creates a temp table of some of the views in sys.views. Then... performance question about profiler trace - I have a problem where one of my procedures is very slow but I struggle to understand one aspect of... Dedup Large Table - I have a very wide table about 46 columns, there are approx 328 million rows in the table. We are... Script help / DB mail - I send myself a test email and it works fine (I receive it) but when I execute this piece of... Unable to understand the Query Logic - Hi While I was browsing for some interesting puzzles on t-sql I found the below one. but I am unable to understand... Removing a secondary tempdb file - Hello. I created a secondary tempdb file on our testing server the other day and i wish now to remove it. I... Stop Duplicates - SQL Task - SSIS 2010 - hi fairly new to SSIS I have to run an excel sheet every quarter (every 3 months) there is no unique... Someone please help - SSIS - Get info from SQL server table about which particular files to load in target SQL server table - Hi all, I am struggling with the problem as below. "A folder contains many source files (may be excel or text... Using SQLExpress in Production - Hi All, I must first confess that I am not a network admin and I am by no means a SQL... |
|
| This email has been sent to [email protected]. To be removed from this list, please click here. If you have any problems leaving the list, please contact the [email protected]. | 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 ©2017 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved. Contact: [email protected] |
|
|