Webcast Recording – How to Get Your First Job as A Database Administrator

You’d love to become a Database Administrator, but how do you get your foot in the door? Ten years ago, Kendra Little was in your position. Since then, she landed her first job as a SQL Server DBA, worked her way up to Senior DBA, and is now a partner in a database consulting company. Along the way, she’s hired Junior and Senior DBAs and she helps employers develop interview procedures for database administrators. In this 30 minute session you’ll learn what employers look for, steps you can take to make yourself a great candidate, and how to build the right resume to get your first DBA job.

Interested in links discussed during the webcast? Scroll on down after the video is over.

One thing I forgot to mention in the webcast: get business cards for when you attend those user group meetings! They don’t have to be expensive or fancy, they just need to help people remember your name and how to contact you.

Links for resources I mention in the video:

  • Find a Local SQL Server User Group of the Professional Association of SQL Server here
  • Find out about SQLSaturday events here
  • Purchase SQL Server 2008R2 Developer Edition here
  • Or use an evaluation copy (180 days) of SQL Server 2012, available here

Kendra Little

Kendra specializes in high availability and performance tuning. She is a Microsoft Certified Master in SQL Server-- the highest technical SQL Server Certification available. Kendra loves databases and software development more than long walks on the beach. Those cartoons in her blog posts? She draws 'em all. Read more and contact Kendra.

More Posts - Website

Follow Me:
TwitterFacebookLinkedInGoogle PlusYouTube

SQL Server 2012 Release Date: April 1, 2012

Breaking news – Microsoft says it will be generally available for download on April 1, 2012 – yes, April Fool’s Day.  Mary Jo Foley writes that MSDN/TechNet subscribers will be able to download it tomorrow, March 7th.

Brent Ozar

Brent specializes in performance tuning for SQL Server, VMware, and storage. He's one of the very few Microsoft Certified Masters of SQL Server, a published author, and a Microsoft MVP. He likes travel, Jeeps, Apple gear, jokes, and writing about himself in the third person. Read more and contact Brent.

More Posts - Website

Follow Me:
TwitterFacebookLinkedInGoogle PlusYouTube

How To Decide if You Should Use Table Partitioning

Great volumes have been written about table partitioning. It’s a complex feature and you can read for days to just understand how you might apply it. But will it improve performance for you? Table partitioning produces great benefits for some applications, but causes giant headaches for others.

How do you know if you should invest your time in table partitioning?

I can help.

SQL Server Table Partitioning: The Basics

Let’s nerd out for a bit on what table partitioning does in SQL Server. First of all, this is an Enterprise Edition feature. (Cha-ching! $$$.)  You can test it in developer edition, but if you want to use it in production, you gotta make sure it’s worth the licensing costs as well as your time.

Table partitioning allows tables or indexes to be stored in multiple physical sections— a partitioned index is like one large index made up of multiple little indexes. Each chunk, or partition, has the same columns– just a different range of rows. Table partitioning is “transparent”. This means a partitioned heap, clustered index, or non-clustered index can be referenced as a single structure although it’s stored in independent physical partitions. In other words, in theory you don’t need to change any code in the calling applications. (Is this true in reality? More on this later.)

An Textbook Example of Table Partitioning

Contoso Corporation’s Froyo Division has a 2TB database named FroyoReports. Each day, 10 million rows of sales data are loaded into a table named FroyoSales. Contoso Corp has employees worldwide who query the data using SQL Server Reporting Services. Reports are run against FroyoReports 24 x 7, although there is a two hour window each day where there is significantly lighter load. 95% of reports run are against the most recent two months of data, and the DBA team controls and can tune the queries run by each report. The Froyo DBA team needs to maintain only 13 months of data in the FroyoSales table. As a safety precaution, they prefer to keep three additional months of data online, but do not want reports to access the older data.

Life used to be tough for the Froyo DBA team. Each night as data was loaded, reports repeatedly blocked inserts. To help alleviate blocking, some reports were modified to have NOLOCK hints. This meant that sometimes reports contained partial data for the most recent day, which caused problems. Users were never really sure when data was finished loading and when it was safe to run reports. The Froyo DBA team deleted old data on weekends, and that process also had problems. There was additional blocking and deletes slowed performance significantly. To solve these problems, the Froyo team implemented table partitioning. They partitioned the FroyoSales table by date.

Each night, the Froyo team loads data with an automated process. First, it loads new fact data into a fresh, empty table named FroyoSalesStaging.

A staging table loaded with data

A staging table loaded with data

Next, it adds indexes and constraints to FroyoSalesStaging so its structure matches Froyo sales.

Preparing a staging table to be switched in to a fact table

Preparing a staging table to be switched in to a fact table

Then, they switch the single partition out of FroyoSalesStaging and into the partitioned table FroyoSales. (This involves a few commands to prepare the metadata for the partitioned table prior to the switch– we’re going for an overview here.) This switch takes a brief moment, then all the new data is visible to users.

Switching a partition from a staging table to a fact table

Switching a partition from a staging table to a fact table

