High Performance SQL Server DBA
August 8, 2022 | Author: Anonymous | Category: N/A
Short Description
Download High Performance SQL Server DBA...
Description
The High Performance SQL Server DBA Managing Multiple Database Platforms for Performance & Availability By Scott Walz, Sr. Director of Product Management at Embarcadero Technologies and Stephen Wynkoop, Microsoft SQL Server MVP and Founder of SSWUG.org
July 2010
Americas Headquarters 100 California Street, 12th Floor San Francisco, California 94111
EMEA Headquarters York House 18 York Road Maidenhead, Berkshire SL6 1SF, United Kingdom
Asia Pacific Headquarters L7. 313 La Trobe Street Melbourne VIC 3000 Australia
The igh Performance SQL Server DBA
TABLE OF C
NTE TS
Introduc ion .................................................................................................... - 2 - Understanding th Databa e Design ............................................................. - 3 - Visuali ing the atabase ............................................................................. - 3 - Data Normaliza ion vs. P rforman e .......................................................... - 4 - Optimizi g Poor- erforming SQL .................................................................. - 5 - Catchi g the Pr blem Ea ly ........................................................................ - 5 - Identif ing the ain Source of the Bottleneck........................................... - 5 - SQL Tuning Tec niques .............................................................................. - 6 - Storage anage ent .................................................................................... - 8 - Performance Man gement .......................................................................... - 10 - Bottleneck/Res onse Ti e Analys s ......................................................... - 10 - Workload Analysis..................................................................................... - 11 - Ratio nalysis ............................................................................................ - 11 - Capacity Manage ent ................................................................................. - 12 - Change
anage ent................................................................................... - 14 -
Conclusi n .................................................................................................... - 14 - About E barcad ro and S WUG.org ......................................................... - 15 - About the Author ....................................................................................... - 15 -
Embarcader Technologi s
-1-
The igh Performance SQL Server DBA
INTR
DUCTION
SQL Server DBAs have always tackled complex tasks amidst shifting priorities, and pressures have only mount d in recent years. Several trends i pacting SQL Server DBAs: Mu lttiple SQL Se erver Versio o n s – Microsoft SQL Server continu s to evolve and advance with •
•
•
•
•
•
eac release, and SQL Serv r DBAs are required to be experts on *all* versions of SQL Server. Ne features, s ch as CLR f unctions, ar stretching DBAs from their comfort zone into a domain traditio ally reserved for devel pers. M o r e Data – D ta growth i exploding. DBAs increasingly manage terabyt s and even petabytes of da a. This gro th has crea ed a relentless deman for increas d storage nd has made common database m nagement tasks such as back-ups, capacity planning, and SLA compliance more complex. M o r e Databasee s – While s me DBAs use SQL Server only, or anage only a handful f databases, mos manage d zens and e en hundre s. As databases grow i both size and number, so hav database latform types and versions. Today, many SQL erver DBAs manage complex heteroge eous database environments, making it more hallenging to extend one’s S L Server skills into other database ypes. C o n solidation Virtualizatiion – The rush to consolidate and virtualize dat centers has given rise o new kind of issues i database administrati n, from virt alized serv r capacity planning, to performance monitoring a d troubles ooting, to i corporatin SQL Azur , and mor . A d de d d Com pleexity – While all of the a ove trends are adding tremendou complexit to a DB ’s daily wor , Microsoft and other database ve dors have een responding with databases whic are increasingly “self- anaged” or “self-tuning” through the use of ore dyn mic access to system h alth information and a tomated a alysis tools. While adv ncements such as Micr soft’s data ase tuning and suggestion tools are time-savi g imp ovements, BMS envir nments ar growing more comple and require knowledgeable human interven ion and ma agement. BAs have to quickly absorb and master new info mation with each new atabase rel ase. This c n be especially acute hen workin with multiple databa e versions, and adding multiple database plat orms can e ponentially incr ase the co plexity of the analysis eeded. Not En ou gh Pe eople – Exp rienced DBAs have alw always been hard to find. E ven with increasing free om to hire, many orga izations ca not find th talent or e pertise the need to manage thei critical dat bases. This translates i to a higher ratio of databases managed per D A, which in turn puts the onus n organiza ions to find ways that ill empower SQL Serve DBAs to be more pro uctive and “scalable.”
Regardless of these ch llenges, as n overworked SQL Ser er DBA, you are expec ed to keep key database systems avail ble and op imized for igh perfor ance. Performance problems com from many sourc s, and you need a strategy that will contribute the most to high availa ility. This strategy should incl de the following comp nents: nderstanding the Database Desig •
Embarcader Technologi s
-2-
The igh Performance SQL Server DBA
atching Poor-Performi g SQL Earl
anaging S orage
anaging P rformance
anaging Capacity
anaging Change
•
•
•
•
•
these of type areas and automardless ate the of mat eagement This paperhigh ill databas outline techniques orcriti ver al database ion. performantocestreamlin and availability—reg to deliver
UNDERSTA
DING THE
ATAB SE D SIGN
At some point, all DBA will be req ired to support two or more types of database platforms. Whether th new database comes ia a new application, a company a quisition, o the brainstorm of an app dev loper, sup orting a ne database can be challenging. A great way way to become more intim te with a n w databas and its structure is to understand the data model. Most data mod ling tools allow DBAs to reverse e gineer the atabase. Doing so allo s you to visualize he table structure, rela ionships, a d stored procedures, a well as de endencies. By “seeing” the database on paper, y u can understand the i pact of a otential ch nge, gener te reports for ther users, and analyze the consist ncies (or inconsistenci s) among c mmon dat elements.
V ISUALI ISUALI ING THE DATA ASE A logical data model is an invaluable tool for managing co mon obje ts across d tabases, especially across multiple database platforms. The logical model removes all pla form-specific propertie and allows you to use busin ss names f r tables an columns. This provid s traceability for business terms and r les enforced in the model while m intaining traceability b ck to the p ysical implementations. Logi al modelin helps DB s by: educing data redunda cy •
•
rganizing usiness requirements
•
•
roviding a oundation f the database design educing d velopment and mainte ance time
Whether you inherit an existing database or build a new o e, optimizi g performa ce often starts with a thor ugh unders anding of t e databas design. By staying in t e loop with data archit cts and modelers d ring the development hase, you ill have op ortunities to examine the physical data model and its potential impact on erformanc .
Embarcader Technologi s
-3-
The igh Performance SQL Server DBA
DATA ORMALIZATION VS. PERFORMA CE Logical dat architects like to normalize the str cture so th t data redundancy is reduced and he design is as flexible as ossible. A lexible design is good, but not at the expense of performance. Providing y ur expertis with the p ysical desi n on what tables can be denormalized (i.e. merged, rolled up/d wn, or hori ontally/vertically split) an ensure that the design is both flexible and optimized f r performance.
In the abov example, e have pro ided flexibility by normalizing a bit to support 1 to N addr sses and phone numbers fo each custo er rather than limiting it to two and three. However, we have kept some enormalization in the ip Code ta le with the ity and State Codes c lumns and in the Customer t ble with th Organization Name a d Industry, allowing us to minimize the numbe of joins when ccessing the data. Performance issues wit an existing database ay make d normalizin the structure too drastic of a change. In that case, most data m deling tool allow you o reverse e gineer an xisting database with current row counts and partiti ning properties. Then you can easily create a r port that reveals which table may be g od candida es for new artitioning, and you can rethink existing partitioning strategies. ou can als get a clearer picture of table relationships an start strategizing how o index specific tables.
Embarcader Technologi s
-4-
The igh Performance SQL Server DBA
OPTI
IZING POO
-PER
ORMING S
L
CATCHING THE PROBLEM EARL Performance problems can occur a any stage f the devel pment life ycle, but catching them early is always muc less expe sive than le ting them reach a production environment. Tr ditionally, developers have been responsible or preventi g poor-performing SQL code. For developers, the database is a black box, and they do not necessarily have access to th informatio they need to pinpoint and resolve problems. Also, the roles of the d tabase dev loper and atabase administrator re expandi g. As a high performance DBA man ging multi le platform , you should enable developers to solve, or at least recognize and communicate, how their code is affecting d tabase per ormance. One strategy is to create opp rtunities to offload SQ performance tuning to developm nt. Enablin developer to identify and fix poor performing co e before it hits production can save everyone ime and energy, while improving database perform nce. However, t e first step is to identify that the performance roblem is r lated to poor-performi g SQL or a differe t type of b ttleneck.
IDENTIF YING THE MAIN SOURC OF TH BOTTLENECK
When looki g at datab se bottlenecks, it's important to cl arly identif the source, which usually falls into one of our catego ies: Insufficient ardware
•
atabase c nfiguration issue
pplication code problem
oor-perfor ing SQL
•
•
•
Understanding the sou ce of the b ttleneck helps you allo ate resources efficientl . For exam le, there are many cases where a man ger purcha es additional hardware to address a performa ce issue that,ui the rnsimprove out to ehea bottlen configura ion or SQL tuning issue. The costly databaseck. end, hardware grade failst to So, how ca we identify the source of a perfor ance bottl neck? The ey is to pro ile the activity of the database to calcula e the load n the data ase, pinpoint poor-per orming SQ , and top s ssions. For exampl , all the ma jor databas platforms ave perfor ance view , such as V$SESSION o Oracle or MASTER.SYSPROCESS on SQL Serv r and Sybase. These performance views descri e the current stat of the connections on the databa e and whic SQL state ents the c nnections are executing. By samplin these tabl s, you can reate a clear picture of load on the database a d identify oorperforming SQL, as well as where time is being spent in th database. If time is being spent w iting for CPU res urces and he highest PU consu ing SQL st tement is only 3% of the total activity (as shown in th first profiling session raphic on page 7), then it’s not wo th the time to tune all your SQL to free up t e CPU. In t is case, a hardware up rade is the best way to allocate resources. Embarcader Technologi s
-5-
The igh Performance SQL Server DBA
On the oth r hand, if the worst per orming SQ statement is consuming 86% of th CPU (see econd profiling gr phic on pa e 7), you might spend day or lon er trying t tune the S L stateme t. Clearly, this would be a much more efficient approach tha upgrading the hardwa e. If the bottleneck turns ut to be ac ess to a sh red resource, the developer needs to ask the BA what the issue is so the DBA can ta e the appr priate acti n. However, if the issue is row level locking or if the ap lication is doing a lot o single row operations when it should be usin arrays), th solution to he problem is in the hands of the developer.
SQL TUNING T CHNIQ ES Often times, the main ottleneck is a SQL stat ment takin up too many resource . Once the offending SQL has bee identified, developers can analyze the code. sk yourself these questions to help you id ntify poor- erforming QL: re the tabl and index statistics up to date? •
re there any missing indexes?
o any of the columns need extended histogra
re all the unique and not-null cons raints correctly defined on the columns and ta les?
•
•
•
or freque cy statistic ?
Is the datab se choosin the right access path?
•
For the finall step, of kn wing whet er the database chose the right path, or even if the SQL statement i reasonabl , the best a nd most efficient step is to lay the uery out visually. This is often referred to s Visual SQL Tuning or VST. Try dr wing out t e tables (ei her on your own or using a tool) with the detail tables hovering above the aster tabl s, indicatin table sizes, filter ratios, and two table join sizes. By drawing the picture, you can fin the best path through the query. tart at the ost selecti e filter ratio, and f llow the joi to the nex table with he smallest result set size, then on to the smallest two table join si e. o the right is an example of a isual SQL T ning diagra . A good candidate for the b st execution path is clear. First we start where the a ount of rows retur ed after filtering is he lowest, in this case O DERS at 0.34%. hen down t CUSTOME S as hat join only returns 8 ro s. hen we join up to ORDER_LIN S only givin us 115 rows, etc.
Embarcader Technologi s
-6-
In the profili g session below, a DBA statements.
The igh Performance SQL Server DBA ay spend to much time o make small gains by trying to tune individual
However, in he profiling ession belo , we can see that there is one SQL statement that accounts for 8 % of the load. Th load can be reduced sig ificantly by t ning this one query.
Embarcader Technologi s
-7-
The igh Performance SQL Server DBA
STOR
GE
ANA EMENT
Storage management i complex enough, but hen you manage diffe ent databa e platforms and versions on a variety of operating s stems, the challenge becomes ext eme. For S L Server, y u need to account or accepta le file placement (isolating log files) and ensur your operating system volumes ar properly mirrored and configured. Today’s D A may be ealing with Sybase systems, databases, ransaction logs, and segments in t e morning and then have to switch gears to deal with Oracle tabl spaces, te pfiles, and redo logs in the afternoon. Just re embering the storage yntax commands to manage he many di erse platfo ms can be difficult ta k. The two ma jor storage manageme t concerns are always availability a d performance. Storage problems c n quickly b ing down a database. Just let an Oracle archiv log destin tion reach maximum capacity or l t a Microso t SQL Serv r transaction log fail to expand and see how a ynamic transaction processing ystem reac s. Fortunat ly, databas vendors h ve provide a number of new capabilities that address availability issues. All opular dat bases now sport an “a to-extend” feature allowing th ir underlying operating system files to automa ically grow o meet the demand of increasing ata volume . IBM DB2 ontainers, racle data iles, or Microsoft SQL Server datab se and transaction log files all ave the ca ability to e pand when necessary. till, such fe tures are n t a 100% guarantee agains failure. A SQL Server atabase file could mee an impose growth li it or an Oracle tem orary table space tem file could be denied expansion at the operating system le el if a disk drive r ns out of s ace. Theref re, a DBA ust still m nitor stora e to ensure availability. A storage roblem may also have a major impact on da abase perf rmance. Fragmentation—both globally an at the ob ject level—can result in significan unnecessary I/O for a database. Wasted space in ta les and in exes can also cause roblems and contribute to excessive table a d index scan times. New featur s from several databas vendors c n protect a ainst these problems. ith the introductio of dynami managem nt views in SQL Server 2005, and increased op ions with S L Server 2008, SQL Server DBAs have additional iews to tro bleshoot fragmentatio . By coupling this data with a olid maint nance plan, you can pr emptively etect and resolve issues that could have otherwise r sulted in a interruption of service. SQL Server’s Manage ent Studio (“SSMS”) provides a starting p int for wor ing with yo r SQL Serv r database . There ar substantial options including wizards and other tools for working with SQL S rver. The ptions presented are, f course, versionspecific to support incr asing functionality in the database engine, an there are no provision for working wit other database platfo ms with SS S. Oracle 10g introduced automatic s orage man gement (A M), which allows a DB to provide the database e gine with a set of disk rives for th database o automati ally manag for file pla ement. If hotspots re discovered, automa ic relocatio is accompllished without DBA intervention. In terms of global fr gmentatio assistance, Oracle8i and above off er locally m naged tablespaces, eliminating the need for full tables ace reorga izations. In addition, object stor ge proble s can creat major perf ormance ro dblocks in a database. A DBA must under tand how t detect an eliminate these issues as quickly as possible.
Embarcader Technologi s
-8-
The igh Performance SQL Server DBA
Regardless of platform, object stor ge proble s generally include four components: •
•
•
•
Wast e d S pace – While it may not seem lik a problem, a table or index with more allocat d space t an it needs can hampe performan e. For exa ple, if the ages of a S L Server object contain d in a data warehouse re not 100 utilized, t e object will examine ore pages than necessary during ta le scans. This increases response ime for user queries. T e same problem arises with Oracle t bles that have high-water marks above the are s where da a resides.
mity – A database engin ’s read-ah ad mechanisms work more efficien Poor Exxtent Proxim objects are contain d in extent that are cl se to one another. For example, S L Server’s Ahead anager ca read much larger groups of data hen its target object has extents a pages t at are contiguous. Syb se is the same. Conver ely, when an object ha poor exte page proximity, scan times can increase.
ly when ead d t or
S Data Or O de r – Wh n indexes have a logical order that does not match the actual Out of Sync physical order of data stored in the databa e, index ac ess perfor ance can b affected. I the logical nd physical orders are in sync, the isk head can scan in o e direction instead of oving back and forth to o tain the ne ded information. Otherwise, the disk head will skip across the disk many ti es. In SQL Server, for example, index fragmentation is o e of the m re common culprits when d termining root cause f r performa ce issues. de d Rows – Each row in a table should fit on a ingle page, if possible, except for l rge Forward object/text tables. owever, if a row expan s because of the grow h of variabl length data, the database may either relocate the row to an ther page nd leave b hind a poi ter to the new page, o split the row between wo or more pages. Neither situation is preferr d as they increase the am unt of I/O necessary to obtain the row. This is seen in Oracle as chained or migrat d rows and in SQL Server and Sybase as forwarde rows.
So, how do s a SQL Server DBA detect and di gnose these object storage problems in less familiar databases? After all, each engine has its own s t of diagnostics. More ver, how can you ensur that no downtime is attributed to space outages ac oss many s rvers? As a high perfor ance DBA, you should establish an aro nd-the-clo k, multi-platform, fully- utomated atabase m nitoring solution that allows ou to confi ure storag thresholds and proactive notifications across ll your critical databases efore you develop stor ge-related problems. uch a plan hould take into account the multiple types of databases in their environme t and also f ocus on being complet ly automat d 24/7, at least for ritical data ases. What about diagnosing and remedying database and object storage roblems th t hurt performance? This can be a challenge for the SQL Server BA tasked ith taking n additional platforms. he fact is there are vast differences in diagnostic and treat ent methods that exist across diverse dat base platforms. The solutio is to design an advanced storage iagnostic and management syste that incor orates the following characteristics: Eliminates all th guesswor and labor f rom handli g database storage pr blems in heterogeneous environments. •
Allo s you to h ndle complex storage ilemmas even if you ar unfamiliar with the un erlying database platfo m.
•
Aler s you when storage iss es in the d tabase obj cts are draining perfor ance by vi ually identifying storage problems and pinp inting the objects that equire atte tion.
•
Embarcader Technologi s
-9-
The igh Performance SQL Server DBA
Because st rage mana ement can be complex, especially if you work n multiple database platforms, you must b proactive in your appr ach and automate as uch of the manageme t as possible. A two-phase pproach to setting threshold alerts starts with tandard thresholds designed to uncover space issue threatening overall system perfor ance, then customizes them to meet the uniq e needs of your environment. For SQL Server, target your data and log file groups t at are experiencing high growt rates so you have plen y of notice to solve potential problems. A best prac ice is to re uild your d tabase obj cts for maximum perfo mance at r gular intervals. For example, create a find- nd-fix job that searche the entire atabase (or a particula set of objects) for objects that violate your specified set of thresholds. Then reorganize t em for better performance. Once these jobs are se up and scheduled, you will never have to man ally reorga ize your databases again.
PERF
RMA CE MANAGEMENT
DBAs want heir databases to run as quickly as possible. T e same can be said for every person who uses a system that con ects to those database —they want their queries and processes to ha e the shortest po sible response times. gain, the situation is complicated hen you ha e more than one database platform. As ith storage management, the variables and re edies differ from one latform to the next. As a result, you need t put together a platfor -neutral roadmap that applies to each of the database engines you manage. The starting point is to define the different methods of analysis that will be used a ross all platforms and then a ply a set of diagnostics and actions that can be used for each platform under each method. These methods of analysis include: Bottleneck/Res onse Time nalysis
•
Workload Analysis
•
Rati Analysis
•
The followi g examines how each
ethod can be used to
anage the performan e of any da abase.
BOTTLENECK /R /RESPONSE TIME NALYSIS Regardless of the platf rm, when a database is running, every connected process is either working or waiting to perform wor . A process that is waiting may me n nothing, r it can be n indicator that a database b ttleneck exists. DBAs use bottlene k or respo se time analysis to determine whether perceived bottlenecks re hurting erformance. Bottleneck nalysis is a essential ethod of measuring performance ecause it h lps you tra k where a database has been spendi g its time. In SQL Serv r, looking at Buffer Cache Hit Ratios, number of times specific queries are run and h w long the run, along with disk q eues and o her activity cou ters will help point you in the direction of a poorly perfor ing query or hardware issue. If Oracle latch contenti n or heavy DB2 table-s an activity as been dragging a database’s performance, you can use bottlene k analysis to pinpoint the root cau e. Once on or more o the potential sources has been identifi d, drill down to detail about the sessions and bjects that are causing the problem.
Embarcader Technologi s
- 10 -
The igh Performance SQL Server DBA
This metho ology is th strategy o choice for op performance analys s in the ind stry. This being the case, n arly every database vendor has tail r edits engines to report metrics t analyze bottlenecks and response times. O acle 10g in roduced new metrics in its V$ perf rmance vie s that enable DB s to unders and bottle ecks and response tim s at global and session levels. Microsoft SQL Server made wait vents available via an undocument d DBCC c mmand (D CC SQLPERF( AITSTATS) and now exposes that ata via dyn mic management views (“DMVs”), and Sybase offers new monitoring view in engine ersions 12. .03 and ab ve.
WORKL AD A ALYSIS Workload analysis involves the investigation of two critical reas of database performance: Session resourc consumption and acti ity
•
SQL execution nalysis
•
When performance on database rops sudd nly, one or wo session often gen rate the bulk of the workload. The issue is system balance. In a well-balanced system, no single sessio should co sume the bulk of esources for an extend d period o time, with he excepti n of batch job process s that are run safely in non-peak hours. If individual s ssions are sing a majority of syste resources, the DBA should examine e ch problem session in etail to uncover sessio activity. Normally, t is can be e sily accom lished by viewing sessi n metadat coupled with resource consumption and statis ical execution statistics. Most data ase engines provide vast details regarding a session’s urrent and historical ac ivities. SQL Server, for instance, pr vides this ata via several dynamic m nagement iews, one being dm_exec_session. Understanding current and historic l SQL exec tion patterns will enablle a database analyst to have the second set of data oints need d to properly perform orkload a alysis. Opti izing SQL code will produc the secon -best performance-enhancing boo t available or a database—with pr per physical de ign being t e first. But hat set of etrics sho ld you use o evaluate ‘good’ vers s ‘bad’ SQL? Naturally, factors such as ove all elapsed time, CPU time, and I/ activity play a part. Bu other, more subtl factors can make a diff erence—lik the numb r of times a statement is executed, or whether sorts are done in memory r on disk. s we saw o page 6, this is where SQL analysis becomes more of an ar form than science. All the database vendors offer a wi dow into S L analysis. Oracle 10g has the mo t complete set of metrics offered by any endor. Mic osoft SQL Server offers code profiling utilities that can be sed to collect and measure S L and stored procedur executions. Sybase ha made a g od start with its SQL execution views in versions 12.5.03 and above. DB2 of fers its own SQL tracing capabilities.
RATIO NALYSI Ratio-base analysis was for many ears the only techniqu DBAs had o diagnose the cause f a database sl wdown. Y u are probably all too f miliar with he Oracle uffer cache hit ratio, Microsoft procedure lan hit rati , Sybase da a cache hit ratio, and s forth. Many performa ce experts advise that such ratios are no worthless and misleading because of advance in bottlen ck/respons time analysis. Th re is an element of truth to these claims, but s me ratios are still quite valuable, s ch as the Oracle library cach hit ratio and the Micro oft and Sy ase procedure plan hit ratios. ratios in S L Server will e can through defi bu fer cache When worki and query executi server.performanc onhelp plans, y u In additio e, issues, by lookin into the qhiteries utilization onngthe see whether and how often indexe are used a d whether he indexes have been reated on the most Embarcader Technologi s
- 11 -
The igh Performance SQL Server DBA
beneficial c lumns in the queried t bles. By lo king at D Vs for suggested indexes (and unu ed indexes), you can gain insights into likely index candidates. Then you an review fragmentation ratios to determine which indexes may need to be re uilt or reorganized. Ratios can e helpful, but the infor ation is being muddie in many installations, y factors such as feature sets, server fun tionalities and other issues outside the databa e engine’s ealm of control and reporting. or exampl , the use of a SAN disk subsystem an confuse disk access reporting t mask issues of data access, aking it diff icult to determine whet er a slow disk system ay be the r ot cause of performance i sues. More obscure ratios ca also be us ful. For example, if you were told that a Sybas table had 100 forwarded rows, would you consider this good or bad? Of ourse, you cannot ans er this que tion unless you now how many total ro s are in th table. But if you knew hat 98% of all rows in y ur Sybase table were forw rded, this i enough in ormation t make a re rganization decision. In these types of sit ations, the application f proper ratio analysis an be advantageous. Similar measures exist f or SQL Server and will e helpful b sed on the specific situations you’re trying to address. There are a host of counters availa le from Pe formance onitor at the operating system level. These These counters will let you explore and r cord infor ation for everything from the disk subsystem to the instance perform nce. Furth r, with the MVs available for query performa ce and index analy is, you can gain additional insights into suggestions for investigations.
APA A CAP
ITY
ANA EME T
Many DBAs find it difficult or almost impossibl to implem nt capacity management, as their ay-today activities simply leave no room for historical and proac ive analysis. This is unf rtunate be ause proper cap city planning can help oth the DBA and man gement, answering im ortant questions such as, “H w much m re storage ill this dat base need in six months?” and “Is his database server currently underutilized?” Capacity pl nning gen rally involves three pro esses: Coll ction of ke database
•
etrics
Hist rical analysis of collect d metrics
•
For casts of fut re needs
•
Every organization will ave differe t needs, b t in general, most shoulld collect th following information: Sna shots of gl bal storage usage, including Sybase device m trics, SQL Server database statistics, Oracl tablespace data, and atabase ob ect statistic that concern space us ge. Ele ents such as total alloc ted space, used space, and free s ace should all be colle ted as well as other performance-r lated item like numb r of chaine rows
•
Sna shots of performance wait events
•
etrics, incl ding key d tabase statistics like I/ performance and
Sna shots of re ource cons mption, in luding met ics such as PU usage, memory us ge, and user traffic
•
While some DBAs have been able to get by using scripts and manual rocesses to manage st rage and perfor ance, the burden in using such techniques for capacity planning is usually too hig . These tasks are complicated reatly by m lti-platform database environment , as well as the need to build Embarcader Technologi s
- 12 -
The igh Performance SQL Server DBA
and maintain a reposit ry that holds all the necessary statistics. In addition, DBAs re faced wi challenges in the time i takes to m nually wea e together collection s ripts and s heduled jo well as anal ze and ma age the ge eration of omplex his orical and f orecasting reports. Wit these complications, it is obvious t at manual aintenanc is not prac ical for the igh perfor SQL Server DBA—especially when moving into other DBMS platforms. The followi g techniqu s to simplif capacity
h s as all ance
anagement will save y u time and headaches:
•
Buil ing a repo itory to track key database metrics Cre ting statisti al collections for every hing you w nt to track cross your ey databases
•
Sch duling to a tomatically run collections as often as needed
•
Implementing t ols to accu ately predi t future ne ds by depicting upcoming storage, perf ormance, a d resource requiremen s through visual graphs (example below) or wellformatted HTM reports th t managers easily understand
•
Embarcader Technologi s
- 13 -
The igh Performance SQL Server DBA
CHA
GE M NAGEMEN
Today’s SQL Server DB sits at the center of a complex sy tem that touches many participant : data modelers, atabase de elopers, ar hitects, business analysts, software developers, and more. At any given time, each datab se is physically instanti ted across a number o different e vironments, each of which may contain a y one of se eral versio s of the sa e database. Furthermore, the desi n of a particular d tabase is t pically stor d in several locations u ing a multi licity of to ls, which m y include a d ta modelin tool, a SQL development tool, a atabase ad inistration tool, a database change ma agement t ol, etc. Very few or anizations look at database chang management as a sin le, unified rocess. Ma y assume tha database change man gement is natural ou come, at the juncture of database manageme t, software configurati n manage ent, and d ta modelin . The first s ep in developing a robust database chang managem nt solution is to recog ize it as a s andalone process or di cipline, with peculiarities that ake it quite different fr m software change management. As the DBA, you shoul develop a atabase change mana ement process that pr vides a vie into the change occurring cross all of your multiple database platforms. ou should stablish solid baselines a d manage hange to t ose baselines. In addition, best pr ctices dictate that you periodically revisit the aseline to ensure that elements are properly v rsioned an if needed, reset the baselin . Having a consistent view with co sistent rep rts, no mat er the data ase platform, provides conf idence that database c ange is bei g manage . You can lso incorporate database c nfiguration into your c ange management process. A change to a co figuration setting could have as much im act as an o ject chang . Third party applications present th ir own unique set of ch llenges. T ough most limit the D A’s control, at the end of t e day, you re still resp nsible for an applicati n’s performance. A comprehen ive databa e change anagement process all ws you to nderstand nd predict changes th t occur wh n vendor u dates are deployed. ith that inf rmation, th DBA has a starting point to diagnose problems that m y arise when applying atches. Wi hout a process in place, you have to rely solely on the quality of the vendor’s updates a d their ability to remotely troubles oot. Just as imp rtant as ob ect level changes are c anges made to the security model. With increasing compliance and reporting pressures, DBAs mu t establish hat they ha e control over the database. Being able o flag erro eous, or ev n malicious changes to database security, and then act on those changes, can be critical to meeting expected c mpliance l vels. Without a r bust change management solutio for your m ltiple data ase platfor s, you could be putting the work of the other disciplines of ad inistration t risk; a sin le change ould result in a serious dat base issue r, even worse, could b a direct re lection on our ability t successfully administer the databas .
CON
LUSI N
The combination of multiple datab se types and versions, added data ase compl xity, more ata, and lower headcount h s become real challe ge for the QL Server BA who w rks hard to The ey to keepi g databas s running well is to maintain hi h database availability and perfor ance. implement strategy f r ensuring ood design document tion and hi h quality S L. Proper torage,
Embarcader Technologi s
- 14 -
The igh Performance SQL Server DBA
performance, capacity anagement, and chan e manage ent are also critical. Such a strategy should be platform-ind pendent a d as automatic as possible. In the end, he responsibility for th performance of an organization’s atabase structure falls n the DBA. And a well-prepa ed DBA sh uld have all the tools s e needs to ensure high database availability nd performance.
ABOUT EM
ARCADERO AND
SWUG.OR
Embarcadero Technologies provid s a comple e set of pr fessional-g ade databa e tools for he high performance SQL DB to take c ntrol of S L, storage, performan e, capacity managem nt, and change ma agement. R/Studio allows you to reverse en ineer the RD so you nderstand the task at hand. E barcadero DB Optimizer XE, DB rtisan XE, and Analys Series To ls are designed to deliver pro uctivity gains, regardless of your current le el of expe tise. DB C ange Man ger XE enables yo to simplify, automate, and report database change. In a dition, the e essential support tools will gi e you the confidence t carry out ven the most complex tasks, which goes a lon way to ensuring th success of your datab ses. Another valuable resource for hi h perform nce SQL BAs is the SQL Serv r Worldwide Users Group, SS UG.ORG, which provides articles, video programs, we casts, virtu l conferen es, and the registea dforlearn many otherGresources help manage compl xents, environm You can e insight, SSWUG.OR newslett o r to stayyou o top of latthese st advance disc ents. ver valuabl from exper s. The site allows you to search t e site for s ecific articles, editorials, scripts, a d more that addres very speci ic challenges that affec your organization’s da abase environment.
ABOUT THE AUTHORS
S c ott o Walz has more than 15 years of xperience in database de elopment and serves a senior director of pro uct manag ment for Embarcadero Technologies. In this position, Scott oversee the dir ction of th company's database product family, while foc sing on database d velopment and admini tration pro ucts. Prior o joi ing Embarcadero four ears ago, Scott served as develop ent lea for Louisville Gas & Electric. He h lds a bach lor's degre in co puter information syst ms from Western Kent cky Univer ity. S te ph e n Wyn k oop is a Mi rosoft SQL Server MVP and the fo nder of SS UG.ORG. e has worked with SQ Server since its incepti n in 1989 and writes a daily col mn and ne sletter on the site, as ell as a we kly SQL Server video p ogram. Ste hen is the uthor of m re than 12 ooks translated into 7 languages around the world. Steph n has spoken at num rous techn logy confe ences and reports regularly on the happening in the technology world.
Embarcader Technologi s
- 15 -
Embarcadero Technologies, Inc. is the leading provider of software tools that empower application developers and data management professionals to design, build, and run applications and databases more efficiently in heterogeneous IT environments. More than 90 of the Fortune 100award-winning plus an active community more than three million users worldwide Embarcadero’s products toof optimize costs, streamline compliance, andrely on accelerate development and innovation. Founded in 1993, Embarcadero is headquartered in San Francisco with offices located around the world. Embarcadero is online at www.embarcadero.com. www.embarcadero.com.
View more...
Comments