SlideShare une entreprise Scribd logo
1  sur  38
How Not to be a Cranky DBA
Mike’s Top Ten Rules for Managing a Production Environment
Mike Hillwig
—  AKA The Cranky DBA

—  SQL Server DBA

—  Working with SQL Server since SQL 7
Mike Hillwig
—  Senior 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
Photo Credit: Nedra Isenberg
`
Obligatory Social Networking Slide
—  crankydba.com

—  sqlserverpedia.com

—  twitter.com/mikehillwig
No Need for Notes
Blog post and slide deck will be available later today
Today’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 and then
    rebuild your indexes
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/sqlsat121

Contenu connexe

Similaire à How Not to be a Cranky DBA

Do More With Less: SQL Central Management Server and Multi-Server Administration
Do More With Less: SQL Central Management Server and Multi-Server AdministrationDo More With Less: SQL Central Management Server and Multi-Server Administration
Do More With Less: SQL Central Management Server and Multi-Server AdministrationMike Hillwig
 
SQL Phone Home: Teaching Your SQL Servers to Call for Help
SQL Phone Home: Teaching Your SQL Servers to Call for HelpSQL Phone Home: Teaching Your SQL Servers to Call for Help
SQL Phone Home: Teaching Your SQL Servers to Call for HelpMike Hillwig
 
Geek Sync | Planning a SQL Server to Azure Migration in 2021 - Brent Ozar
Geek Sync | Planning a SQL Server to Azure Migration in 2021 - Brent OzarGeek Sync | Planning a SQL Server to Azure Migration in 2021 - Brent Ozar
Geek Sync | Planning a SQL Server to Azure Migration in 2021 - Brent OzarIDERA Software
 
Geek Sync | Field Medic’s Guide to Database Mirroring
Geek Sync | Field Medic’s Guide to Database MirroringGeek Sync | Field Medic’s Guide to Database Mirroring
Geek Sync | Field Medic’s Guide to Database MirroringIDERA Software
 
High Performance Mysql
High Performance MysqlHigh Performance Mysql
High Performance Mysqlliufabin 66688
 
Managing SQLserver for the reluctant DBA
Managing SQLserver for the reluctant DBAManaging SQLserver for the reluctant DBA
Managing SQLserver for the reluctant DBAConcentrated Technology
 
Salesforce Flows Architecture Best Practices
Salesforce Flows Architecture Best PracticesSalesforce Flows Architecture Best Practices
Salesforce Flows Architecture Best Practicespanayaofficial
 
How to manage and monitor large sql server estates
How to manage and monitor large sql server estatesHow to manage and monitor large sql server estates
How to manage and monitor large sql server estatesRed Gate Software
 
Online Reporting Architectures Behind Load Balancers
Online Reporting Architectures Behind Load BalancersOnline Reporting Architectures Behind Load Balancers
Online Reporting Architectures Behind Load BalancersCrystal Foor Manson
 
Continuent Tungsten - Scalable Saa S Data Management
Continuent Tungsten - Scalable Saa S Data ManagementContinuent Tungsten - Scalable Saa S Data Management
Continuent Tungsten - Scalable Saa S Data Managementguest2e11e8
 
Best practice adoption (and lack there of)
Best practice adoption (and lack there of)Best practice adoption (and lack there of)
Best practice adoption (and lack there of)John Pape
 
how-to-become-a-mysql-dba.pdf
how-to-become-a-mysql-dba.pdfhow-to-become-a-mysql-dba.pdf
how-to-become-a-mysql-dba.pdfALI ANWAR, OCP®
 
Web Application Security
Web Application SecurityWeb Application Security
Web Application SecurityNelsan Ellis
 

Similaire à How Not to be a Cranky DBA (20)

Do More With Less: SQL Central Management Server and Multi-Server Administration
Do More With Less: SQL Central Management Server and Multi-Server AdministrationDo More With Less: SQL Central Management Server and Multi-Server Administration
Do More With Less: SQL Central Management Server and Multi-Server Administration
 
Dba101
Dba101Dba101
Dba101
 
SQL Phone Home: Teaching Your SQL Servers to Call for Help
SQL Phone Home: Teaching Your SQL Servers to Call for HelpSQL Phone Home: Teaching Your SQL Servers to Call for Help
SQL Phone Home: Teaching Your SQL Servers to Call for Help
 
Geek Sync | Planning a SQL Server to Azure Migration in 2021 - Brent Ozar
Geek Sync | Planning a SQL Server to Azure Migration in 2021 - Brent OzarGeek Sync | Planning a SQL Server to Azure Migration in 2021 - Brent Ozar
Geek Sync | Planning a SQL Server to Azure Migration in 2021 - Brent Ozar
 
Geek Sync | Field Medic’s Guide to Database Mirroring
Geek Sync | Field Medic’s Guide to Database MirroringGeek Sync | Field Medic’s Guide to Database Mirroring
Geek Sync | Field Medic’s Guide to Database Mirroring
 
High Performance Mysql
High Performance MysqlHigh Performance Mysql
High Performance Mysql
 
Managing SQLserver for the reluctant DBA
Managing SQLserver for the reluctant DBAManaging SQLserver for the reluctant DBA
Managing SQLserver for the reluctant DBA
 
Salesforce Flows Architecture Best Practices
Salesforce Flows Architecture Best PracticesSalesforce Flows Architecture Best Practices
Salesforce Flows Architecture Best Practices
 
How to manage and monitor large sql server estates
How to manage and monitor large sql server estatesHow to manage and monitor large sql server estates
How to manage and monitor large sql server estates
 
Online Reporting Architectures Behind Load Balancers
Online Reporting Architectures Behind Load BalancersOnline Reporting Architectures Behind Load Balancers
Online Reporting Architectures Behind Load Balancers
 
Defy the Defaults
Defy the DefaultsDefy the Defaults
Defy the Defaults
 
Security
SecuritySecurity
Security
 
DBA Best Practices.ppt
DBA Best Practices.pptDBA Best Practices.ppt
DBA Best Practices.ppt
 
IASA Atlanta September 2009
IASA Atlanta September 2009IASA Atlanta September 2009
IASA Atlanta September 2009
 
Continuent Tungsten - Scalable Saa S Data Management
Continuent Tungsten - Scalable Saa S Data ManagementContinuent Tungsten - Scalable Saa S Data Management
Continuent Tungsten - Scalable Saa S Data Management
 
Best practice adoption (and lack there of)
Best practice adoption (and lack there of)Best practice adoption (and lack there of)
Best practice adoption (and lack there of)
 
how-to-become-a-mysql-dba.pdf
how-to-become-a-mysql-dba.pdfhow-to-become-a-mysql-dba.pdf
how-to-become-a-mysql-dba.pdf
 
Web Application Security
Web Application SecurityWeb Application Security
Web Application Security
 
Let's get along
Let's get alongLet's get along
Let's get along
 
Isset Presentation @ EECI2009
Isset Presentation @ EECI2009Isset Presentation @ EECI2009
Isset Presentation @ EECI2009
 

Plus de Mike Hillwig

Recovery and backup for beginners
Recovery and backup for beginnersRecovery and backup for beginners
Recovery and backup for beginnersMike Hillwig
 
Seven Jobs You Should Be Running #sqlsat126
Seven Jobs You Should Be Running #sqlsat126Seven Jobs You Should Be Running #sqlsat126
Seven Jobs You Should Be Running #sqlsat126Mike Hillwig
 
New Server in an Hour #sqlsat121
New Server in an Hour #sqlsat121New Server in an Hour #sqlsat121
New Server in an Hour #sqlsat121Mike Hillwig
 
New Server in an Hour
New Server in an HourNew Server in an Hour
New Server in an HourMike Hillwig
 

Plus de Mike Hillwig (7)

Closing
ClosingClosing
Closing
 
Opening
OpeningOpening
Opening
 
Recovery and backup for beginners
Recovery and backup for beginnersRecovery and backup for beginners
Recovery and backup for beginners
 
What the VLF
What the VLFWhat the VLF
What the VLF
 
Seven Jobs You Should Be Running #sqlsat126
Seven Jobs You Should Be Running #sqlsat126Seven Jobs You Should Be Running #sqlsat126
Seven Jobs You Should Be Running #sqlsat126
 
New Server in an Hour #sqlsat121
New Server in an Hour #sqlsat121New Server in an Hour #sqlsat121
New Server in an Hour #sqlsat121
 
New Server in an Hour
New Server in an HourNew Server in an Hour
New Server in an Hour
 

Dernier

How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 

Dernier (20)

How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 

How Not to be a Cranky DBA

  • 1. How Not to be a Cranky DBA Mike’s Top Ten Rules for Managing a Production Environment
  • 2. Mike Hillwig —  AKA The Cranky DBA —  SQL Server DBA —  Working with SQL Server since SQL 7
  • 3. Mike Hillwig —  Senior 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
  • 4.
  • 6.
  • 7.
  • 8. `
  • 9.
  • 10.
  • 11.
  • 12.
  • 13. Obligatory Social Networking Slide —  crankydba.com —  sqlserverpedia.com —  twitter.com/mikehillwig
  • 14.
  • 15. No Need for Notes Blog post and slide deck will be available later today
  • 17. What Makes a DBA Cranky —  Fixing Unnecessary Mistakes —  Lack of Sleep —  Answering Redundant Questions —  Repeating Manual Processes —  Performance Problems —  Waiting —  Unnecessary Emergencies
  • 18. Why Does This Make Us Cranky?
  • 19. We Would Rather —  Spend time with our families —  Read —  Sleep —  Play Angry Birds —  Eat Bacon —  Anything other than work
  • 21. 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.
  • 22. 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 and then rebuild your indexes
  • 23. 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.
  • 24. 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?
  • 25. 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
  • 26. Consistency is Key —  Versions —  Easier to Troubleshoot —  Configurations —  Easier to Remember What’s Where —  Maintenance Processes —  Leverage the SQL Agent MSX Server
  • 27. 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
  • 28. Use Instant File Initialization —  Prevents waiting for a file to grow —  Makes RESTOREs run faster —  Creating new databases is much faster
  • 29. 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
  • 30. Set Min and Max RAM —  Extremely important in virtual environments —  MIN allows you to be greedy —  MAX gives the OS breathing room
  • 31. 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
  • 32. 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
  • 33. 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
  • 34. 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
  • 35. 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
  • 36. 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
  • 38. More Blog Post at crankydba.com/go/sqlsat121