Tài liệu SQL Server MVP Deep Dives- P10 docx

40 403 0
Tài liệu SQL Server MVP Deep Dives- P10 docx

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

316 CHAPTER 23 Mobile data strategies Unlike svcutil.exe, this process will not generate a config file to store the endpoint information This information is stored in the client proxy code To use this tool: Open a Visual Studio command window Change the directory to your mobile application directory Enter this command: NETCFsvcutil.exe http:///yourservice/service.svc The preceding command should generate two source files The one named after your service will contain the proxy class you will use to consume the WCF service you created Add these classes to your project and compile the code The code can be found at this book’s website, http://www.manning.com/ SQLServerMVPDeepDives Comparison Much thought has been given to creating solutions to ensure that data remains in sync during periods of connectivity All of the techniques—RDA, MR, and MSF—allow data synchronization and replication; however, each has its own strengths and disadvantages, as shown in table Table Key feature comparison of the three synchronization methodologies Key feature RDA MR MSF Synchronize by using services No No Yes Supports heterogeneous databases No No Yes Incremental change tracking No Yes Yes Conflict detection and resolution No Yes Yes Easily create data views on the client No No Yes Automatically initialize schema and data Yes Yes Yes Supports large data sets Yes Yes Yes Query processor is locally available Yes Yes Yes Automatically propagate schema changes No Yes No Automatically repartition data No Yes No Use on devices Yes Yes Yes Summary Which replication strategy you use is up to you, but if you are looking for a robust, developer-centric, scalable solution, the MSF should be your choice Notice the comparison in table MSF replaces the functionality in RDA with an enhanced plan and Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark Licensed to Kerri Ross Summary 317 copies the functionality of MR If you require a DBA-centric approach with little code to set up the process, then MR is your choice Both MSF and MR will keep your data in sync With the techniques and code samples we have shown in this chapter, you will be able to take advantage of these methodologies to transfer, create, modify, and replicate your data from your mobile device to your desktop server About the author John Baird began his computer programming career while in the US Navy In 1982, he helped form and direct the first PC-based computer processing department for training and manpower in the Department of Defense After leaving the military in 1988, John began a varied career as a consultant developing business applications ranging from computer-based training to vertical market software for resellers Today, John is working for the industry leader in financial software for fund administration John was awarded his MVP status for device application development beginning in 2008 Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark Licensed to Kerri Ross Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark Licensed to Kerri Ross PART Database Administration Edited by Paul S Randal and Kimberly L Tripp A database administrator (DBA) has a tiresome and sometimes thankless job—until things go wrong It’s then that a DBA’s skills are most apparent But the less frequently anyone has to visit their DBA, the better that DBA is doing! So how does a good DBA it? A good DBA works with actions rather than words: automating, monitoring, tuning, but above all learning and constantly realizing what they don’t know No one can know everything, and a good DBA recognizes that—even embraces it A good DBA is always looking to improve their systems, learn tips and tricks, and prototype new configurations A good DBA sets up alerts to be notified of errors and problems as soon as they begin to happen, possibly solving them before they turn into disasters Just as in life, the sooner you know there’s a problem, the easier it may be to fix! (Did you know that you can set up SQL Server Alerts based on error severity levels—not just specific error numbers? For severity levels 19 and higher, a generic alert should notify you that an error has occurred.) So, how does a DBA make this happen? Not only does a good DBA proactively look for faults before they become catastrophic but, when something does go wrong, a good DBA takes the time to a root-cause analysis to make sure the risk is avoided in the future Leveraging the SQL Server toolkit is imperative in making this happen Auditing, leveraging the Dynamic Management Views (DMVs), using PowerShell, knowing the ins and outs of backup and restore, understanding security, understanding availability; there are a lot of areas to understand, and Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark Licensed to Kerri Ross a good DBA must be a jack of all trades and a master of at least some! It’s not easy, and it’s more than just a job for a good DBA SQL Server is a passion for these DBAs—a hobby in addition to their job—and they’re constantly learning and expanding on what they know to improve their uptime, minimize data loss, and even allow them to take a vacation once in a while This book won’t teach you everything you need to know to be a good DBA, but it’s one important part in the lifelong quest to get you there Specifically, this section consists of tips and tricks from some of the many MVPs who are either full-time DBAs (or used to be) or who consult with DBAs who are constantly improving their systems and skills Many of these topics are the particular passions of the authors, and they’ve donated their time and experiences to help us all become better DBAs We truly want to thank them for their time and especially their passion SQL Server is a passion for both of us and we’ve enjoyed reading and learning from these chapters and experiences Whether you’re a seasoned DBA or a newcomer to SQL Server, we know you’ll find material in this section that will help you learn, grow, and become a better DBA About the editors Paul S Randal and Kimberly L Tripp are a husband-and-wife team who own and run SQLskills.com, a world-renowned SQL Server consulting and training company They are both SQL Server MVPs and Microsoft Regional Directors, with over 30 years of combined experience on SQL Server Paul worked on the SQL Server team for nine years in development and management roles, writing many of the DBCC commands, with responsibility for core Storage Engine for SQL Server 2008 Paul writes extensively on his blog (SQLskills.com/blogs/Paul) and for TechNet Magazine, where he is a Contributing Editor Kimberly worked on the SQL Server team in the early 1990s as a tester and writer before leaving to found SQLskills and embrace her passion for teaching and consulting Kimberly has been a regular at worldwide conferences since she first presented at TechEd in 1996, and she blogs at SQLskills.com/blogs/Kimberly Paul and Kimberly have written Microsoft white papers and books for SQL Server 2000, 2005, and 2008, and are regular, top-rated presenters worldwide on database maintenance, high availability, disaster recovery, performance tuning, and SQL Server internals Together they teach the SQL MCM certification throughout Microsoft In their spare time they like to find frogfish in remote corners of the world Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark Licensed to Kerri Ross 24 What does it mean to be a DBA? Brad M McGehee If you ask ten database administrators (DBAs) what their job roles are, you’ll get ten different answers For example, one organization may need a DBA to manage the day-to-day administration of SQL Server instances, whereas another organization may want a DBA to write both Transact-SQL (T-SQL) and C# code Another organization might want a DBA who specializes in SQL Server Integration Services (SSIS) packages, whereas another organization may want a DBA who specializes in database design The job of DBA encompasses many different roles (and often job titles), and these vary widely from one organization to the next In short, there is no standard job description for a DBA This is partly because the job title doesn’t have a long history (relational databases were first used in the 1970s, and Microsoft SQL Server Version 4.21 was released in 1993) and partly because the DBA role is quickly evolving as new technologies are released Because there is no commonly-accepted definition of a DBA, the goal of this chapter is to describe the types of tasks and roles that DBAs commonly perform, with the aim of explaining to those new to the profession what DBAs day-in and dayout The first section of this chapter describes many of the tasks DBAs commonly perform The second section classifies these tasks into specialty roles, as you will rarely find a DBA who performs all of these tasks all the time Throughout this chapter, I try to answer the question: “What does it mean to be a DBA?” Typical DBA tasks: A to Z DBAs perform so many different tasks that it is hard to categorize them all The alphabetized list that follows outlines the common DBA tasks This list is by no means comprehensive, and some of the tasks overlap 321 Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark Licensed to Kerri Ross 322 CHAPTER 24 What does it mean to be a DBA? APPLICATION INTEGRATION Most organizations use some combination of in-house and third-party applications; and few of these applications work in isolation Therefore, DBAs often have to make disparate applications talk to one another, using a database as the means of sharing data DBAs commonly get involved in figuring out the best way to integrate applications, and often perform the integration themselves ARCHIVING DATA Data grows over time and can become costly to store and difficult to manage In addition, increased data tends to exacerbate performance problems DBAs are often responsible for monitoring data size and growth, and determining the best way to store it In some cases, this may include archiving seldom-used data in another database, or it might mean purging data that is no longer needed Often, choices are limited, as company policy and government regulations can restrict how and where data is stored ATTENDING MEETINGS Most DBAs hate attending meetings because it detracts from work time Meetings are a fact of working life and, if used wisely, aren’t necessarily a waste of time With correct planning and preparation, meetings are great opportunities for improving communications The responsibilities of the DBA are often unknown or misunderstood by coworkers, so DBAs should always take advantage of opportunities, such as meetings, to share with others what they AUDITING An emerging task of the DBA is to identify which users are accessing, inserting, updating, or deleting data, and when Auditing might only be necessary for limited time periods, for specific data, or it might be required 24/7 for all data DBAs often work with people outside their organization, such as external auditors, to perform this task And to further complicate the lives of DBAs, many industries are subject to specific regulations on how data is accessed and protected, which means that DBAs have to comply with some specific rules, with the potential for significant penalties, should they not fully comply BACKUP AND RECOVERY One of the most fundamental aspects of the DBA’s job is to protect the organization’s data This includes making periodic backups of data and keeping it safe from accidental or intentional destruction In addition, a well-developed recovery plan needs to be implemented and tested so that when problems arise, data and access to critical systems can be restored quickly BUSINESS INTELLIGENCE AND DATA WAREHOUSING Another emerging trend is for DBAs to be tasked with the creation and maintenance of data warehouses and business intelligence applications, so organizations can better use their data to make more effective business decisions Increasingly, DBAs are specializing in this fast-growing area Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark Licensed to Kerri Ross Typical DBA tasks: A to Z 323 CAPACITY PLANNING In most organizations, the number and size of databases grow rapidly It is the responsibility of the DBA to monitor data growth, and plan how best to deal with it This may include archiving it, compressing it, increasing the size of current hardware, or adding new hardware CHANGE MANAGEMENT SQL Server configurations, database schema, T-SQL code, and many other facets of the application ecosystem change over time It is often the responsibility of the DBA to perform impact analysis before changes are made, implement changes, test changes, and document them DATA MODELING AND DATABASE DESIGN The foundation of all efficient and scalable databases is good design DBAs often create database designs by performing needs and requirements analysis, creating a logical model, and then implementing the physical model Larger organizations may have DBAs who specialize in database design DATABASE APPLICATION DEVELOPMENT Many DBAs are application developers who specialize in writing code to access data stored in SQL Server databases Although this is most commonly done using T-SQL, it can include writing code that is used to access SQL Server data Many DBAs decide to make this their area of specialty, because of the depth of knowledge required to be a good database applications developer DEVELOPING AND MAINTAINING BEST PRACTICES Successful DBAs are proactive in their work, and one of the best ways to be proactive is to develop sound database best practices, and to implement them in a consistent manner The better organized and managed the database operations, the more efficient they will be One of the many ways that DBAs can perform this task is to create a runbook that describes the organization’s best practices and internal procedures This document is the DBA’s bible for performing all DBA-related functions DISASTER RECOVERY At some point in their careers, DBAs will have to recover lost data This may be as simple as restoring a database and its log files, or it may be as complex as moving a weather-damaged data center from one city to another To make dealing with disasters easier (small or big), it’s the DBA’s responsibility to plan, implement, and regularly test disaster recovery scenarios HARDWARE SETUP AND CONFIGURATION In some organizations, hardware is handled by dedicated hardware technicians In others, the DBA is responsible for building, installing, and configuring their own hardware, including servers and storage area networks (SANs) In addition, DBAs may also perform regular hardware troubleshooting and maintenance HIGH AVAILABILITY A DBA needs to ensure that the databases are available to users when they need access to data You can help ensure high availability in many different ways, including use of Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark Licensed to Kerri Ross 324 CHAPTER 24 What does it mean to be a DBA? log shipping, clustering, database mirroring, and other technologies Because of the specialized knowledge required for high availability techniques, many DBAs choose this as their main area of focus INSTALLING, CONFIGURING, AND UPGRADING SQL SERVER SOFTWARE One of the most time-consuming of all database tasks is installing, configuring, patching, and upgrading SQL Server instances Although it might sound like an easy task, it usually isn’t One of the difficulties is finding a good time to perform such work, especially in 24/7 shops In addition, each time SQL Server is patched or upgraded, there is the risk that after the patch or upgrade the applications that access the database, or the databases themselves, might not work properly On top of this, DBAs often have to battle third-party vendors who are unwilling to certify that their application will work after you have made the changes This requires the completion of planning, testing, and backout preparation before implementing major changes LOAD BALANCING Over time, the load put on individual databases changes DBAs are responsible for monitoring workloads and figuring out how to maximize hardware resources to get the best SQL Server performance This may involve moving a database from a heavily loaded server to a server with a lighter load SQL Server virtualization, and how it can benefit load balancing, is becoming a hot topic for many DBAs For more information on SQL Server virtualization, see chapter 39, “Running SQL Server on Hyper-V,” by John Paul Cook MAINTAINING DOCUMENTATION Writing and maintaining documentation is probably the most boring and loathed task that a DBA will encounter However boring, it is a critical part of the DBA’s job If you don’t document, then there is no easy way to rebuild the current infrastructure should major problems arise MANAGING PEOPLE Many DBAs find themselves in management positions, such as a senior DBA in charge of junior DBAs Some DBAs at large organizations this full time, whereas others combine people management with other DBA duties On the other hand, when some DBAs get a taste of management, they give it up to get back to more technical work Managing people is not for everyone MANAGING SQL SERVER–BASED APPLICATIONS A surprise for many new DBAs is the realization that they are responsible not only for managing SQL Server and its databases, but in many organizations, they are also responsible for managing any applications that access the database In some organizations, the DBA spends more time managing applications than SQL Server itself MANAGING TEST ENVIRONMENTS In many organizations, DBAs manage test environments that not only include test SQL Servers and test databases, but also test applications The purpose of this is to allow applications (both in-house and third-party) to be tested before new versions of either the application or SQL Server are rolled out into production Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark Licensed to Kerri Ross Typical DBA tasks: A to Z 325 MENTORING Oftentimes, DBAs have to share their knowledge with other DBAs, developers, or end users This might be informal one-on-one tutoring, or it might include classroom training MONITORING This is a wide-ranging task that includes multiple subtasks, such as performance monitoring, monitoring server disk space, viewing logs, ensuring jobs have run successfully, and scrutinizing for errors Although a variety of third-party tools are available to perform these tasks, DBAs commonly spend a lot of time performing monitoring manually because they don’t have a budget for such tools, or they are not familiar with them NEEDS AND REQUIREMENTS ANALYSIS Whether DBAs are involved in development, or just supporting third-party applica- tions, they often get involved in needs and requirements analysis This can include talking to users, finding out their needs and requirements, and determining the best way to meet them This often includes researching available third-party solutions and determining if it’s best to develop the application in-house, or to invest in a third-party application NEGOTIATING SERVICE LEVEL AGREEMENTS In many organizations, DBAs become involved in negotiating service level agreements (SLAs) An SLA is an agreement between parties in which one is the customer and the other is the service provider The customer (the owner of the business application accessing SQL Server databases) and the DBA (the service provider), must agree on acceptable levels of service, such as defining what is an acceptable response time for a specific type of transaction Part of the negotiating process often requires the DBA to set expectations and educate the customer on what is feasible given the resource constraints of the organization OPERATING SYSTEM SETUP, CONFIGURATION, AND ADMINISTRATION Just as many DBAs manage their own hardware, many DBAs also manage the operating system on their SQL Server instances Not only must SQL Server be configured opti- mally, the operating system it is running on must also be configured optimally, and be properly maintained PERFORMANCE TUNING Everyone wants their data right now It is the job of the DBA to monitor performance and to determine ways to optimize database performance This can be complex, and many DBAs specialize in this area PROJECT MANAGEMENT Oftentimes, DBAs find themselves in charge of a large project involving many other people This could entail writing a new in-house application, or managing the migration of a data center from one location to another DBAs with good project management skills are in high demand Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark Licensed to Kerri Ross ... Microsoft SQL Server MVP with over 14 years of experience with SQL Server and over years of training experience Brad is a frequent speaker at SQL PASS, European PASS, SQL Connections, SQLTeach, SQLBits,... has changed over time From SQL Server 6.5 to 2000, an MP was executed by sqlmaint.exe through a SQL Server Agent (Agent) job As of SQL Server 2005, an MP is a SQL Server Integration Service (SSIS)... run SQLskills.com, a world-renowned SQL Server consulting and training company They are both SQL Server MVPs and Microsoft Regional Directors, with over 30 years of combined experience on SQL Server

Ngày đăng: 15/12/2013, 13:15

Từ khóa liên quan

Tài liệu cùng người dùng

Tài liệu liên quan