Tag: T-SQL Tuesday

  • T-SQL Tuesday #51 – Place Your Bets

    tsqltuesdayIt’s T-SQL Tuesday time again and Jason Brimhall is hosting this month’s event. He used to live in Las Vegas, and with that theme in mind, he calls for you to Place Your Bets.  That’s a time when someone has gambled, or risked something on an application, venture, process that relates to SQL Server? When have you done something that caused an issue you could have avoided?

    It’s an interesting topic, and I’m looking forward to reading what people write.

    T-SQL Tuesday is a monthly event, the second Tuesday of the month, started by Adam Machanic (blog|twitter). You can participate by setting up a blog and writing on the month’s topic. Check Twitter for the #tsql2sday hash tag or look for the blog postings with a search.

    If you want to host, contact Adam.

    The Big Bet

    I didn’t place this bet, but a bunch of application designers and management did. I came in to the company late, and realized we had issues, but wasn’t able to effect change in any short order.

    I worked for a large software company. Large as in thousands of employees, and certainly hundreds of developers. Most were engaged in writing the software we sold, but there were plenty of people engaged in managing our internal systems and writing software that we were using internally. One of these was our internal Intranet site for employees.

    This was a large project, replacing a number of applications, and designed to be a central point of information where employees could turn and various departments could publish information. Being a software company, we knew that it’s worth paying for software that’s written and we chose a framework that would cover many of our needs, but allow us to customize parts of the site for use by different departments. All in all, a CMS-type system that would fit our needs.

    The project started before I did, and no one consulted me or my group, as the production DBAs, as to the architecture, hardware spec, or anything else. It’s not that we should have, or would have, led the way, but we could have offered opinions about how things might perform.

    The day of the roll out came. I was told which day it was and never participated in any testing. The global policy was changed to set everyone’s default browser to the intranet, and I came into work expecting to find a new site where I’d see information posted, resulting in (I hoped) less emails from various departments. Not long after I arrived, I was pulled out of a meeting because of performance problems.

    I had no idea what to look at on the site, but we found CPU pegged and very high I/O on the server. I decided to run a short Profiler trace from my machine to get an idea of what the workload was and what we might look to run. I found fairly simple queries, lots of SELECT * to a few tables. What was interesting was that the queries were scrolling rather quickly on the screen. I found that the default trace values in SQL Server 2000 were storing around 25MB/sec worth of data on my local hard drive.

    In 2001, this was a fairly large load on a SQL Server 2000 instance. When we checked the tables and calculated result sets, we found very little data from each query. There were missing indexes, but even adding those to tables that were a few hundred rows of data didn’t help. The problem was simply that so many employees, each hitting the server by default, with a series of sidebars on the web pages, each of which created its own connection, ran its own query, and ran lots of them on each page, was simply overloading the hardware.

    If was bad design, poorly tested, and not well thought through. Even simple caching mechanisms as Brent Ozar has talked about would have dramatically removed a lot of the load. In the end, those weren’t really needed. What we found was that the majority of the information being returned by queries changed less than once a week. A few weeks of development time removed most of those queries and had them replaced with static XML files that were loaded by the application for display, and could be updated from the database by an administrator.

    Ultimately the site worked well, and we did get less emails from various departments since announcements could be made on the Intranet, which most of us learned to check once or twice a day.

  • T-SQL Tuesday #50–Automation

    tsqltuesdayI missed last month and I was a bit sad, but I was traveling the week before and speaking, and then was on vacation. No time to write a post, and it was a tough topic from Robert Davis. However I’m back this month, and I’m thrilled to participate in topic #50.

    This month’s topic comes from @sqlchow who gives us the topic of automation. How would we do it? What would we do? What tools? It’s a great topic.

    This is part of the monthly blog party, started by Adam Machanic. To participate, grab the logo above, write a post on the 2nd Tuesday of the month, and link to the invitation (from @sqlchow this week). If you want to host, contact Adam (blog|twitter).

    Automation

    I’m going to tackle the topic of tools, since I’ve been working on the Powershell Challenge.

    I’ve used lots of tools for automation in my career. I started with DOS and batch files professionally, which were easy for me after a few years of Korn shell and C shell working on Sun OS in college. The idea of scripting in a batch file made perfect sense, so much so that I had alias batch files for various Unix commands, like ls, ps, etc. that I used often. We even had 411.bat on our network, that would grep a text file of our internal phonebook to return extensions.

    As I moved to SQL Server, I found myself frustrated with some of the limitations that SQL had, especially while working with files. Batch files weren’t great, and a full C++ or VB program was too heavyweight. I eventually moved to VBScript, and learned to love the FileSystemObject. I had tried Perl briefly, but abandoned it because getting ActivePerl installed on all machines was too much of a hassle.

    However I’ve started to move to PowerShell (PoSh) and I am starting to really like the idea of quick modules and cmdlets written in the language. It has a lot of the piping and simplicity of Perl, but the power of working with objects. It’s also quick to write scripts. While I find it cumbersome for now, that’s me, not the language.

    These days, if I needed to automate something in SQL Server, I think I’d really look hard at PoSh if I needed to work outside of an instance. Meaning access the host system, work with files, or connect to multiple instances.

    Inside once instance, I still love T-SQL scripting where I can use it.

    One further note, scheduling is an important part of automation. While there are some good enterprise level schedulers, they aren’t always available. That’s why I tend to use the SQL Agent to do lots of scheduling for me. It’s more reliable than the Windows scheduler built into all Windows hosts, and provides some notification capabilities.

    More importantly, I can query the status of my automated tasks.

  • T-SQL Tuesday #48–Cloud Atlas

    tsqltuesdayI never saw the movie, though it’s on my list to watch sometime. I love the Wachowski’s as directors.

    This month Jorge Segarra is hosting. He is better known as the SQLChicken, and his theme this month is Cloud Atlas. He’s asking us to write about the cloud and what we think of it. What’s our take on the cloud. He wants to know if we’ve used it, what we think, probably how we even define it. It’s a great question with all the media and hype about the cloud, especially for data professionals.

    This is a monthly blog party, where bloggers write on a specific topic every month, on the second Tuesday. I’ve got a complete list of topics on this blog, and to participate, do this:

    • write a blog
    • publish it on the Tuesday, November 12, 2013 (for this month)
    • be sure a trackback or comment is on Jorge’s blog invitation
    • include the T-SQL Tuesday logo, linked to the invitation.

    That’s it. Write, and enjoy.

    The Cloud Atlas

    What is the cloud? It’s been hyped in commercials and numerous articles, and to some extent I think we don’t have a good definition. We have PaaS, IaaS, and SaaS, all of which are legitimately the “cloud” for different people.

    As far as I’m concerned, the cloud really is any computing service that is provided by a vendor. This means you don’t own the hardware and rent out either a machine (physical or virtual), a service, a set of APIs, etc. This exclude co-location, but anything else from renting a VM to using IFTTT, is cloud computing.

    With that in mind, what do I think? There are certainly problems with the cloud in terms of security and recovery of data. However I think the promise of renting out computing resources (machines/platform/software/services) in a scalable fashion is amazing to me.

    Do I use the cloud? Sure. I have Evernote, Skydrive and Dropbox to keep my data in sync. My family uses OurGroceries to manage a shopping list. We daughter is hooked on Spotify, which alleviates the need to keep much music on her device. I even have backups of data on Glacier.

    On the career side, we (SQLServerCentral and Red Gate) offer AdventureWorks on Azure for users to play with. I’ve done minor work in Azure, and spun up a SQL instance on AWS. I haven’t actually done anything more than test, personally, but certainly the cloud is useful for SQLServerCentral. We host our database server and web server on virtual machines we rent from Rackspace. We use a Content Delivery Network for some videos and YouTube for others. We’ve dramatically lowered costs and increased scale with the cloud.

    The cloud works.

    Sometimes.

    For some applications.

  • T-SQL Tuesday #47 – SWAG

    tsqltuesday.jpgIt’s T-SQL Tuesday time, the second Tuesday of the month when we all coordinate our blog posts on a particular topic. This month Kendal Van Dyke has invited us to take a break from technical topics and have a bit more fun. This month’s topic is asking about the swag that you’ve gotten from an event. This seems appropriate given that there are so many events this time of year. In addition to the tremendous number of SQL Saturdays, we had DevConnections last week, SQL in the City this week, the PASS Summit next week, and SQL Intersection next week.

    This happens every month, and if you want to participate, look for the invitation on twitter with the #tsql2sday hashtag. If you want to host, contact Adam Machanic.

    The Best SWAG

    I’ve been fortunate to attend many events in my career. I’ve been to TechEd, the PDC, SQL Connections, SQL Intersection, the PASS Summit, various TechFests, lots of SQL Saturdays, and, of course, Red Gate’s SQL in the City events. I don’t often get swag these days, but earlier in my career I would grab various gifts and goodies from the events and vendors. I’d often bring back items for co-workers and my kids, some of which I actually still have.

    These days I don’t get much swag, though I do get speaker gifts from some places, which feel like swag to me. What are the best items? I’m not sure that I can pick just one, but I have a few things that stand out.

    Multi-tools

    20131004_102054

    During the WIT panel at SQL Saturday #222, SIOS sponsored a gift to take back to kids, boys or girls. It was a multi-tool and I grabbed two, one for each of my kids. I even checked my bag (which I never do) so I could bring the small knives to my son and daughter. They loved them, putting them in bags to use when they might need them. I saw my son actually break this out a week later to use the pliers.

    Wine

    20130917_12371420130917_123704

    The speaker gift from SQL Saturday #222 in Sacramento this year was a bottle of wine. I thought that was a great gift, and one that’s still sitting in our wine rack, but probably not for too much longer 🙂

    Beer Mugs

    20131004_102125

    A few years ago the crew from SQL Sentry gave away silicone beer mugs at the SQL Connections conference. I loved the insulated mug for cold beverages, and so did my kids. I found after a week that I never got to drink from them because my kids were filling them with smoothies, juices, and more. The mugs were always in the dishwasher. I mentioned this to Peter Shire and he graciously gave me 4 more at the next event. That hasn’t stopped my kids from using them at every opportunity, but with 5, I do get to use a few of them now and then.

    The Keychain

    I’ve gotten a few, and some of them are very nice, but the one that stands out for me was from the SQL Saturday #169 in Denver. The local user group made their own parachute cord keychains that I still have on a backpack. It’s similar to a survival bracelet, the kind of things that Boy Scouts carry, just in case. I love the keychain and while I hope I never have to use it, I have it if I need it.

    Lots of Gifts

    There are plenty of other things I’ve gotten that have survived. I have bags and shirts from many events. I have pens, USB drives, a couple keychains, and even a few bottle openers. I’m sure I’ve forgotten some of the other items, though to be fair, there were lots of forgettable items.

    It’s hard to give out good swag. At SQLServerCentral, we’ve struggled to think of what things people would like. I’ve given away lots of shirts and books since I’ve felt people will keep those around and hopefully have fond memories of the events. I know I do when I use some of the items that I’ve gotten.