140 likes | 254 Views
Ten Things. You do that make SQL Server Cry. Jen McCown. Microsoft SQL Server MVP recipient SQL Server developer and DBA MidnightDBA.com Jen@MidnightDBA.com MidnightDBA.com/Jen Twitter.com/ MidnightDBA webshow.MidnightDBA.com Fridays 11pm CST. Overview: The 10 Things.
E N D
Ten Things You do that make SQL Server Cry
Jen McCown • Microsoft SQL Server MVP recipient • SQL Server developer and DBA • MidnightDBA.com • Jen@MidnightDBA.com • MidnightDBA.com/Jen • Twitter.com/MidnightDBA • webshow.MidnightDBA.com Fridays 11pm CST
Overview: The 10 Things • ! Understanding • Disk • Profiler • Indexing • Backups and maintenance • Design • Ugly code • ! Performance • ! Documentation • ! Testing
Thing 1: Design • Unreadable names • Bad datatypes • Duplicate columns • Multipurpose columns • No relational integrity • And much, much more!
Thing 2: Ugly Code • Ugly code is scary
Thing 3: Performance • Cursors • Nested views • Lock hints • Just not bothering with it…
Thing 4: ! Documentation • Nobody likes making documentation: • It's a pain • It gets out of date • Nobody reads it • “Don't need it!“ • "I can do it when the project is done!“ • “I'll document myself out of a job!"
Thing 5: ! Testing • 1. Code on dev or on a sandbox. Don't make changes in production! • 2. Run your code...on dev. • 3. Script out your deployment, and test that. • 4. Have a rollback script, and test THAT. • 5. Especially if you don't have a decent QA, watch the changes in production. Remember, "it always runs fast on the dev box".
Thing 6: ! Understanding • Know before you GO
Thing 7: Disk • Disk Partition Alignment • RAID levels • Much more
Thing 8: Profiler • Don’t run SQL Profiler on production • SQL Profiler can bring down production • Instead: Server Side Trace: The What, Why, and How bit.ly/19x2wBD
Thing 9: ! Indexing • Huh. Apparently this is an “index” clipart. • Indexes are good! Use them… • But there's a balance. • Don't index every column of a table individually!
Thing 10: ! Backups / Maintenance • You need backups • You need maintenance • You need alerting • Suggested: SQL Server Maintenance Solution http://ola.hallengren.com
Other Resources • All session materials available at MidnightDBA.com/Jen • Contact me: • Jen@MidnightDBA.com • Twitter.com/MidnightDBA • Other resources: • MidnightDBA.com • SQLServerSamples.codeplex.com (AdventureWorks) • SSMSToolsPack.com • Ola.Hallengren.com