The Froyo team has also automated how they remove old data. Each night they switch the oldest day– which is now past their 13 month limit– out from FroyoSales and into a table named FroyoSalesArchive. (Similarly, there’s a few commands to clean up metadata for FroyoSales after the switch out.)

Switching a table partition to an archive table

Switching a table partition to an archive table

Handy, isn’t it?

Check Out Our Table Partitioning Poster to See How Partitioning Works

It can be complicated to explain how all the components of partitioning can work together, so I’ve created a poster. This poster isn’t about best practices, it’s to help show how partition functions, partition schemes, filegroups, and files work together. For example, the poster shows two partition schemes. Not every implementation needs more than one partition scheme for a partition function– the poster just shows you the option.

SQL Server Table Partitioning Poster

SQL Server Table Partitioning with Brent Ozar PLF

Download “Table Partitioning With Brent Ozar PLF“ (free site login required).

The Main Features of Table Partitioning— And the Gotchas

Here are the big attractions for table partitioning, along with the fine print.

SWITCH That Partition

As you can see above, a whole partition can be switched into the table or switched out, allowing for extremely fast loading and removal of large amounts of data. This is, in my opinion, the biggest benefit of partitioning.

There are a couple of gotchas to be aware of. Switching in and switching out partitions can be very fast, but an exclusive lock— Called ‘SCH-M’, or Schema Modification lock— is required. This means you can get blocked from loading or removing data from your table— potentially for a very long time. Also, all of your enabled non-clustered indexes must be “partition aligned” to switch a partition in. This means the partitioning key must be part of each of those indexes. If you need to maintain uniqueness on a set of columns that doesn’t include the partitioning key (which is often the case in OLTP environments), this can pose a problem.

Query Performance on Partitioned Tables: Partition Elimination and Beyond

SQL Server tries to identify when it can use limited parts of a partitioned table. The SQL Server query optimizer may direct a query to only a single partition, multiple partitions, or the whole table. Using fewer partitions than the entire table is called “partition elimination.”

Statistics are maintained for the entire partitioned table or index— you don’t get additional steps in your histogram for each partition. This means that the SQL Server Query optimizer may still have a very hard time knowing how much data is going to be returned by your query, and this difficulty will increase as your table grows. The result may be slow queries.

Queries will perform better when you specify the partitioning key in the criteria (aka the “where clause”). So, although partitioning is “transparent,” for existing applications, query tuning will almost always be required.

Partition Management

Individual partitions may:

  • Be rebuilt individually, for clustered and nonclustered indexes alike.
  • Be set to read-only, via their filegroup— gives you options to optimize backups
  • Live on different disk sub-systems — less frequently accessed data can sit on slow disk. Frequently accessed data can sit on faster disk. All this within the same table! You can move a partition to faster or slower disk online with some virtualization and SAN solutions.

There’s a few things to be aware of:

  • You want to be careful about splitting partitions— performance can be very slow.
  • In SQL Server 2005 and 2008, individual partitions may be rebuilt offline only. An entire partitioned index may be rebuilt online— but that’s a bummer if your database is 24×7.
  • Setting a filegroup to read-only doesn’t eliminate lock management overhead— that’s only true for a read-only database.

Columnstore Indexes and Table Partitioning

Columnstore indexes are a really hot feature in SQL Server 2012. These are columnar indexes optimized for blazing fast performance. Although these indexes will be read-only, partitions may be switched in to columnstore indexes.

When Is a Table Big Enough to Partition?

After covering the basics of table partitioning, this is usually the first question people have: “Is my table big enough?”  My response is: “Let’s talk about why you’re interested in table partitioning. What is the problem you’re experiencing?”

Tell Me Where Your Table Hurts

When people investigate table partitioning in SQL Server, usually they’re having a problem scaling up their database.  What you are experiencing may take many different forms. The problem can contain one or more of the following:

  • “Slow” queries that return small amounts of data
  • “Slow” queries that return large amounts of data
  • “Slow” loading of data
  • Blocking between readers and writers (inserts or updates)
  • Long-running index maintenance jobs (or an inability to run them at all because they would take so long)

“Slow” is of course highly relative. Here it means “my users are complaining” or “my webserver is timing out” or “something is failing and paging me in the middle of the night.”  Often, the tables in question are being used for a mixture of OLTP activity and reporting activity.

My approach is to talk to the team and find out what the experience of the problem is like. Literally, “What keeps you up at night about this table?”

How Is Your Overall Health?

Prescribing table partitioning is like recommending significant surgery— you don’t want someone to go under the knife unless it’s the best way to make things better. I look at the overall health of the system. Where are the current bottlenecks? What are we waiting on? How healthy are the individual components? How are the queries currently performing, and what do the query plans look like? What patterns are in use in the queries which are running? I also look at the structure of the tables and indexes in the context of the queries.

What Performance Characteristics Do You Need?

How many records do you want to load a day? How many records will you be deleting a day in six months? How many new clients is your business expecting to be bringing on, and what is the estimated impact that will have on reads and writes on your system? The number of expected clients can be tricky to translate to database activity. A SQL Server health check can produce some metrics for current activity that can be used for projections.

How’s The Health of Your Budget?

