Presentation is loading. Please wait.

Presentation is loading. Please wait.

Work Smarter Not Harder

Similar presentations


Presentation on theme: "Work Smarter Not Harder"— Presentation transcript:

1 Work Smarter Not Harder
Standardize Your Environment With Best Practices AJ Mendo SQL Saturday 107 – Houston April 2012

2 Introduction AJ Mendo ajmendo@poriver.com @SQLAJ
He is an Operations DBA, a speaker at user groups, SQL Saturday’s and online. He loves being a part of the SQL Community and all around nice guy. 2 | 12/26/201812/26/2018 | Footer Goes Here

3 Objectives What does it mean to Standardize? What can be Standardized?
Manual vs. automating using scripts Get others to follow the Standards Document/publish - living document We will define what it means to Standardize We will discuss some of the things we could Standardize We talk about some manual processes vs automating We will talk about getting others to follow your standards Everyone's favorite – Documentation. – The important things to remember.

4 What does it mean to Standardize?
Definition: stand·ard·ize /ˈstandərˌdīz/ Verb: to bring to or make of an established standard size, weight, quality, strength, or the like: to standardize SQL installs. to test by or compare with a standard to choose or establish a standard Source:

5 Standards - Keep Things Simple

6 Why Should You Standardize?
Defines rules for everyone Non-standards easier to spot/correct It will make your job easier Because SQLAJ said to All of the above

7 What can be standardized?
OS versions Server setup SQL versions Access restrictions Post install configurations Routine maintenance Tracking Changes Release/Deployment process **OS versions **Server setup Drive Layouts Use of Configuration Files for SQL Installations **SQL Server Versions Set up all servers the same **Access restrictions Who gets access to what servers What permissions **Post install configuration **Routine Maintenance Back ups, Integrity Checks, Index Defragging **Tracking of changes **Deployment process Ensuring deployments have less issues

8 Server Setup Drive configuration Use the correct file system
Formatting drives correctly We can dump everything on the C drive right? No? **Separate LUNS for data, log, tempdb, and backups. **Data drives are random and log files are written to sequentially. C:\OS D:\App or SQL Binaries *E-K\SQLData files L:\SQLLogs *M-R:\Optional *S:\SQLFileStream T:\TempDB *U-Y:\Optional Z:\CDROM\DV **RAID options OS and SQL Server binaries - 0 or 1 Data and Logs - RAID 10 Backups - RAID 5 Take him/her to lunch. Main point – Communicate if you don’t have visibility into what is done. **File system – Use NTFS enables the use of security options (file and directory access) Encryption Future versions of SQL may not support FAT32 installs. **Formatting drives If not done correctly can cause a 30% increase in disk latency and query duration Reference article – 6 aligned disks performed equal or better than 8 unaligned disks

9 Windows and SQL Versions
Operating System SQL Server Service Packs SQL components **Operating systems: 2003, 2008, 2008R2 **SQL Server: 2005, 2008, 2008R2, 2012 **Service packs: how often are they installed. Dev, pre-production, production Routine maintenance windows **SQL components: All, just the required according to your change orders

10 Access – User Accounts Types of accounts
Windows - users SQL - applications Access level depends on environment Development, Pre-Production, Production **Types of accounts - Windows (Domain) Accounts - *Use groups if possible* - Applications usually use SQL Accounts **Different levels of access per environment - Production-Pre-Production Full Access, limited access, read-only Same as production - Test/QA Usually same as production Depends - Development Developers get Full Access Separate Domain with limited outside access. **Who gets access - Project Managers/Build Managers/Non-Technical – no access

11 Service Accounts **Isolate Services
Use different accounts for the different services – SQL engine, SQL Agent use the lowest possible rights for the accounts

12 Sizing Drives Information from customer Develop an algorithm
Current database size Projected growth 1, 3, 5 years Develop an algorithm Backups will be compressed Allow for .5% growth Remember OS/App C:\OS – 40GB D:\App(SQL) – 50GB **Get information from the customer have standard questions to ask when initial meetings with customers if you are included Assign action items to get the information **Develop an Algorithm Remember backups will be compressed Remember to allow for growth **Total space needed on server Also remember the C:\ and D:\ 900 GB – what? Split data files up early 350GB data drive split

