SQL Dumbass

Fighting dumbasses, one query at a time…

Please Fix

The other day I get a frantic email from a developer. Seems that our team was asked to migrate a table from production to test yesterday and in doing so we did not preserve an identity column. As such, their load process was failing. So, rather than notify us that we had made a mistake, the developer decides to play “Junior DBA” and re-add the identity himself. And after it ran for about two and a half hours an error message appeared:

The log file for database ‘databasename’ is full. Back up the transaction log for the database to free up some log space.

At the end of the email were two words: Please fix.

Okay, we should be able to do that. Of course, we have other issues now. See, the log drive for this box was about 70Gb. He did not just fill up his log, he filled up the disk. Do you know what happens to other databases that cannot use the disk to write their logs? Yeah, I know you do. Too bad he did not. Of course, this junior DBA figured that with the database in simple recovery mode that the log would not grow, and assumed we should be able to fix things in about two minutes.

Why the hell not call us at the start? As a result, the server was out of service for a few hours as we tried to get things back in order. All the while he complains that if we had done things right to begin with, none of this would have happened. My thinking? Yeah, if we had never hired you to begin with, then none of this would have happened.

Anyway, this snowballs into more problems. Now people want to know why we are not monitoring the available free space on our disk drives. Huh? We are! We knew the drive had filled up! “Well, why didn’t you do anything?” Do what? Go to the box and start killing spids? I am not the one that kicked this thing off, you did. How about having some understanding of the basic technology you are being asked to work with? Once we saw the issue we starting working to fix it. Any idea how long it takes to undo a transaction that filled up a 70Gb drive? It takes more than a few minutes.