Category: Blog

  • The Stairway to Deployment

    logoNext week I travel to Sacramento, CA for the SQL in the City Seminar – Stairway to Deployment on Friday, July 26, 2013. It’s a half day event where Grant Fritchey and I will look to lead you through the idea of implementing continuous integration and continuous deployment for databases (as well as other code).

    I have the first two talks to get you started: Team-based Version Control and Automated Build and Test. Grant will cover the Best Practices for Database Deployment and we’ll finish with a Q&A and a happy hour on us.

    We still have space, so register today if you can make it. The event is being held at the Courtyard Marriott Sacramento Midtown in The Orchid Room (4422 Y St, Sacramento, CA 95817) from 12:30-6:00pm.

    We will use some of the Red Gate tools to show you how to accomplish the tasks, but you don’t need them. The tools make the process easier, and that’s the job of our development and software tools, but really the important things to understand are the idea of automating your processes, integrating testing, and having a workflow that is constantly used, but doesn’t slow down your development process.

    Hope to see some of you there.

    Register today.

  • Disable the Charms Bar – Making Windows 8 Better

    One of the things that’s bothered me is the way the charms bar frequent popping out as my mouse moves to the upper or lower right. I do this as I’m trying to reach the “x” to close a window or adjust time zones. The bar pops out and it’s annoying.

    I initially searched for a way to stop this, but didn’t find one. However I must not have searched correctly as I found an article recently that shows how to do this.

    It’s a registry hack, so hit the Start menu and type “regedt32” and hit enter. Nothing returns in search, but it runs. Follow the instructions, and the charms bar won’t appear as you move your mouse around.

  • SQL Server Needs Tempdb

    I saw a post recently where someone noted they had moved tempdb like this:

    USE master; GO ALTER DATABASE tempdb MODIFY FILE (NAME = tempdev, FILENAME = 'c:\tempdb.mdf'); GO ALTER DATABASE tempdb MODIFY FILE (NAME = templog, FILENAME = 'c:\templog.ldf')

    This gives you the message the tempdb has been moved, and it will take effect on restart. If you restart, however, you’ll often find the service doesn’t restart and you get a “network error” when you try to connect. This is because the service is down.

    If you check the error log, you might see this:

    2013-07-05 13:20:48.65 spid9s      Clearing tempdb database.

    2013-07-05 13:20:48.65 spid9s      Error: 5123, Severity: 16, State: 1.

    2013-07-05 13:20:48.65 spid9s      CREATE FILE encountered operating system error 5(Access is denied.) while attempting to open or create the physical file ‘c:\tempdb.mdf’.

    2013-07-05 13:20:48.65 spid9s      Error: 17204, Severity: 16, State: 1.

    2013-07-05 13:20:48.65 spid9s      FCB::Open failed: Could not open file c:\tempdb.mdf for file number 1.  OS error: 2(The system cannot find the file specified.).

    2013-07-05 13:20:48.65 spid9s      Error: 5120, Severity: 16, State: 101.

    2013-07-05 13:20:48.65 spid9s      Unable to open the physical file "c:\tempdb.mdf". Operating system error 2: "2(The system cannot find the file specified.)".

    2013-07-05 13:20:48.65 spid9s      Error: 1802, Severity: 16, State: 4.

    2013-07-05 13:20:48.65 spid9s      CREATE DATABASE failed. Some file names listed could not be created. Check related errors.

    You might also see an operating system error 5 (access is denied) if the files exist. In all likelihood, the problem is security for your service account. The SQL Server service account shouldn’t have rights to all folders and files on the system. If it does, you’re doing something wrong.

    I had thought (incorrectly) that SQL might start, but be in a read-only state without tempdb. However Gail Shaw pointed out this was incorrect, and when I tested this, she was right. SQL Server won’t start.

    What can you do?

    A few options here.

    • The brute force approach
    • The more elegant approach

    The more elegant approach is specified in Books Online, in Move System Databases. In the failure recovery procedure, you start SQL Server with Trace Flag 3608, issue the alter commands, and then restart the instance without the trace flag.

    The brute force approach, which I have tested, is to move the tempdb files to this location (they didn’t exist in my situation). You’ll need admin permissions to do this. You can then change the service account to one with permissions to see the files (like an admin), and restart the instance. From there, connect, and issue the ALTER DATABASE commands as shown above, with the correct path.

    If you need help configuring permissions, use this article.

  • Two Weeks until SQL Saturday #222 in Sacramento

    It’s just two weeks until my next trip. It feels like I just got back from London, and one again I’m prepping to leave again. This is my only trip in July, which I appreciate. It’s been a busy year so far, with lots of travel for me and I am glad to have a little downtime.

    This trip is a mix of vacation and work. I’ll be heading out early as Red Gate has a mini-SQL in the City event on Friday. We’re trying to get customers to come, but if there is space next week, I’ll send out a registration link. I speak Saturday and then head back to San Francisco. My daughter is joining me on this trip, with the chance to tour the NoCal area for the first time. She was actually here with me when she was 1, but didn’t remember that trip.

    I’m presenting my talk on searching binary data, which I’ve done a few times in the last year. This one will be a look at how you get information out of office documents from within SQL Server. It’s a neat feature for the product, and I’d like to hear how people are using it. Let me know if you are, or if I convince you to try it.

    I’ve also got a joint presentation with Grant Fritchey on A Day in the Life of a DBA, showing the common problems you face and a few ways Red Gate can make your job easier.

    I’m looking forward to a Sun/Mon/Tue vacation, getting some time off and recharging before I have a busy fall with the US SQL in the City tour.