13 Install from Configuration File
Consistent/Faster Installs No more clicking “Next” button All commands in Configuration file Configuration Files based on components needed SQL Engine, Report Services, SSIS, SSAS Blog Post sqlaj.wordpress.com/2012/03/09/installing-sql-server-from-a-configuration-file **We bill 3 hours of time per install. It takes me around an hour right now. Give or take a few minutes for a bathroom break. What do I do with the rest of the time? What could you do with that additional time?

14 Post Install Configuration
Option 1 Manually Create Jobs, Mail, Operators, Alerts Wizard / Design Console Time consuming Job is owned by user who created it Maintenance plans can be finicky **Manually Create Jobs - Use the Wizard / Design Console - Can be time consuming (approximately 5 minutes each x4) - Job owner by default is the user logged in creating the plan - Maintenance plans can be finicky - many occasions where the jobs failed. - Error messages are cryptic - can hard to trouble shoot - delete recreate

15 Post Install Configuration
Option 2 Use SQL scripts to create jobs Faster (approximately 30 seconds or less) Easy to use/maintain Job owner is set (local or domain account) **Use SQL scripts to create jobs Faster (approximately 30 seconds or less) Easy to use/maintain Job owner is set (local or domain account) They just run

16 Routine Maintenance Backups Integrity Checks Index Defragmenting
Clean Up **Backups What type: Full, Differentials, Simple, Transaction logs. How often are they done When are the files moved to tape **Database Integrity Checks Simple do it for one How often? Once a week at a minimum **Index Defrag - Michelle Ufford **Clean History Delete old backup and log files, backup history, job history. How long do you keep it? We keep ours about two weeks. 14 days

17 Tracking changes How do you track changes to environment
Is there an approval process Work flow Closing tickets **Tracking changes how? Change Orders – configuration changes – objects are changed Service Requests – unlocking users, routine maintenance **Approval process CO have different areas of sign off Security Storage Change Management **Work flow **Closing Tickets Are all steps complete What determines that

18 Release/Deploying Code Updates
Release calendar Release order Application packages complete Including app code, database scripts, deployment instructions Required 72 hours in advance Instructions must be full and complete Written so any DBA or SA can deploy updates In a perfect world you would get all of these. **Release Calendar required. Allows DBAs, SAs and others better management of time if know ahead of time. **Released from Development, QA/Test, Pre-Production, Production No skipping over environments **Application Code, Database Scripts, Deployment Instructions Required 72 hours in advance First step. This allows for the instructions and code to be reviewed. Instructions must be full and complete If there are any issues with instructions being confusing or just plain wrong they can be corrected Is there a back out plan Written so DBA or SA can deploy updates - Any DBA or SA on the team should be able to deploy the code following the instructions

19 Standards Agreement

20 Motivate others to follow standards
Convince Managers Demonstrate When all else fails **Talk with Managers Chances are they know standardizing will improve the process **Demonstrate how makes setup/configuration easier Put on a demo. Show them the scripts. Ask for feedback **Getting team members to agree If managers agree you are half way there. Talk with other members. Show them how it will make their jobs easier

21

22 Document and Publish Put Standards in writing
Post to a central location Get the word out SAs and Project/Build Managers Living Document – update as needed **Write up the Standards - when correcting an issue that does not follow the standards it is hard to convince someone if it is not written down. - document in as simple and as detailed as possible so everyone can understand **Post to a central location Internal web site or SharePoint server **Refer others such as SAs and Project Managers to location - If your organize is large and **Living Document – update as needed. - Don’t be afraid to change or correct

23 Wrap Up What does it mean to Standardize? What can be Standardized?
Get others to follow Standards Using “Scripts” to make things easier Document and publish – Consider it a “living document” **What it means to Standardize - Doing the same thing every time **What can be Standardized -Server setup -Access restrictions -SQL versions and installations -Post install configurations -Routine maintenance -Release/Deployment process **Get others to follow Standards - Talk to managers, team member show them how it can work and make things easier, ask for feedback **Using “Scripts” to make things easier - Install from Configuration file. Using scripts to build out routine maintenance **Document and publish – update as needed - Write things down, used for reference, used for correcting issues early

24 Questions

25 Resources Isolate SQL Services
Using the Correct File System Formatting data drives Blog Post – Install using Configuration file sqlaj.wordpress.com/2012/03/09/installing-sql-server-from-a-configuration-file Blog Post – Routine Maintenance Setup from SQL Scripts


Download ppt "Work Smarter Not Harder"

Similar presentations


Ads by Google