SlideShare a Scribd company logo
How Not to be a Cranky DBA
     Tips for Bringing Sanity to Your SQL Server Environment
Mike Hillwig
 AKA The Cranky DBA

 SQL Server DBA

 Working with SQL Server since SQL 7

 Contract DBA at hosting division of a financial software
  company

 Working as the lone SQL DBA in an army of Oracle DBAs

 Resume includes Acme Packet, Shawmut Design and
  Construction, Equitable Resources
Mike Hillwig
 Avid Cook

 Lover of Blue Cheese

 And Bacon

 Geek at Heart

 Owned by Two Pugs
Obligatory Social Networking Slide
 crankydba.com

 sqlserverpedia.com

 twitter.com/mikehillwig
 SQL Saturday Waltham – 5/19/2012

 SQL Saturday Providence – 9/15/12

 SQL Saturday Nashua – 10/20/12

 Call for speakers in Providence and
  Nashua still open
How not to be a cranky dba
No Need for Notes
Blog post and slide deck will be available later tonight
Tonight’s Format
What Makes a DBA Cranky
 Fixing Unnecessary Mistakes

 Lack of Sleep

 Answering Redundant Questions

 Repeating Manual Processes

 Performance Problems

 Waiting

 Unnecessary Emergencies
Why Does This Make Us Cranky?
We Would Rather
 Spend time with our
  families

 Read

 Sleep

 Play Angry Birds

 Eat Bacon

 Anything other than work
The Tips
Beware of the Blogs

 There is some amazing
  advice out there. But…

 Anybody can put bad advice
  on the internet

 Trust people you know

 I don’t trust people who say
  “ALWAYS” or “NEVER”

 Test everything in your own
  test environment first.
Don’t enable Auto Shrink. Ever.
 This is my only exception
  to “NEVER” advice

 You can’t control when it
  runs

 What you shrink will just
  grow again

 Fragments your indexes

 Instead: Use DBCC
  Shrinkfile
Triggers don’t’ send mail
 Does it need to be now, now, right this very
  moment, now?

 Connecting to an outside application is costly for
  performance

 If the mail server is down, users get ugly results.

 What happens if mail XPs get disabled?

 Instead, write to a queue table and have a SQL Agent
  job process the queue.
Developers Don’t Touch Production

 Developers like to “fix”
  problems.

 Changes must be tested
  before moving into
  production.

 Every environment needs
  a gatekeeper/traffic cop

 You ARE using source
  control, right?
Ask questions like an auditor
 “What would Sandra say?”

 What is our risk exposure?

 Are there any security concerns?

 Will this pose any compliance problems?

 Does this touch anything financial?

 Don’t be afraid to ask your auditor
Consistency is Key
 Versions                 Easier to Troubleshoot

 Configurations           Easier to Remember What’s
                            Where
 Maintenance Processes
                           Leverage the SQL Agent
                            MSX Server
Master the SQL Agent
 Easily automate manual tasks

 Run scripts regularly and have them alert you to
  conditions

 Severity alerts are your friend

 Use Multi-Server Administration
Use Instant File Initialization
 Prevents waiting for a file to grow

 Makes RESTOREs run faster

 Creating new databases is much faster
Plan for when things go bump in the
night

 And they do go bump in the night

 Have a regular troubleshooting script for databases and
  applications for your first-level support

 Give common errors and how to resolve them

 Tailor your alerts to indicate which items require
  immediate attention and which should be flagged for
  next-day resolution
Set Min and Max RAM
 Extremely important in virtual environments

 MIN allows you to be greedy

 MAX gives the OS breathing room
Your server is not a workstation
 Avoid Remote
  Desktop
 Don’t run SSMS
  directly from your
  server
 Instead: Run from
  a workstation
 RUNAS is your
  friend
Set your file growth increments
 Defy the defaults!
 Growth is an ALTER, which is a database lock, which is a
  performance issue
 More growths = fragmentation
 Log growths = high VLFs
 Better yet, monitor regularly and grow files manually