Table partitioning isn’t cheap— this feature is not available in SQL Server Standard Edition. Further, we’re losing the option to have CAL-based licenses for Enterprise Edition with SQL Server 2012. In some cases, Enterprise edition is already in place because of other feature requirements. In others, budgetary constraints make looking at non-Enterprise features attractive.

How Many Queries Can You Tune?

Whether or not you have the flexibility to tune queries is a big differentiator in how you choose to scale up your application. On the one hand, table partitioning is “transparent” because the name of the partitioned objects doesn’t change. On the other hand, you want to tune queries to get partition elimination and the best possible query plans after you partition— and sometimes you need to get a little creative. The structure of your tables and how queries are currently written will play a huge role if you have a limited (or no) ability to tune queries.

What’s The Best Approach to Scaling Your Application?

Here’s my secret: I don’t answer the question of “Should I use table partitioning?” Instead, I answer the question “What is the best way to scale this application?”

The right approach for your scalability problem may contain table partitioning— perhaps by itself, perhaps in combination with other technologies. In the right application, table partitioning can be truly awesome. But we also may be able to scale your application up in another way— perhaps more cheaply, perhaps more quickly, or perhaps in a way that includes built-in geo-diversity. It all depends on your database health, performance requirements, budget, and flexibility.

Still Interested?

If you got this far and you’re still interested in table partitioning, maybe it’s the right fit for you!

Kendra Little

Kendra specializes in high availability and performance tuning. She is a Microsoft Certified Master in SQL Server-- the highest technical SQL Server Certification available. Kendra loves databases and software development more than long walks on the beach. Those cartoons in her blog posts? She draws 'em all. Read more and contact Kendra.

More Posts - Website

Follow Me:
TwitterFacebookLinkedInGoogle PlusYouTube

Why Availability Groups Make It Cool Again to Be a Sysadmin

Professions go through phases. Some skills are highly valued for a while, then go out of fashion. Just like leg warmers and skinny jeans, some skills come back into style when you least expect it.

Sideburns are back

Database Administrators Started Out in the Server Room

In the early days, most database administrators started out by racking servers. Some DBAs wrote some application code, but most DBA jobs were classified as being part of infrastructure teams. In the old days, Senior DBAs often worked with Active Directory and also helped manage domains.

This changed gradually over time. Database development emerged as its own profession, distinct from general application development and database administration. Business intelligence branched off. But database administration itself evolved and became more application-centric.

More Knobs and Dials Made DBAs Software Technicians

Over time, performance tuning has become increasingly complex. Hardware tuning is now just one of many ways to make an application run faster— we have a myriad of settings in the operating system and in SQL Server to tune performance for a given workload.

This change in breadth made database administrators focus increasingly at the Operating System level and above. The rich instrumentation in SQL Server caused DBAs to be increasingly valued for skills at interpreting results from dynamic management views, rewriting queries, and tuning indexes.

SAN and Virtualization Increased Specialization in IT

Changes in the way we manage storage and servers also shifted the role of the DBA. Infrastructure teams are larger and more specialized. In many companies there is a central IT function for the purchase and management of hardware and operating system licenses. At the extreme end, in some environments the database administrators have little insight into what host their virtual machine is connected to, and may not be aware of what type of storage is in use. Some DBAs don’t have direct access to their Windows Servers.

This very specialized DBA knows a lot about SQL Server, but not much about system administration or Windows domains.

SQL Server 2012 Will Change the Way DBAs Think

The AlwaysOn Availability Group feature in SQL Server 2012 is about to change the style again. This feature doesn’t make the DBA any less specialized, but it has components that make it cool for DBAs to get back in touch with their inner sysadmin.

First of all, this feature is hot. Readable secondaries can help scale out an application with very minimal software development costs. Lots of organizations will want to know if this feature is right for them.

Secondly, consider this: every DBA needs a sandbox that can be flattened and rebuilt at will. This sandbox is for testing new features and practicing configuration. In the past, domain membership wasn’t needed to test most important SQL Server features. You can test replication, database mirroring, and logshipping simply by installing multiple instances into a single virtual machine (or onto Windows 7, for that matter) and granting permissions using local accounts.

With AlwaysOn Availability Groups, things are more complicated. To fully test the feature, you will need to enable the failover clustering feature on multiple SQL Server hosts. This means that you need:

  • Windows Server Enterprise Edition as the operating system
  • The Windows Server instances must be part of a domain

It’s also useful to be able to provision IPs for the environment and create individual service accounts. Voila— your sandbox environment needs a domain controller.

Test Environments Will Get Bigger

My sandbox used to be just my laptop, which hosted a few virtual machines. My VMs simply ran different versions of SQL Server— I’d start up whatever VM I needed for my testing, and only run one VM at a time.

You probably don't need to go this far.

All of that is changing now. To test and demonstrate Availability groups, I need to run at least one domain controller and five additional VMs for SQL Server instances. (There’s no shortcut for this, by the way— each replica in an Availability Group needs its own Windows server installation.) I’ve found that I need at least 16GB of RAM and 4 processor cores minimum to run a light test workload on that full group.

