Download THE DBA`s First Date

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Tandem Computers wikipedia , lookup

Database wikipedia , lookup

Microsoft Jet Database Engine wikipedia , lookup

Btrieve wikipedia , lookup

Team Foundation Server wikipedia , lookup

Database model wikipedia , lookup

Clusterpoint wikipedia , lookup

Relational model wikipedia , lookup

Open Database Connectivity wikipedia , lookup

SQL wikipedia , lookup

PL/SQL wikipedia , lookup

Microsoft SQL Server wikipedia , lookup

Transcript
THE DBA’s First Date
Getting familiar with a new
environment
Who is this guy?
Background:
Ryan Brickey
Wells Fargo: Database Architect
SQL Sentry: Software Support Engineer
Living Well Health Solutions: Data Analyst
SQL Saturday speaker
MCITP: SQL Server Database Administrator 2008
Networking:
SQLBrickey
http://www.linkedin.com/in/ryanbrickey/
http://mindofadba.blogspot.com/
Who would benefit from this presentation?
Accidental DBA’s
Anyone moving to a new DBA position
Current DBA’s building a S.O.P. for new hires
Active DBA’s that have a lack of documentation
Show of hands…
• Who is actively in one of these positions?
• Who is planning to do this in the next 6 months?
• Who recently had to do this within the past 6 months?
POP QUIZ !!!
Which environment is better documented?
A. 25 Servers with 30 SQL instances and 273 databases?
B. 3 Servers with 3 SQL instance each and 31 databases?
Fore warning: What you see is not always what you get
Fore warning: What you see is not always what you get
Large environments are more likely usually have
processes and procedures that must be followed
• “Red tape” can seem frustrating when trying to rollout changes and
updates
• Offers a higher level of consistency
• Higher chance of existing documentation
Smaller environments may offer a more flexibility and
less supervision
• Less “Red tape” offers more freedom to do what is needed at the
moment
• Higher potential for inconsistencies across the environment
• Likely to have less documentation and more tribal knowledge
What do we need to know
Know your names
• Server and database
Know your setup
• Server and database
Know your baselines
• Why, When, What
• Data Collection
• Scheduled activity
Know your customers
Know how to be proactive
Explain what you know
Know Your Names
Know Your Names
Compile a comprehensive list of servers and
understand the naming convention
Logical names
• What does the name represent
• What does it tell you
• Typically at the server level
Illogical names
• How are the names applied
• What are the rules
• Typically at the SQL instance and database level
Know Your Names - Servers
Logical Names: Logical names tend to appear at the server level and will
probably tell you about the servers themselves.
What are the server names telling you?
QW52S64-090A\SQLSERVER
QW60S64-105A\SQLSERVER
QW60S86-105A\SQLSERVER
QW61S64-110B\SQLSERVER
CPVWD00A0470\SQLSERVER
CRVWD00A0005\SQLSERVER
CUVWD00A0011\SQLSERVER
CPVWA00A0408\SQLSERVER
[Q] – QA virtual machine identifier
[C] - Corporate
[W61] – Windows version (61 = Windows Server 2008 R2 or Windows 7)
[P/R/U] - Production / Recovery / UAT
[S] – Server or Workstation (S or W)
[V] - Virtual / Physical
[64] – 64 or 32 bit (64 or 86)
[W] - Windows
[100] – SQL version number (2008)
[D/A] - Database / Application
[A] – Differentiator for machines with similar configuration (A, B, C, etc.)
[00A] - Node
[ES] – Language identifier for servers other than English (Blank if English)
[0470] - Sequential counter
Know Your Names - Database
Illogical Names: Illogical names tend to be at the SQL instance level. While
they can be cryptic, they can still be informative.
What are these SQL instance and database names telling you?
SQLInstance.Database
Appalachian.MountMitchell
Appalachian.Kinsman
Rockies.PikesPeak
Rockies.MountElbert
Appalachian - East Coast Data Center
Rockies - West Coast Data Center
Peaks - Big Data / Warehouse
Mounts - Small Data / Lower priority
Know Your Setup
Know Your Setup – Operating System
What is the vital OS level information?
•
•
•
•
•
•
•
•
Virtual or Physical
Stand-alone / Cluster
Software version details (including service pack level)
Platform
• x86 / x64
Hardware
CPU
Memory
Storage
Know Your Setup – SQL Instance
What is the vital SQL Instance level information?
•
•
•
•
•
•
•
Stand-alone / Cluster
Software version details (including service pack level)
Max Memory / NUMA
Processor Affinity
Windows Integrated or SQL Authentication
Optimize for Ad Hoc workloads
Max Degree of Parallelism
Know Your Setup - Database
What are the SQL Server settings?
•
•
•
•
Compatibility Level
Recovery Model
Auto Shrink Enabled ( *** BAD *** )
Auto Update Statistics
Where can I get this?
• Operating System
• SQL Server
•
•
SQL Server Management Studio via DMV’s or GUI
Scripts by Glenn Berry’s and Brent Ozar (provided on last slide)
Know Your Baselines
Know Your Baselines
What is the server’s use cycle?
• When are resources taxed the highest?
• When is user access the highest?
• When are business critical activities taking place
How do use cycles interact with each other?
• Does user activity interfere with critical activities?
• Are resources consumed by processes or people?
• Is ad-hoc load better or worse than known activity?
How are the resources being monitored?
• Are you monitoring the servers?
• Are you collecting relevant data?
• Are you saving your data?
Know Your Baselines – Why, When, and What
Why do I need a base line?
• Getting your baseline allows you to know what the normal activity level is for a
server at a given period of time.
• This is different from load testing.
When do you capture base lines?
• During peak production hours; off hours; and nightly process
• It is equally as important to know what type of load is being experienced during all
of these times
What should be measured?
•
•
•
•
•
•
CPU
Memory
Waits
Disk I/O
Connections
Transactions / Batches
Know Your Baselines – Data Collection
Native Tools:
Pros:
•
•
Allows for live capture
You can save the data
Cons:
•
•
•
•
•
•
Hard to read
There is no data if it wasn’t running
Need to convert counter values into user friendly metrics
Need to create a procedure to collect and store the data
Unknown overhead of custom solution
Cost of developing and implementing solution
Know Your Baselines – Data Collection
Third party tools:
Pros:
•
•
•
•
•
Continuously collecting data
Easy to read format
Data is readily accessible
Provides point-in-time and historical data views
Increased efficiency for analysis and performance enhancements
Cons:
•
•
Costs of software
Potential overhead on monitored servers (dependent on product and configuration)
Know Your Baselines – Data Collection
 Native Tools (Perfmon)
Third Party Tools 
(SQL Sentry)
Know Your Baselines – Scheduled Activity
What should be measured?
• Schedule
• Start time
• Average Duration
SQL Agent Jobs:
•
•
•
•
DB Maintenance
SSIS Jobs
SSRS Reports
SQL Jobs
Windows Tasks:
• Additional processes outside SQL Server
Know Your Baselines
T-SQL:
[msdb].[dbo].[sysjobs]
[msdb].[dbo].[sysjobhistory]
[msdb].[dbo].[sysjobschedules]
[msdb].[dbo].[sysschedules]
[msdb].[dbo].[syscategories]
Third Party Tools:
(SQL Sentry)
Know Your Customers
Know Your Customers
It is very important to know exactly which server impact
which customers. This helps you to identify each server’s
importance, requirements and security.
Map out all of your databases
•
•
•
•
What is the line of business that relies on the data
Who is their primary point of contact?
How do they report a problem?
What is each specific tolerance level?
• Recovery Point Objectives (RPO’s)
• What point do you need to be able to recover to?
• Daily / Hour / Minute / transaction?
•
Recovery Time Objectives (RTO’s)
• How long do you have to recover the environment back to the recovery point?
• 30 minutes / 2 hours / 6 hours / 12 hrs
Know How to be Proactive
Know How to be Proactive
We never want to find out that there is a problem by
having a user tell us.
Setup alerting
• Online / Offline alerts
• SQL Server agent alerts
•
•
Blocking SQL
Deadlocks
• SQL Server agent jobs
• Job failures
• SSIS Error Handling
• Data load errors
• Third party tools
• Performance counter threshold alerts
• Runtime Alerts
Explain What You Know
At this point it is a great time to meet with the customers and/or
your boss to review what you know.
• Review each server and database associated to the customer
•
Are they all still active, and needed
• Review the setup for each server and database associated to the customer
•
Are you able to meet the RTO and RPO requirements?
• Review the scheduled activities
•
Are the schedules still effective
• Review the baselines during the peak hours identified
• Review how you’re monitoring the environment
•
•
How are you being notified
What thresholds are used for your notifications
Explain what you know – Build a Playbook
At this point we can create a DBA Playbook that includes all relevant data that
we’ve collected.
• List of all the servers, SQL instances, and databases in the environment
• How the servers are configured
•
•
•
•
•
•
•
OS and SQL
The hierarchy of the servers importance
When priority jobs and processes are running
How long they are expected to take
What the baseline resource usage is
Who is impacted by each server
How are we monitoring the environment
Know how to succeed
There are a lot of environments that does not have all of this information compiled.
By doing this, you are not only helping yourself, you are proving that you were the
right person for the job, and are providing the company with information that they
can continue to use.
Know how to succeed
Action Plan
Know how to succeed
Links and scripts:
• Glenn Berry’s SQL Server 2008 Diagnostic script:
• http://sqlserverperformance.wordpress.com/2009/05/21/sql-server-2008diagnostic-script/
• Brent Ozar’s sp_BLITZ script:
• http://www.brentozar.com/blitz/
• Brad McGehee’s Sure DBA Checklist:
• http://www.simple-talk.com/sql/database-administration/brads-sure-dbachecklist/
• MSSQLTips: Analyzing SQL Agent job and job step history:
• http://www.mssqltips.com/sqlservertip/1752/analyzing-sql-agent-job-and-jobstep-history-in-sql-server/