This week, Brent, Tara, Erik, and Richie discuss replicating TRUNCATE TABLE command between nodes, how to cope with social isolation that comes with working from home, database shrinking, how to improve log wait times, how to figure out the mac stop and threshold cost setting for servers, and laziest methods to deploy objects and run scripts.
Here’s the video on YouTube:
You can register to attendnextweek’s Office Hours , or subscribe to our podcast to listen on the go.
If you prefer to listen to the audio:![[Video] Office Hours 2016/12/07 (With Transcriptions)](http://www.codesec.net/app_attach/201612/14/20161214_419_511082_0.png!web)
Podcast: Play in new window | Download
Enjoy the Podcast?Don’t miss an episode, subscribe via iTunes , Stitcher or RSS .
Leave us a review in iTunes
Office Hours Webcast 2016-12-07 How do you convince the SAN admin that there’s problems?Brent Ozar: Michella asks, “How do you convince a storage administrator that the database is having IO issues?”
Richie Rump: Chainsaw.
Tara Kizer: It’s a tall order. I’ve worked at large companies with large DBA teams and large SAN teams and talking with them about IO issues can be challenging because in their monitoring tools, they’re not seeing the IO issues that we’re seeing on the server. So they point the finger back at the server, at windows, at SQL. We point the finger back at them. It can take a lot of tools to figure out where the actual issue is. Now the one problem I have with the monitoring tools that the SAN teams use is that they are averaged over a minute. So they’re not seeing the heavy spikes that we might be seeing because maybe it’s fine 45 seconds for each minute but that 15 seconds is where we’re being hammered and because it’s getting averaged out, they won’t see it. One thing, I’ve worked a lot with SAN teams as well as Microsoft to figure out where the issue is. You can open up a case with Microsoft for help in determining if it’s an issue on a server or somewhere outside the server. They use, it’s an ETW trace that they can help you with and they can interpret it. It will tell you, is the problem on your server or external to it. Now, if it’s external to it, you might have to get other people involved besides SAN teams. You might have to put some kind of―I forget what they’re called―but they can put some packet captures on there to see where the problem is because it could be fiber, could be a lot of different places.
Erik Darling: I would run CrystalDiskMark and I would show the SAN team the results I get from that. We have a blogpost on our site, if you just search for brentozar.com for CrystalDiskMark or diskspd, you’ll get some primers on a couple different ways to test your storage out. Now I would actually turn your question around and ask you why you think you have a storage problem. Then I would ask you to meet your SAN team in the middle on the connections to the SAN because that’s usually what the problem is. The SAN is usually cruising along, the SQL Server is usually cruising along, but you usually have a really crappy either single connection or like not a very good double connection to the SAN from the server. That’s what I would do there.
Brent Ozar: We also have a request for a shout out to Rich Hansel. So there you go, Rich. Howdy. Oh, wow. The hotel housekeeping staff said to send you the house shout out. I said, “Yep, you’re doing a much better job cleaning the room.” That’s totally not true.
Should I worry about trace waits?Brent Ozar: Next question. “I am seeing trace write waits among my top wait stats. Should I be concerned about trace write waits?”
Erik Darling: Not really. I would only be concerned if I had like double the trace time waits as up time, because that might mean that a couple people are running traces. But if my trace write time to my up time is kind of one-to-one, I’m not that concerned. It usually means that there’s a monitoring tool or something else keeping an eye on your server, or it’s kind of one of those like benign waits that’s not really going to do much.
Do we still need maintenance plans with SSDs?Brent Ozar: Man, Troy has a great question. I think we’re all going to like chiming in on this one. He says, “Our network engineers are replacing our spinning disk storage with solid state. Our vendor says with solid state we don’t need maintenance plans. Can I really get rid of my maintenance plans?”
Tara Kizer: I’m not sure what they mean by maintenance plans. Are they referring to the actual maintenance plans that SQL Server is providing or they’re referring to something else? Because I don’t know how disks are going to determine if you’re using maintenance plans or not. Regardless of my storage, I’m using Ola Hallengren solution for instance or some custom solution and I just stay away from maintenance plans regardless.
Erik Darling: We like to say that index fragmentation doesn’t matter anyway, so no matter what kind of drives you’re on, who cares. But don’t get rid of all your maintenance plans because some of them might be taking backups.
Tara Kizer: Oh, you’re saying that they’re probably referring to the index maintenance.
Erik Darling: Maybe, I don’t know.
Tara Kizer: So is the question if they can get rid of the index maintenance plan? Or maybe, you can still use a custom solution. So I’m not sure what exactly they’re saying.
Brent Ozar: I hope it’s not that they’re talking about getting rid of backups. That would be bad, or CHECKDB.
Does Metallica’s new album rock?Brent Ozar: Next comment is, “Metallica’s new album rocks if you care.”
Tara Kizer: I do care. Metallica used to be my favorite band.
Brent Ozar: As long as I can still hear the Black Album, that’s all I really care about because I could keep hearing that forever.
Richie Rump: Jay Z’s Black Album ? Or…?
Brent Ozar: Anyone who has a black album, I’m into it.
Richie Rump: I’m listening to The Hamilton Mixtape right now, so I’m not paying attention to you guys, so, sorry.
Brent Ozar: I believe it. I would sing songs off of there but I haven’t gotten that one yet.
What happens when I truncate a table in an AG?Brent Ozar: Next up, Vladimir asks, “What happens when I do a TRUNCATE TABLE with Always On Availability Groups? How does the TRUNCATE TABLE command get replicated between nodes?”
Tara Kizer: It’s still a logged transaction, it just deallocates the pages, I think. So you’ll still get the truncate on all your replicas.
Brent Ozar: And it’s quick, it’s still quick.
Erik Darling: Well, faster than a delete anyway, usually.
Brent Ozar: Yes.
Should I add more memory incrementally or all at once? Brent Ozar: Ryan asks, “When I add more RAM to the database server, like fr