Test restores. Frequently.
 Easily automated

 The worst time to test a restore is when your production
  server fails

 It’s good practice for when something does fail

 Don’t forget to test recovering from long-term storage

 Test recovering to a specific point in time as well as key
  business processes
Reserved words are just
that, reserved

 Reserved words as column names make writing queries
  harder

 [avoid this]

 If it turns blue in SSMS, try something else

 Common offenses:
   SECURITY
   STATUS
   IDENTITY
Limit access to SA and service
account passwords

 Not everyone needs to connect as SA

 Why? Why? Why must anyone have it?

 More hands = less control

 Does the application really need to connect as SA?

 Don’t be afraid to fight with the vendor

 Avoid Mixed Authentication Mode where possible

 Embrace AD authentication
Database servers are that and that
alone.

 Databases are the foundation of most critical business
  applications

 If the database server is slow, everything else is slow

 Web servers, SSRS, SSAS, and SSIS go on a different box

 Keeps server optimized for running databases

 It’s okay to be greedy with system resources
Questions
More
Blog Post at crankydba.com/go/nesql

More Related Content

PDF
How Not to be a Cranky DBA
PPTX
Exam results in SaaS
PPTX
Lessons in moving from physical hosts to mesos
PPTX
5 Things to Ask Your Virtualization Administrator
PDF
10 Tips To Help Boost Your Midsize Organization's Computing Performance
PPTX
Scaling apps for the big time
PPTX
Stacktrace Berlin RC.2
PPTX
Scaling Techniques to Increase Magento Capacity
How Not to be a Cranky DBA
Exam results in SaaS
Lessons in moving from physical hosts to mesos
5 Things to Ask Your Virtualization Administrator
10 Tips To Help Boost Your Midsize Organization's Computing Performance
Scaling apps for the big time
Stacktrace Berlin RC.2
Scaling Techniques to Increase Magento Capacity

What's hot (9)

ODP
WordPress optimization
PDF
Llunitebe2018 worst config mgr cb mistakes
PDF
WSO2Con Asia 2014 - How WSO2 Cloud Accelerates Development
PDF
Boris Renski: OpenStack Summit Keynote Austin 2016
PPTX
Show Me The Cache!
PPT
Develop and Scale with PHP
PDF
Devoxx2017
PDF
Scaling Confluence Architecture: A Sneak Peek Under the Hood
PDF
Fire alarms vs. Fire hoses: Keeping up with Dependencies
WordPress optimization
Llunitebe2018 worst config mgr cb mistakes
WSO2Con Asia 2014 - How WSO2 Cloud Accelerates Development
Boris Renski: OpenStack Summit Keynote Austin 2016
Show Me The Cache!
Develop and Scale with PHP
Devoxx2017
Scaling Confluence Architecture: A Sneak Peek Under the Hood
Fire alarms vs. Fire hoses: Keeping up with Dependencies
Ad

Similar to How not to be a cranky dba (20)

PPTX
Dba101
PPTX
Top 10 DBA Mistakes on Microsoft SQL Server
PPTX
Defy the Defaults
PPTX
Managing SQLserver for the reluctant DBA
PPTX
PPTX
Geek Sync | How to Be the DBA When You Don't Have a DBA - Eric Cobb | IDERA
PDF
Configuring sql server - SQL Saturday, Athens Oct 2014
PPTX
Db As Behaving Badly... Worst Practices For Database Administrators Rod Colledge
PPT
Managing SQLserver
PPTX
Database Maintenance Optimization Brad Mc Gehee
PDF
Becoming a Rock Star DBA
PDF
PPTX
Sql Server tips from the field
PPTX
Is "the bigger the beter" valid in the database world
PPT
Performance Tuning And Optimization Microsoft SQL Database
PPTX
Sql server infernals
PDF
KoprowskiT_SQLSat409_MaintenancePlansForBeginners
PDF
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
PDF
Troubleshooting SQL Server Performance SQL Saturday
PDF
SQL Server Best Practices - Install SQL Server like a boss (RELOADED)
Dba101
Top 10 DBA Mistakes on Microsoft SQL Server
Defy the Defaults
Managing SQLserver for the reluctant DBA
Geek Sync | How to Be the DBA When You Don't Have a DBA - Eric Cobb | IDERA
Configuring sql server - SQL Saturday, Athens Oct 2014
Db As Behaving Badly... Worst Practices For Database Administrators Rod Colledge
Managing SQLserver
Database Maintenance Optimization Brad Mc Gehee
Becoming a Rock Star DBA
Sql Server tips from the field
Is "the bigger the beter" valid in the database world
Performance Tuning And Optimization Microsoft SQL Database
Sql server infernals
KoprowskiT_SQLSat409_MaintenancePlansForBeginners
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
Troubleshooting SQL Server Performance SQL Saturday
SQL Server Best Practices - Install SQL Server like a boss (RELOADED)
Ad

