Author: way0utwest

  • Administrative Native and ConEmu Command Prompts–#SQLNewBlogger

    Another post for me that is simple and hopefully serves as an example for people trying to get blogging as #SQLNewBloggers.

    I would think many people know how to do this, but I’ve run into a few, so here you go.

    There are times you need to run elevated commands on a machine as an administrator. I’ve had to run various apps, as well as command utilities in this way, so I’ve learned how. I’ll give you two ways to get admin command prompts running.

    Cmd.exe

    This is the command prompt most people on Windows use. You can hit the Windows key and type cmd, and you’ll see this:

    2016-12-09 12_53_21-Installation

    On Win 7 or earlier, you’d get something along these lines.

    2016-12-09 12_55_01-Win7x64 SQL 2012 Demo - VMware Workstation

    In either case, if you hit Enter, you’ll get this:

    2016-12-09 12_55_47-Win7x64 SQL 2012 Demo - VMware Workstation

    A command line where you can type DOS style commands. Many of you might not use this much, but you should. The more you know about doing things from the command line, the more efficient and effective you’ll be. Plus you’re well on your way to being comfortable in DevOps type environments.

    This isn’t a privileged command prompt, and certain things won’t work here. To get an administrative level prompt, do this. First, after typing “cmd” don’t hit enter. Instead, right click the icon. You’ll see this:

    cmd_a

    Or this:

    2016-12-09 12_57_30-Win7x64 SQL 2012 Demo - VMware Workstation

    In both of these, there is a “Run as administrator” option. You want that. Once you do, you’ll need to accept the UAC prompt to allow an administrative level command prompt to open.

    ConEmu

    I have switched to ConEmu. I think it’s a much better console, and it’s handy. I get it with Chocolatey, and then it’s just a hot key away. What’s more, I can easily open multiple command windows. For example, I’ve got two open, but I can open a third, administrative level one, but right clicking allows me to restart my prompt.

    2016-12-09 13_02_09-cmd

    When I do that, I need to acknowledge the UAC prompt, but then I’ll have an admin level prompt.

    SQLNewBlogger

    These quick, handy tips showcase your continuous learning and improvement. As well as help you remember cool things like this.

  • Data Preservation

    This editorial was originally published on Dec 3, 2013. It is being re-run as Steve is on holiday.

    Maintaining data across time isn’t something many of us think about. We work with data in the here and now, and in the database world, we typically only need to recover or restore data from a short window. Like most of you, I would usually plan on recovering data that’s only a few days old. Being forced to restore a database from two weeks on any of my systems would make me cringe. It certainly would be embarrassing for me personally if it were my fault I couldn’t restore to a point in time that was more recent than that.

    In planning to recover our systems, we typically know the versions of software we have to recover from, and we can easily re-download copies of SQL Server or the patches we need. Most of us are dealing with SQL Server 2000 or later, which is good since those are the only versions still documented on MSDN. If you need SQL Server 7.0 or SQL Server v6.5 documentation, I hope you have copies.  The same goes for the media. You can still download SQL Server v6.5, and SP5, but if you needed SP3, it isn’t easily available. I ran into that situation about 10 years ago, and we had to make a special request through our TAP manager to get someone in Redmond to dig up a copy.

    In some ways it might not be important to worry about long term storage. Most of us will end up transferring our data to newer systems (and formats) over time. As we upgrade SQL Server, our databases move along to newer formats, or we abandon them because they are no longer needed. That’s fine for some data, but not all.

    Long term archival and storage is a challenge, as you can see in this short look at how old films are maintained. It just touches the edges of what’s being done, and doesn’t address costs. Plenty of old films have been lost forever, and perhaps that doesn’t matter, but it does concern me. I have thousands, maybe tens of thousands of digital images. While I love the ease with which I can share them with family, and make extra copies, I am worried that perhaps the lack of a physical copy means my great-grandchildren will struggle to find evidence of my generation if there is a catastrophe or storage formats change.

    This is one area of our industry in which we have a lot of maturing to do, and I hope that we can come up with some new ideas for maintaining our data for the long term, across not months or years, but decades or centuries.

    Steve Jones

  • Provisioning

    This editorial was originally published on May 24, 2013. It is being re-run as Steve is on holiday.

    At a talk recently, the presenter talked about the time lag for an on-premises server to be installed and configured to be on the order of months. Not that many, but it could easily be six months.

    That seems crazy, but in many companies I’ve worked in, that wasn’t an unusual time frame. From the time someone decided that a purchase was allowed, it could be days for the accounting department to approve the funds. A day or two to place an order, assuming that IT had already provided the specifications. Vendors respond quickly, but it could still take a week or two, possibly even more, for a server to arrive at our company.

    One of the advantages of cloud computing services is that new virtual machines can be bought and enabled in minutes. That might be true, but I wanted to ask many of you if you know how longs it actually takes for you to begin working on a new SQL Server.

    How long does it take to provision a new server?

    Imagine that you were to ask for a database server today, and you management agreed to grant the approval, think about how long would it be before you could sign into a SQL Server. I’m sure some of you have virtual infrastructures available, and that should reduce the time it takes, but let us know if that’s your setup and how long it takes.

    The ultimate service would be a cloud like application inside your organization that allowed you to select a SQL Server template, and send you a server name and login with minutes after an automated build took place. I don’t know many companies that have that yet, but I think many of us would appreciate that capability. Especially if we could choose the hardware we required.

    Steve Jones

     

  • Quick Command Shells–#SQLNewBlogger

    Another post for me that is simple and hopefully serves as an example for people trying to get blogging as #SQLNewBloggers.

    This isn’t a SQL post, per se, but since I’ve been using lots of PowerShell for SQL stuff at times, this is a handy trick I picked up.

    I was reading the announcement on the Windows Insider build 14971, which will have a few new things. One of these is the default command shell won’t be cmd.exe any longer. It will be PowerShell.

    Buried in the announcement was a tip I’d never heard. I don’t have any real cmd additions to my Windows machines, so to get to a particular folder in a command shell, I usually do lots of “cd”s or I right click in the address bar, and copy the path. Thankfully Windows 10 lets me paste this easily into a command prompt.

    2016-11-21 16_21_20-EndtoEndEncryptionwithSQL2016

    There’s another way.

    I can click the address bar and type “cmd”.

    2016-11-21 16_21_47-EndtoEndEncryptionwithSQL2016

    When I do this, I get a new command prompt at that location, as shown here. I do install ConEmu on my machines, so that’s where the prompt opens.

    2016-11-21 16_21_55-cmd

    That’s super handy.

    We’ll see how may workflow changes when PoSh is the default shell, but I’m looking forward to it.

    #SQLNewBlogger

    The quick tips that help me work more efficiently are what I’m writing in these posts. Here’s one that took my 5 minutes, and you can write this kind of post as well. Show off what you know, do, and have learned.