This expanded my sandbox environment quite a bit. It also expanded my knowledge: I’ve learned that sysprep is still required for Windows 2008R2 when cloning machines that will join a domain, if you want to successfully add them to a failover cluster. (There are some blog posts out there which say differently!) I also now know that a single cluster can’t contain both full and core installations of Windows Server, either— it’s one or the other.

More Senior DBAs Will Be Managing Domains Again

… but these domains will be private test environments, not production.

As SQL Server 2012 is released and becomes more mainstream, Senior DBAs everywhere will be configuring more complex sandbox environments than they’ve ever used before. They’ll be interacting with parts of Windows that they always took for granted, and learning about how SQL Server integrates into the OS.

Of course, not everyone will adopt the Availability Groups feature in production. It’s an expensive feature, and not every application justifies the cost.

But Availability Groups do raise the bar for Senior SQL Server DBAs. It’s going to become very valuable to know and demonstrate what the feature does, whether it’s worth the cost for a given application, and what the alternatives are.

To get to know that well, Senior DBAs will be renewing their interest in systems administration.

And I, for one, couldn’t be happier.

Want to get started now? Check out Brent’s blog post on How to Install Availability Groups.

Kendra Little

Kendra specializes in high availability and performance tuning. She is a Microsoft Certified Master in SQL Server-- the highest technical SQL Server Certification available. Kendra loves databases and software development more than long walks on the beach. Those cartoons in her blog posts? She draws 'em all. Read more and contact Kendra.

More Posts - Website

Follow Me:
TwitterFacebookLinkedInGoogle PlusYouTube

How to Get Money From Managers Video

Are you frustrated because you can’t get the tools or training you need?  Does your manager keep saying “NO!” and make you do things the hard way?  The real problem isn’t usually budgets: it’s communication.  In this 20-minute video, I’ll show you how to make the case for the stuff you want, show you free resources to help convince your manager, and tell you about how I struggled with that same problem too.

Some of the links we covered:

Liked this?  Here’s the free webcasts we’ve got coming up:

March 6 – How to Get Your First Job as a DBA
Kendra Little, Tech Triage Tuesday

You’d love to become a Database Administrator, but how do you get your foot in the door? Ten years ago, Kendra Little was in your position. Since then, she gained a job as a DBA, worked her way up to Senior DBA, and is now a partner in a database consulting company. Along the way, she’s hired junior DBAs and helped employers develop interview procedures for database administrators. In this 30 minute session you’ll learn what employers look for, steps you can take to make yourself a great candidate, and how to build the right resume to get your first DBA job. Register now.

March 13 – How to Succeed in Database Development Without Really Trying
Jeremiah Peschka, Tech Triage Tuesday

You love working with data, but you don’t want to be a DBA. What’s the right path to work with data? Six years ago Jeremiah Peschka was a developer who wanted to work with data. Since then he’s been a consultant, development DBA, software evangelist, and is now a partner in a database consulting company. In this 30 minute session, you will learn steps to take to get started, areas of specialization, skills employers are looking for, and hints for building a great resume to get a database developer job. Register now.

March 20 – Monitoring SQL Server: How to Pick Your Strategy
Kendra Little, Tech Triage Tuesday

Monitoring is critical to project your database servers AND your job: if you don’t know when a problem is occurring, how can you respond quickly? In this 30 minute session, Kendra Little will discuss availability and performance monitoring for SQL Server. She’ll summarize the tools available and give you guidelines to plan your strategy to tackle a monitoring problem. This session is appropriate for DBAs or IT Managers with one year or more experience with a production environment. Register now.

Brent Ozar

Brent specializes in performance tuning for SQL Server, VMware, and storage. He's one of the very few Microsoft Certified Masters of SQL Server, a published author, and a Microsoft MVP. He likes travel, Jeeps, Apple gear, jokes, and writing about himself in the third person. Read more and contact Brent.

More Posts - Website

Follow Me:
TwitterFacebookLinkedInGoogle PlusYouTube

What’s Stopping You – from Snooping?

No, this isn’t a touchy-feely inspirational post that talks you into taking leaps and bounds in your career.  I write those every now and then, but that ain’t today.

Instead, today’s post is about a question: what’s stopping you from snooping in your company’s data?

You, as someone with a lot of database access, have more security permissions than just about anyone in the company.  You probably have access to payroll records, financial data, company secrets, you name it.  Sure, the company would like to think everything’s kept under lock and key, but developers and database administrators have the keys and they know how the locks work.  Even in the most secure environments, I usually find that the staff could answer any question they feel like asking.

But we rarely do.

When I was a DBA, I felt a strange pride in knowing I could query any data whatsoever, yet I was beyond temptation.  I didn’t want to know anybody else’s salaries because I believed it didn’t matter.  If someone else was making more money than me, good for them and their negotiating skills.  If nobody was making more than me, I shouldn’t be proud – I should be ashamed for taking more than I probably deserved.  I didn’t want to see anybody else’s employee review, I didn’t want to know how much the company was making, and I didn’t want to see confidential data.

Enron Complex in Houston