More from Mike Hillwig (9)

PPTX
SQL Phone Home: Teaching Your SQL Servers to Call for Help
PPTX
Closing
PPTX
Opening
PPTX
Do More With Less: SQL Central Management Server and Multi-Server Administration
PPTX
Recovery and backup for beginners
PPTX
What the VLF
PDF
Seven Jobs You Should Be Running #sqlsat126
PDF
New Server in an Hour #sqlsat121
PDF
New Server in an Hour
SQL Phone Home: Teaching Your SQL Servers to Call for Help
Closing
Opening
Do More With Less: SQL Central Management Server and Multi-Server Administration
Recovery and backup for beginners
What the VLF
Seven Jobs You Should Be Running #sqlsat126
New Server in an Hour #sqlsat121
New Server in an Hour

Recently uploaded (20)

PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
MYSQL Presentation for SQL database connectivity
PDF
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
cuic standard and advanced reporting.pdf
PPTX
Big Data Technologies - Introduction.pptx
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PPTX
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Advanced IT Governance
PDF
Advanced Soft Computing BINUS July 2025.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
GamePlan Trading System Review: Professional Trader's Honest Take
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
“AI and Expert System Decision Support & Business Intelligence Systems”
MYSQL Presentation for SQL database connectivity
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
Network Security Unit 5.pdf for BCA BBA.
cuic standard and advanced reporting.pdf
Big Data Technologies - Introduction.pptx
Understanding_Digital_Forensics_Presentation.pptx
CIFDAQ's Market Insight: SEC Turns Pro Crypto
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
Diabetes mellitus diagnosis method based random forest with bat algorithm
Advanced IT Governance
Advanced Soft Computing BINUS July 2025.pdf
The AUB Centre for AI in Media Proposal.docx
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
GamePlan Trading System Review: Professional Trader's Honest Take
20250228 LYD VKU AI Blended-Learning.pptx
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation

