It's T-SQL Tuesday time again, and this month the host is Raul Gonzalez (blog/@SQLDoubleG). His chosen topic is Lessons Learned the Hard Way. (Everybody should have a story on this one, right?)
When considering this topic the thing that spoke most to me was a broad generalization (and no, it isn't #ItDepends)
https://cdn.meme.am/cache/instances/folder589/500x/64701589/grumpy-cat-5-trust-but-verify.jpg |
Yes I am old enough (Full Disclosure) to know many people associate the phrase "Trust But Verify" with a certain Republican President of the United States, but it really is an important part of what we do as DBA's.
When a peer sends you code to review, do you just trust it's OK?
https://cdn.meme.am/cache/instances/folder809/66278809.jpg |
When a client says they're backing up their databases, do you trust them?
https://cdn.meme.am/cache/instances/folder686/500x/64677686/willy-wonka-trust-but-verify.jpg |
When *SQL SERVER ITSELF* says it's backing up your databases, do you trust it?
https://imgflip.com/i/1sc4nl |
(Catching a theme yet?)
At the end of the day, as the DBA we are the Default Blame Acceptors, which means whatever happens, we are Guilty Until Proven Innocent - and even then we're guilty half the time.
This isn't about paranoia, it's about being thorough and doing your job - making sure the systems stay up and the customers stay happy.
- Verify your backup jobs are running, and then run test restores to make sure the backup files are good.
- Verify your SQL Server services are running (when they're supposed to be)
- Verify your databases are online (again, when they're supposed to be)
- Verify your logins and users have the appropriate security access (#SysadminIsNotAnAppropriateDefault)
- Read through your code and that of your peers - don't just trust the syntax checker!
- When you find code online in a blog or a Microsoft forum, read through it and check it - don't just blindly execute it because it was written by a Microsoft employee or an MVP - they're all human too! (This almost bit me once on an old forum post where thankfully I did read through the code before I pushed Execute - the post was two years old with hundreds of reads so it would be fine, right? There was a pretty simple mistake in the WHERE clause and none of the hundreds of readers had seen it or been polite enough to point it out to the author!)
- Run periodic checks to make sure all of your Perfmon traces (you are running Perfmon traces, right?), Windows Tasks, SQL Agent Jobs, XEvents sessions, etc. are installed properly and configured with the current settings - just because the instance has a job named "Online Status Check" on it doesn't mean the version is anything like your current code!
http://blog.idonethis.com/wp-content/uploads/2016/04/yoda.jpg |