I’ll confess, though, since it’s just the two of us here – at a former company, when our sysadmins stumbled across a cache of videos on the file server, I stood around and watched with the rest of the IT team.  We played an employee’s videos of their trip to Russia in search of a mail order bride, and my mind is permanently scarred by the memory of that employee sitting in a hot tub auditioning a prospective wife.  It’d be one thing if these videos were in the employee’s private home directory, but these were shared with his entire department!  We called HR, and oddly, the guy kept his job.  He must have had more incriminating videos of other folks.

I’ll also confess that in the 2000s, while I lived in Houston, there were only two companies I ever aspired to work for: Arthur Anderson and Enron.  Oh, how I longed to work in the beautiful architecture of the downtown Enron complex, but the Enron scandal brought both companies down in a flaming mess, almost before the buildings were ready.  I counted my odd blessings that I hadn’t been admitted entry into those doomed businesses.  However, what if I had?  What if I’d gone to work for either company, and I suspected shady dealings?  Would I have had the foresight, guts, and security permissions to make database queries to find out what was going on behind the scenes?

My guess is no – I’d never dream of writing a query to get data I’m not supposed to access in my daily job.  Why is that, and what’s stopping you?

Brent Ozar

Brent specializes in performance tuning for SQL Server, VMware, and storage. He's one of the very few Microsoft Certified Masters of SQL Server, a published author, and a Microsoft MVP. He likes travel, Jeeps, Apple gear, jokes, and writing about himself in the third person. Read more and contact Brent.

More Posts - Website

Follow Me:
TwitterFacebookLinkedInGoogle PlusYouTube

“Who Wrote This?” Contest

Over and over, readers leave comments here saying things like “Nice comment, Brent” on a post that Kendra wrote.  We laugh about it – after all, they can’t really be reading that closely if they don’t even notice the name on the bottom of the post, right above where they’re commenting – but we started to ask ourselves questions.  Are our writing styles really so similar that people can’t tell us apart despite hand-drawn illustrations, references to our favorite music, and our individual topic selections?

One lucky winner gets this prize. Hand model not included.

So we figured it’s time for a test. We’ve picked 3 topics, and Brent, Jeremiah, and Kendra each wrote a paragraph on each topic.

Your Mission: Guess the author of each paragraph.

Topic 1: Working with Bad Managers

Mystery Author A: In the real world, we don’t skip to work humming Don’t Worry Be Happy while eating a bacon-covered donut.  Sometimes we drag our feet on every step of the way, cringing as we walk in the front door of the office.  Looking back through my career, the one thing that’s always made me hate my job hasn’t been the work itself – it’s been a bad manager.  I’ve been happy doing some truly awful work, but if I’ve got a bad manager, it doesn’t matter how good the work is, because I’ll still hate it.  Working with bad managers means working against my own happiness, and I’ve come to learn that there’s no changing bad managers.  I can try to manage them and groom them, but doing so comes at the expense of my own happiness and productivity.  Life’s too short – take that effort and focus it toward getting a better environment where you can happily contribute and grow.

Mystery Author B: Let’s face it, we’ve all had bad managers. While you should never make your manager look bad, you should help them get better. Mentor your manager just like you would mentor a junior DBA. Provide them with guidance about interacting with the rest of the team – who responds well to which leadership styles – as well as help your bad manager understand how to communicate with the rest of the organization. Above all else, clearly set expectations around your role on the team and, your communication style, and just where your help is going to end. Making sure everyone knows what to expect is a good way to make the best of a bad manager.

Mystery Author C: Bad managers come in so many varieties. Ever worked for The Big Talker who sets out a bold plan, then folds at the first complaint from customers? How about The Groundhog who never remembers anything from the day before– so you get to constantly re-explain what you do? Have you reported to The Gossip, who can’t keep anyone’s secrets, much less their own? The trick to working for all bad managers is to remember that they aren’t your parent. Take charge of your career. Track your goals and weekly progress. Proactively schedule and manage meetings. Direct your own work. Make connections with your customers. People around you will notice who on your team is effective and helpful, and the skill of managing yourself successfully is well worth having in the long run.

Topic 2: Working with Remote Teams

Mystery Author A: Working remotely can be tricky; there can be a significant lag in communications and people in different time zones may have different expectations about when you leave work. Like almost anything else the key is to make sure that everyone on the team has an understanding of how and when communication will occur. If you pick up the phone at 8:00PM, then you can rest assured that your co-workers will assume you’ll be working until 8:00PM. It’s just as important to stay in communication with your remote team via email and some tool like Skype or Microsoft Communicator. It’s just as important to communicate at the right time as it is to communicate face to face.

Mystery Author B: You might not trust the guy sitting in the next cubicle over, but if you haven’t worked with successful telecommuters, you probably trust a remote worker even less.  The key to remote team success is verifiable trust: feeling confident that invisible team members are doing the right amount of the right thing at the right time.  Both words are important – verifiable and trust.  When I’m working away from the rest of the team, I stay visible on instant messaging tools and try to respond as quickly as possible even when I’m away from the computer.  A phone with email and good apps is your best friend.  When a member of the remote team drops offline for extended periods, not visible in chat and not responding to emails, trust erodes and it’s time to start doing some verification.  Are they checking in good code at frequent intervals?  Are they responding to tickets and requests from other team members?  If not, the thrill is gone.

