Download presentation
Presentation is loading. Please wait.
Published byJasper Leonard Modified over 8 years ago
1
Best Practices for a Healthy SQL Server Presenter: Jeff Pfershy
2
An independent, not-for-profit organization serving Dynamics Partners and Users
3
The Basics Official name: Association of Dynamics Professionals Abbreviated name: Dynamics Pro Website: www.dynamicspro.org Independent, non-profit Open to all Dynamics products (AX, CRM, GP, NAV, SL) Individual Memberships (not Corporate Memberships) Associate Member – FREE Professional Member - $199 per year Open to Partners & Users Certifications (GP and NAV) and other Member benefits community. competency. advocacy. 3
4
www.reimagine2015.com/home
5
OCTOBER 12-13, 2015 RENO, NEVADA The partner event before the user event at Summit 2015 Dynamicspro.org/conferences
6
Housekeeping Please utilize go-to-meeting audio Participants should self-mute to avoid background noise Get ready to ask and answer questions – this is an interactive session! All are welcome and encourage to participate. This session is being recorded and will be made available to all partner members.
7
Best Practices for a Healthy SQL Server Presenter: Jeff Pfershy
8
About the presenter Jeff Pfershy began working with MSSQL Server while a Dynamics GP consultant in 1997. From 2006 – 2014 Jeff was a SQL DBA at a GP client with an IT staff of 1,300 people, managing a group of 7 DBAs and over 150 SQL Server instances.
9
Agenda SQL Server Configuration Server settings and services, database defaults… First you have to go deep…
10
Agenda SQL Server Configuration Health Checks CheckDB, Rebuild Index, Update Stats… Timing is everything… If a tree falls in the forest…
11
Agenda SQL Server Configuration Health Checks SQL Backups Strategies, frequencies and types – it depends… Monitoring success and failures…
12
SQL Server Configuration 1.Don’t shortchange the server 2.If server is 64-bit, SQL should be 64-bit 3.Separate disk configurations for OS, TempDB, data, log and backup files 4.Bonus – SQL drives should be formatted with 64kb block size
13
SQL Server Configuration Go deep or go to sleep… Dig in! First run sp_helpdb for an idea of how old the server is and database sizes. This will also tell you the last time the SQL service was started
14
SQL Server Configuration Server properties: General
15
SQL Server Configuration Server properties: Set to 75% of RAM ‘Max server memory’ (don’t leave the default)
16
SQL Server Configuration Server properties: Processors (only change if more than one instance)
17
SQL Server Configuration Server properties: Security ALWAYS use Mixed Mode
18
SQL Server Configuration Server properties: Database Settings Compress backup
19
SQL Server Configuration Server properties: Advanced May need to change MaxDOP
20
SQL Server Configuration SQL Services and Accounts Each service should have its own domain account SQL Service, SQL Agent should automatically start Add global trace flags to service startup using -T (1204 or 1222, 3226) Optional – Change SQL TCP port. If you do, don’t forget to add a firewall exception for it Any changes for the above require a service restart
21
SQL Server Configuration TempDB configuration and sizing One data file for each CPU recognized by SQL (up to a point). Change autogrow to MB – don’t use % growth (Use the right size and autogrow increments for the environment) Any changes for the above require a service restart. If you move TempDB files, delete the old files AFTER both a service restart and verifying that the new files exist in the correct location.
22
SQL Server Configuration A word about the model database Change autogrow to MB – don’t use % growth This may not impact every new database created (if a vendor specifies all optons in a database creation script for example) Check model properties again after applying SQL service packs
23
SQL Server Configuration Global Trace Flags 3226 suppresses backup messages in the SQL logs 1204 shows resources and types of locks participating in a deadlock and the current command affected 1222 – same as 1204, in an XML format.
24
SQL Server Configuration SQL Error Log Ignore the noise (trace flag 3226) Recycle daily with a SQL Agent Job Determine how many days to keep
25
SQL Server Configuration SQL Agent Change number of rows to keep in history Owner of every job should be sa or an account with sufficient rights – not a domain user.
26
SQL Server Configuration Database Mail Must be enabled using sp_configure. Can be used to send notifications for job successes and failures Create an account and associate it to a profile Use msdb.dbo.sp_send_dbmail to send email from SQL for a variety of uses – Health Check job results, job failures, etc.
27
SQL Health Checks What should you run and how often: DBCC CheckDB Rebuild Index / Reorganize Index Update Statistics *at least* weekly, but it depends on the rate of data change
28
SQL Backups True native SQL Backups, not VM snaps Depends on database Recovery Mode and your DR strategy How to get info about timing, sizes, success and failures Building a better mousetrap
29
SQL websites and folks to follow Ola Hallengren – database backups, integrity checks, rebuild / reorganize index scripts https://ola.hallengren.com Glen Berry – server info, diagnostic queries //sqlserverperformance.wordpress.com/ //sqlskills.com/blogs/glenn/ Brent Ozar – he and his band of merry folk are all about SQL performance www.brentozar.com Paul Randal – Co-founder of SQLSkills with Kimberly L Tripp, wrote DBCC CheckDB for Microsoft… //www.sqlskills.com/blogs/paul/ Pinal Dave – lots of how-to scripts blog.sqlauthority.com SQLServerCentral.com – daily email newsletter
30
Dynamics GP top websites and folks to follow For GP-specific SQL info, here’s the link to the Top Dynamics GP sites, along with a few I use (in no particular order) when looking for something more specific: http://www.dynamics101.com/2014/08/top-25-dynamics-gp-sites/ Victoria Yudin – victoriayudin.com Mariano Gomez - http://dynamicsgpblogster.blogspot.com/http://dynamicsgpblogster.blogspot.com/ Mohammad R. Daoud - http://mohdaoud.blogspot.ca/http://mohdaoud.blogspot.ca/ John Lowther - http://community.dynamics.com/gp/b/gpdbahttp://community.dynamics.com/gp/b/gpdba
31
Questions? I sincerely hope that today you’ve learned at least one thing you can put to use in your SQL server environments.
32
Thank you for your time! Email me at: jpfershy@yahoo.comjpfershy@yahoo.com or jeffp@tmgroupinc.comjeffp@tmgroupinc.com LinkedIn: jpfershy Twitter: @jpfershy Untappd: Pfersh
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.