How not to be a cranky dba

  • 1. How Not to be a Cranky DBA Tips for Bringing Sanity to Your SQL Server Environment
  • 2. Mike Hillwig  AKA The Cranky DBA  SQL Server DBA  Working with SQL Server since SQL 7  Contract DBA at hosting division of a financial software company  Working as the lone SQL DBA in an army of Oracle DBAs  Resume includes Acme Packet, Shawmut Design and Construction, Equitable Resources
  • 3. Mike Hillwig  Avid Cook  Lover of Blue Cheese  And Bacon  Geek at Heart  Owned by Two Pugs
  • 4. Obligatory Social Networking Slide  crankydba.com  sqlserverpedia.com  twitter.com/mikehillwig
  • 5.  SQL Saturday Waltham – 5/19/2012  SQL Saturday Providence – 9/15/12  SQL Saturday Nashua – 10/20/12  Call for speakers in Providence and Nashua still open
  • 7. No Need for Notes Blog post and slide deck will be available later tonight
  • 9. What Makes a DBA Cranky  Fixing Unnecessary Mistakes  Lack of Sleep  Answering Redundant Questions  Repeating Manual Processes  Performance Problems  Waiting  Unnecessary Emergencies
  • 10. Why Does This Make Us Cranky?
  • 11. We Would Rather  Spend time with our families  Read  Sleep  Play Angry Birds  Eat Bacon  Anything other than work
  • 13. Beware of the Blogs  There is some amazing advice out there. But…  Anybody can put bad advice on the internet  Trust people you know  I don’t trust people who say “ALWAYS” or “NEVER”  Test everything in your own test environment first.
  • 14. Don’t enable Auto Shrink. Ever.  This is my only exception to “NEVER” advice  You can’t control when it runs  What you shrink will just grow again  Fragments your indexes  Instead: Use DBCC Shrinkfile
  • 15. Triggers don’t’ send mail  Does it need to be now, now, right this very moment, now?  Connecting to an outside application is costly for performance  If the mail server is down, users get ugly results.  What happens if mail XPs get disabled?  Instead, write to a queue table and have a SQL Agent job process the queue.
  • 16. Developers Don’t Touch Production  Developers like to “fix” problems.  Changes must be tested before moving into production.  Every environment needs a gatekeeper/traffic cop  You ARE using source control, right?
  • 17. Ask questions like an auditor  “What would Sandra say?”  What is our risk exposure?  Are there any security concerns?  Will this pose any compliance problems?  Does this touch anything financial?  Don’t be afraid to ask your auditor
  • 18. Consistency is Key  Versions  Easier to Troubleshoot  Configurations  Easier to Remember What’s Where  Maintenance Processes  Leverage the SQL Agent MSX Server
  • 19. Master the SQL Agent  Easily automate manual tasks  Run scripts regularly and have them alert you to conditions  Severity alerts are your friend  Use Multi-Server Administration
  • 20. Use Instant File Initialization  Prevents waiting for a file to grow  Makes RESTOREs run faster  Creating new databases is much faster
  • 21. Plan for when things go bump in the night  And they do go bump in the night  Have a regular troubleshooting script for databases and applications for your first-level support  Give common errors and how to resolve them  Tailor your alerts to indicate which items require immediate attention and which should be flagged for next-day resolution
  • 22. Set Min and Max RAM  Extremely important in virtual environments  MIN allows you to be greedy  MAX gives the OS breathing room
  • 23. Your server is not a workstation  Avoid Remote Desktop  Don’t run SSMS directly from your server  Instead: Run from a workstation  RUNAS is your friend
  • 24. Set your file growth increments  Defy the defaults!  Growth is an ALTER, which is a database lock, which is a performance issue  More growths = fragmentation  Log growths = high VLFs  Better yet, monitor regularly and grow files manually
  • 25. Test restores. Frequently.  Easily automated  The worst time to test a restore is when your production server fails  It’s good practice for when something does fail  Don’t forget to test recovering from long-term storage  Test recovering to a specific point in time as well as key business processes
  • 26. Reserved words are just that, reserved  Reserved words as column names make writing queries harder  [avoid this]  If it turns blue in SSMS, try something else  Common offenses:  SECURITY  STATUS  IDENTITY
  • 27. Limit access to SA and service account passwords  Not everyone needs to connect as SA  Why? Why? Why must anyone have it?  More hands = less control  Does the application really need to connect as SA?  Don’t be afraid to fight with the vendor  Avoid Mixed Authentication Mode where possible  Embrace AD authentication
  • 28. Database servers are that and that alone.  Databases are the foundation of most critical business applications  If the database server is slow, everything else is slow  Web servers, SSRS, SSAS, and SSIS go on a different box  Keeps server optimized for running databases  It’s okay to be greedy with system resources
  • 30. More Blog Post at crankydba.com/go/nesql

Editor's Notes

  • #9: Going to tell storiesHave about fifteen slides full of topic. May get to them all. We may not.
  • #10: Ask crowd: What makes you cranky?
  • #14: Good advice out there, but…Lots of outdated information. Do DB servers really need 2x RAM for PF?
  • #15: Story: CRM vendor troubleshooting perf problem. Wouldn’t support us without autoshrink. Says too much space in data files causes problems.When does autoshrink kick in? Tuesdays when your finance people are trying to close the books on the quarter.
  • #16: Story: Elevator contracts
  • #17: This used to be an “ever” slide.