Mystery Author C: I’ve learned one thing from years of experience working with remote teams: email can be your worst enemy. What seems clear, precise, and specific in one time zone comes across as vague, soupy, and just plain weird in another. It usually takes days to find a critical misunderstanding about instructions sent in an email, then more time to clarify the issue. Meeting regularly with webcams– at least twice per month– may require working some strange hours, but it will save your projects hundreds of hours in the long run. Schedule the meetings in advance and make sure it’s OK to use flex time to avoid burnout.

Topic 3: Working with Your Nemesis

Mystery Author A: Sooner or later, we all work with that one special person who pushes every button. You may feel that your nemesis is unethical or has harmed your career. How do you handle it? The most important technique is the most difficult: don’t gossip about the issue. Ever. If you have knowledge of specific unethical behavior, you need to report it. That’s where discussion should end. As soon as you blow off steam at work by talking about your colleague, you complicate the situation and make it more difficult to resolve. Instead, focus on what’s best for the company.  When things feel too personal, block off some time in your calendar and use it to take a walk or work on your own goals in a place where you can’t be interrupted. Every job is temporary, but your reputation stays with you.

Mystery Author B: I’ve worked with a few people that I just couldn’t stand. Part of me always wanted to be a jerk, but another part of me wants to be respected and to get my job done. When working with your nemesis, it’s important to minimize unhealthy conflict. Conflict itself is good; healthy conflict will lead to challenging your existing ideas and making you better as a professional. Unhealthy conflict is going to lead to leaving three week old tuna fish sandwiches in someone’s desk drawer. I survived working with a nemesis by cultivating healthy conflict. We challenged each other on our ideas; even when we were on different projects, I always worked to make sure we were pushing each other forward instead of down the stairs. It wasn’t always a good time, but I got better as a result.

Mystery Author C: Oh no, it’s that guy.  Try to avoid eye contact.  We’ll slink into the stairway rather than use the elevator – he’s too lazy to take the stairs, so we can avoid having to spend another lunch hour with him.  Whew!  Made it.  How the heck does he keep his job here?  They say he produces good results, but I don’t believe that for a second.  He must have incriminating pictures of somebody, because I’d have fired him long ago.  You know what?  I’ve had enough.  Let’s make a plan to get rid of that stupid, arrogant jerkwad.  We’ll take him out for drinks tonight and – no, wait, put the knife down, bear with me for a second.  When he’s plastered, we’ll steal his phone and take pictures of our junk and text it to Shiela in HR.  She’ll think it’s his junk – well, I mean, as long as she’s never actually seen his junk, but you know what a prude Shiela is, so that can’t be possible.  He’ll get fired, and then hopefully the next guy will be better.  I swear, I can’t understand why this company can’t just hire nice, normal people?  Nobody ever sticks around here other than you and me.  Raise your glass – let’s have a toast to dedicated, friendly, hard-working people like us.  Cheers!  Hey, waiter, bring us another round of martinis.

Test Time! Who Wrote What?

Copy/paste the below into your comment and give us your best guess in the comments before Sunday, March 4th at midnight GMT.  We’ll throw all the correct answers in a hat, draw one winner at random, and announce their name on our March 6th webcast, How to Get Your First Job as a Database Administrator.  If no one guesses the answers correctly, we’ll throw all of the most correct answers in a hat (meaning, if four people guessed 7 names correctly, those four people will go in the hat.)  The winner will receive a set of PASS Summit 2011 Spotlight, Half-Day and Regular Session Recordings DVDs.

The fine print: Contest limited to US and Canada residents, because international shipping is such a pain in the old blog post.  If you’re abroad, you can still enter for the fame and bragging rights, but you won’t get the prize – we’ll designate an honorary US/Canada winner on your behalf.

Good luck, and show us how you know us so well!

Topic 1: Working with Bad Managers
Mystery Author A is -
Mystery Author B is -
Mystery Author C is -

Topic 2: Working with Remote Teams
Mystery Author A is -
Mystery Author B is -
Mystery Author C is -

Topic 3: Working with Your Nemesis
Mystery Author A is -
Mystery Author B is -
Mystery Author C is -

And the Winner Is…David Skelton!

David, Andy Galbraith, and Jesse Reich all guessed the correct answers, and we pulled David’s name out of a hat on our live webcast.  Here’s the correct answers:

Topic 1: Working with Bad Managers
Mystery Author A is – Brent
Mystery Author B is – Jeremiah
Mystery Author C is – Kendra

Topic 2: Working with Remote Teams
Mystery Author A is – Jeremiah
Mystery Author B is – Brent
Mystery Author C is – Kendra

Topic 3: Working with Your Nemesis
Mystery Author A is – Kendra
Mystery Author B is – Jeremiah
Mystery Author C is – Brent

Brent Ozar PLF Team

