Author: way0utwest

  • Automate Migrations–T-SQL Tuesday #94

    tsqltuesdayIt’s T-SQL Tuesday time again, and I’m slightly pressed for time, which is sad. This is a great topic.

    Rob Sewell hosts this month with his question about what we are going to automate? He’s a PowerShell advocate, so I’m not surprised here. As much as I enjoy working in various languages, PoSh becomes more and more handy to me when I need to work outside of the SQL Server platform. I’ve been trying to play with it, and I enjoy it more and more.

    If you want to participate, check out the rules:

    1. Write a post on the topic below
    2. Schedule the post to go live on Tuesday, September 12th (between zero am and midnight, UTC)
    3. Include the TSQL Tuesday logo in the top of your post
    4. Link the post back to this one (it’s easier if you comment on this post and link it)
    5. Optional: Tweet a link to your post using the #tsql2sday hash tag on Twitter

    Automate Things Between Instances

    The first time I saw the dbatools project in action was at SQL Saturday Cambridge, where Chrissy Lemaire gave a session with Rob. I was surprised at the power and ease of the project. I was impressed, and decided to help learn more as well as promote the project. I’ve tried to blog regularly about their cmdlets as I get a chance to play with them and I’m pretty much always impressed.

    The next time you need to move some object, setting, job, etc. from one instance to another, you should try this:

    1. install the dbatools module
    2. look through the command index
    3. try migrating your object(s) with PoSh.

    That’s it.

    Maybe you need to copy a database or login. Maybe you want to copy jobs to a new server. The dbatools module makes all of these things easy.

    So give it a try. There are some great tools for migrations as well as wonderful items for common DBA tasks.

  • Final Thoughts

    I am a fan of Walt Mossberg. I have read his work and seen him interview many famous people in technology across the years. He has been quite an influential reviewer and commenter. If you haven’t ever read anything from him, I might recommend his view on Internet regulation or his thoughts on the Steve Jobs biopic , or even check out his gadget museum. You might even take a few minutes and read about The Taco Bell interview. It’s a pretty neat story.

    Mr. Mossberg recently wrote his last column. He’s retiring this year, and penned a look at some of the technology he’s experienced in his lifetime. Reading over the piece brought back some nostalgic moments for me as I think about how the world has changed. He also notes that early in his career he wrote this sentence: “Personal computers are just too hard to use, and it isn’t your fault “.  Now he says “Personal technology is usually pretty easy to use, and, if it’s not, it’s not your fault.”

    I agree with that, and one of the complaints I have with our industry. We haven’t done a great job of actually considering users and building software that’s not only intuitive and easy to use, but also gets easier over time. While I learned to appreciate the adaptation of some Office software that keeps the often used menu items displayed and remembers previous options I’ve used for features, I find this is the exception, not the rule. Our software is often in the face of the user, and I constantly bemoan the state of poorly written applications.

    As we’ve moved to larger displays, and smaller displays, using touch, speech, and other methods of interacting with computing devices, building newer devices that look nothing like the computer of the past or even the computers of recent years gone by, we haven’t necessarily made the computer fade into the background. The smartphone (and related car displays, tablets, etc.) have perhaps done one of the best jobs of integrating into our analog world, but the interfaces, displays, and certainly rendering of content overall has a long way to go. Plenty of that is our fault, we, the people who build applications.

    I wonder if we’ll reach Mr. Mossberg’s vision of having most of our computing infrastructure fading into the background. Certainly reducing the need for cords and remembering to charge things will help. I look forward to the day when I have multiple pads built into my desk, my kitchen, my car, and more to just charge my devices when I set them down, so I don’t need to think about power. I want connectivity to be just available, and I certainly want to be able to enlarge text easily, without zooming in and scrolling side to side as my eyes age.

    The world may get better applications and infrastructure, and hopefully much better security. I certainly think it’s possible, though not likely to be ubiquitous among all parts of the Internet. I doubt that for most of us choosing to work with technology as a career that we’ll see computing fade away. We’re too involved in the details, and hopefully excited by systems, to abstract ourselves too far away.

    Steve Jones

    The Voice of the DBA Podcast

    Listen to the MP3 Audio ( 4.6MB) podcast or subscribe to the feed at iTunes and Libsyn.

  • The Control Poll

    This editorial was originally published on May 17, 2013. It is being re-run as Steve is out of the office.

    I was reading about version control systems (VCS) recently, brushing up on some skills, and saw this quote in a thread:

    “There is no excuse for not using version control, even for a small project developed by single developer. Setting up local version control is beyond trivial, benefits huge. Any developer not knowing that cannot be considered good nor experienced.”

    That’s quite a pronouncement, and one that I believe is very true. No matter what type of development you engage in, I’d expect that you’d understand the benefits of using version control, and the dangers of not using it. It’s just like never backing up your system. I’d think that any developer that cares about their craft and is a professional has used version control. The really good ones will insist upon it.

    However I know that the decision to use a VCS is not always made by a developer. The company building the software might feel differently, and while I’ve always asked for a VCS, I have ended up with a series of folders on a share, named for dates, each containing a zip file of all our code at the end of that day. It was the bare minimum of version control I could live with, and fortunately we got by with just two people coordinating work. Any more than that and I’d insist on some type of VCS.

    This week, I wanted to ask how many of you voluntarily or involuntarily might be forced to do something similar.

    How many of you skip source control for certain apps?

    Even if you have source control for those large, multi-person teams, are there apps that you avoid putting into a VCS? What about your database code? I think it’s important that you keep all your code, whether for the front end application or database objects, in some type of Version Control system. If your boss won’t buy one, then check out Git or Subversion, both of which are open source and free.

    Let us know this week how you feel about source control and whether or not you decide the effort isn’t worthwhile for your projects.

  • DevOps Basics–Git Clients

    This is also a part of a basic series on git and how to use it.

    There are lots of git clients. If you look at the top list for this year, you’ll see quite a few. I’ve used a couple of these, but they all give you roughly the same information. Where am I in the commit tree, and what branches are out there. I tend to prefer the command line most times, but clients are handy to have.

    There are two main ones that I have been using, trading off and on between them, so a quick look at both Sourcetree and Gitkrakken.

    Sourcetree

    Sourcetree is a free client from Atlassian. They’re a software company, much like Redgate, that gives back to the community. One of the ways they do this is with Sourcetree and Bitbucket . This client is available for Windows and MacOS, so it’s cross platform.

    It’s simple and easy to setup, and the install isn’t worth covering. Amazing how simple most installs are these days. Once installed, you can open or create repositories easily.

    The interface is clean and easy to understand. All the main features (push, pull, commit, branch, etc.) are large buttons at the top. The graph, comments, and other information is in the middle.

    2017-08-25 11_36_24-SourceTree_1.9

    Below here are the staged and unstaged files in my repo, so I can easily see the state of my work.

    There are tabs for each repo, so if you open multiple ones, you’ll see them listed at the top and can easily switch between them. Handy if you need to work on multiple projects.

    Sourcetree will check for updates and let you know when they are available. As with most software, this will download the patch and then let you know that you need to close the app to start the install.

    2017-08-25 11_33_48-Found Updates for SourceTree

    After using other clients, I find this sometimes a bit slow, but usually commit/push time isn’t a large factor in work. I can start the process and go get coffee or take some break.

    I’d say Sourcetree is a nice client, and it’s easy to use. There’s also a nice button to pop open a Git Bash terminal, which is helpful if you want to work in a text format.

    Gitkraken

    I stumbled on this client somewhere. I think someone recommended it on Twitter, and I decided to give it a try. Sourcetree was working, but I was curious if there was something else.

    Gitkraken bills itself as the most popular client. It might be, but even if it’s not, I like some of the simplicity. This client is available for Windows, MacOS, and Linux, so you might prefer this if you move across all those platforms.

    It’s also cool to look at. The animation when it starts is neat.

    Others

    There are other clients, including some MS tools in Visual Studio (regular and code) that work with git. I don’t really use those, as I tend to work with the command line or simple interfaces for commits, not examining differences or looking at branches. For those tasks, I do like these two clients.

    Of course, at some point you may need to drop into the command line if you find yourself in a pickle. While I’m sure you’ll google most issues, be comfortable solving them in the command line and practice a few tasks periodically by typing the syntax.