Brent Ozar PLF is a boutique consulting firm focused on understanding your environment and strategy. We partner with you to objectively identify pain points and develop solutions that align to your business goals. Your experience comes first; we share our knowledge and expertise to help you.

More Posts

Follow Me:
TwitterFacebookGoogle PlusYouTube

Webcast Recording – The Developer and the SQL Server Transaction Log

How does the SQL Server transaction log impact the performance of your code?

What impacts the performance of the transaction log, and how do you know when you’re pushing the limits of your log?

Kendra Little explains the role of the transaction log in SQL Server and what you can do to optimize your use of the log– we’ll discuss everything from the physical structure of the log to using minimal logging in your code. This talk is aimed toward DBAs and developers who have worked with SQL Server >= 1 year.

Looking for references and links Kendra refers to in the video? Scroll on down to the bottom of this post.

A Quick Note on Wording

Videos are great for monitoring your own wording. After watching this video I realized I have a tendency to sometimes use phrases along the lines of “clearing transactions” from the log. The better way to say things like this is that “checkpoint flushes dirty pages to disk.” When in the simple recovery model as I was in my demo, this can allow inactive portions of the log to be marked for re-use. But it doesn’t really “clear” them– that’s misleading, even if it is easier to say. (Read more on checkpoint here.)

References

Tools We Used: sys.dm_os_wait_stats, fn_dblog, and perfmon counters

  • We looked at wait stats by querying sys.dm_os_wait_stats with a stored procedure based off Glenn Berry’s DMV queries. To get yours, find his most recent set that’s right for your version of SQL Server, then search for sys.dm_os_wait_stats.
  • We looked at log records in the active portion of the transaction log using fn_dblog. This is technically an undocumented and unsupported function– use your own best judgment about when and where it’s safe to use. In the video, I’m talking about test environments! For a sample use, check out an interesting use of fn_dblog in Kalen Delaney’s Geek City: What gets logged for index rebuild operations?
  • We looked at the following performance counters on the SQLServer: Databases perfmon object:
    • Log Bytes Flushed / Sec
    • Log Flushes / Sec
    • Log Flush Waits / Sec

Kendra Little

Kendra specializes in high availability and performance tuning. She is a Microsoft Certified Master in SQL Server-- the highest technical SQL Server Certification available. Kendra loves databases and software development more than long walks on the beach. Those cartoons in her blog posts? She draws 'em all. Read more and contact Kendra.

More Posts - Website

Follow Me:
TwitterFacebookLinkedInGoogle PlusYouTube

Where to Run DBCC on AlwaysOn Availability Groups

With SQL Server 2012′s new AlwaysOn Availability Groups, we have the ability to run queries, backups, and even DBCCs on database replicas.  But should we?

Paul Randal (Blog@PaulRandal) covered this issue in today’s SQLskills Insider newsletter, and he says:

“It’s not checking the I/O subsystem of the log shipping primary database – only that the log backups are working correctly…. Log shipping only ships transaction log backups – so any corruptions to the data files from the I/O subsystem on the primary will likely not be detected by the offloaded consistency checks….  I’ve heard it discussed that the SQL Server 2012 Availability Groups feature can allow consistency checks to be offloaded to one of the secondary copies – no – by the same argument.”

Actually – brace yourself – I’m about to suggest that Paul’s DBCC advice needs to be even stronger.  Take the following configuration:

  • SQLPRIMARY – primary replica where users connect.  We run DBCC here daily.
  • SQLNUMBERTWO – secondary replica where we do our full and transaction log backups.

When Bacon Flies

In this scenario, the DBCCs on the primary server aren’t testing the data we’re backing up.  We could be backing up corrupt data every night as part of our full backups.  If we experienced corruption on the primary server, and it tried to take care of business with automatic page repair by fetching a copy from the secondary server (which also happened to be corrupt), we’d be screwed.  We wouldn’t have a clean backup of the page, and our data would be permanently lost.

The moral of the story: with Availability Groups, we need to run DBCCs on whatever server is doing our full backups, too.  Doing them on the primary database server isn’t enough.  In a perfect world, I’d run them regularly on any server that could serve a role as the primary database.  Automatic page repair can only save your bacon if a replica is online and has a clean copy of the page.

One group I’m working with has taken a rather unique approach to running DBCCs.  They can’t afford the performance overhead of running DBCC or backups on the primary replica (ServerA), so every night they run backups and DBCC on a secondary (asynchronous) replica in the same datacenter (ServerB).  On Saturday night during their regularly scheduled outage, they switch into synchronous, get the boxes in sync, and then fail over to ServerB.  Then they run on ServerB all week long, and run DBCCs on ServerA every night.  It’s more manual work, but the payoff is a blazing fast and safe primary node.  (And in case you’re wondering about lost transactions in async mode, they’ve thought about that too – when the server becomes mission-critical, they plan to add a ServerC instance acting as a synchronous replica as well.)

And no, I never thought I’d write that Paul Randal isn’t telling you to run DBCC often enough. ;-)

Brent Ozar

Brent specializes in performance tuning for SQL Server, VMware, and storage. He's one of the very few Microsoft Certified Masters of SQL Server, a published author, and a Microsoft MVP. He likes travel, Jeeps, Apple gear, jokes, and writing about himself in the third person. Read more and contact Brent.

More Posts - Website

Follow Me:
TwitterFacebookLinkedInGoogle PlusYouTube

Monday Guest Post: Phony Robbins on Power

Here at Brent Ozar PLF, we’re very open to alternative viewpoints on information technology. We’d like to help broaden your horizons and introduce you to new possibilities for your servers, so we’re introducing a new Monday series – the Celebrity Guest Post.

Our first guest is life coach Phony Robbins, an internationally renowned motivational speaker who’s written books, delivered sessions, and brought millions of people to the success they’ve always wanted.  With no further ado, I give you our first guest post.

What Great Admins Have in Common

Hi, I’m Phony Robbins.  I’ve studied some of the best admins around, and I’ve had the extraordinary privilege to ask them personal questions.  Why do you do what you do?  How do you help others get things done?  How do you accomplish so much at such little cost?  Where are the bodies buried?

I’ve noticed a thread that weaves all of them together.  The very best technology people like to listen.  No, not to people.  They can’t stand people.  They like listening to machines.

They jump at the excuse to walk into the datacenter and pretend like they’re fixing something, but watch what happens when they reboot a machine.  They don’t jump into another machine to check email.  They don’t update executives on status.  They just lean casually against a rack, with one hand on a server, but their relaxed demeanor hides their real work: they’re feeling the power.

Literally.

The best admins hear right away when a server reboots because the amount of power coursing through the server changes, the fans slow down, then they speed up again.  They feel the varying forces of air acting on the temperature of the datacenter and they know it all comes down to power.

Your Server is Part of the 99%

Well, that's one way to make the server faster.

The sheep, the masses, they believe power needs to be balanced – but that’s simply not true.  A balance of power means that you have some of the power, and someone else has the rest.  If you believe that, and if you let that happen to you, then you’re never going to become one of the 1%.  That’s what you want, isn’t it?  There’s nothing wrong with wanting the very best for you and your servers.  Those suckers at Occupy, they’re going about it wrong by trying to bring the 1% down to the rest of us.  We need to bring all of ourselves up to the 1% level.

Forget 99% or 1%.  Even forget 100% power – that’s not powerful enough for us.  We need more than 100% power.

You probably think that getting all of the power is hard, that it requires political work, that it requires convincing.  Nope.  The answer is inside you, right now.  Well, it’s not yet, but it’s about to be, because I’m going to empower you with the secret to powerful success.

You just have to believe.

No, not in yourself – you’re a loser.  You have to believe in CPU-Z.  It’s a completely free piece of software that tells you how fast your CPUs are supposed to go, and how little power you actually have.  Download the zip-no-installation version, extract it, and run it on your server.  Here’s what it’s going to look like:

CPU-Z Showing How You Suck

Read the “Specification” line about halfway down the screen – that’s how fast the manufacturer told you the processor would go.  In this case, it’s 2.66GHz.  Then read the Core Speed line at the bottom left – that’s how fast your processor is actually going.

Or rather, how slow your processor is going, because your server is lazy.  Your server hasn’t awoken the power within.  In this case, this server’s plugging along at just 1995.6 MHz.  1995 was great for a year, because it was the year my book broke a million sales per year and I bought my second wife her third Mercedes.  1995 is crappy for your server’s speed, because like Sammy Hagar said, he can’t drive 1995.

Awakening the Power Within Your Server

It’s time to turn things around and take control, and we know where that happens – the Control Panel.  Open it up, and go to Power, because that’s where the 1% are keeping things back from us.  Your server will say something weaselly like Power Saver or Balanced or Saving the Whales.  That’s not powerful.  Click High Performance, and that’s powerful.

Run CPU-Z again, and if you clicked that mouse like a boss, your screen will look more like this:

The Power of Power

The server above has a core speed of 3,168.5MHz, and the specification is only 2.93GHz (2,9300MHz).  This server isn’t part of the 99% or the 1% – this server is part of the 110%.  Isn’t that what you want, real power?  Sure, it comes at a cost of higher electrical bills that cost more money, but money isn’t a problem for the powerful, kiddo.

If it still doesn’t show at least the same speed as the Specification, your hardware guys might be holding you back, too.  Server BIOS settings can be configured to override the operating system and leave power saving – or as I like to call it, poverty-causing – enabled no matter what.  At your next scheduled outage (and by that I mean the next time you can get into the datacenter and pretend to trip over the power cord) you should change that back again.

Run CPU-Z today, activate the power within you, and stop letting the 99% and the 1% boss you around.  From this point forward, when developers or users come to you whining about why your servers are running slow, the answer isn’t your servers – it’s their weak and puny code.  After all, your server simply can’t get any more powerful.

Brent Ozar PLF Team

Brent Ozar PLF is a boutique consulting firm focused on understanding your environment and strategy. We partner with you to objectively identify pain points and develop solutions that align to your business goals. Your experience comes first; we share our knowledge and expertise to help you.

More Posts

Follow Me:
TwitterFacebookGoogle PlusYouTube