Author: way0utwest

  • A Full Backup Includes Everything (with a caveat)

    Full database backups in SQL Server include all of the data, objects, tables, rows, functions, stored procedures, etc. If something is in the database when the data reading portion of the backup concludes, it’s in there.

    Note that “in there” means committed in a transaction.

    If someone tells you the backup missed a row, or a procedure, or something else, they’re almost always wrong. 99.9999% of the time they are wrong, and you should stand by that.

    The issue is that things must be committed in the backup. If they aren’t committed, they aren’t included. And that means that there’s a small chance that something added to the database while the backup is running isn’t in the backup.

    If you remember how backups work, there’s a data reading portion of the backup and a log writing portion of the backup. The log writing portion of the backup takes a physical amount of time. If someone were to finish a transaction during this time, the data or objects would not be in a restored database. This is because the transaction didn’t exist or wasn’t committed when the data reading portion of the backup completed.

    If the data writing portion of the backup takes a few minutes, and a change was in the last minute or so of the process, someone might think something completed before the timestamp on the backup file is included. It wouldn’t be.

    It’s a small chance, and it’s not likely to come down to this point, but it could happen. Can you figure out the transactionally consistent time of the backup? Perhaps, but I don’t know how. You’d need to get the time for the last LSN written in the backup and map that to a time. If you know how to do that, let me know.

    Make sure that your backups are transactionally consistent. Don’t export, don’t use open file managers, don’t use anything that doesn’t respect transactions. The native SQL Server backup process does this. If you want a few other features, my employer makes SQL Backup Pro, which also respects transactions.

  • Back to iOS from Android

    I pre-ordered a Samsung Galaxy S4 last spring, after listening to my wife talk about how much happier she was with an S3 than an iPhone 4. There were a few things I thought Android was doing better for smartphones and after spending some time in the store with various devices, I went with an S4.

    I had a bit of a learning curve, but the phone worked pretty well for me. After spending a bit of time with the S4, I wrote about some impressions of Android v iOS. These were based on the way I use the phone, and how the two mobile OSes worked for me. I dove in wholeheartedly, abandoning my iPhone 4S to a desk drawer and only using the S4. I didn’t even use my iPad much.

    However a few things were annoying me about Android. I’ll write about those, but it came to me one day as I was packing up my iPad to trade it in. Target was giving me $200 (an amazing deal) and my plan was to upgrade to a Nexus 7 or other small Android tablet. I primarily use the tablet while cooking for recipies or entertainment.  As I played with a few of them in various stores, I realized that I missed the ease and smooth operation of iOS. I decided to trade up for an iPad Mini instead of an Android and realized that I like iOS better.

    The original fine print I’d gotten from my carrier noted that I couldn’t switch devices on my account for 6 months with the S4, but the day after 6 months were up, I brought my fully charged iPhone 4S into a store and switched it back as the active device on my account.

    There was definitely an adjustment as I had to change the way I did a few things. After a couple weeks back on iOS, I still look for the “back” button at times, it’s a bit slower for some tasks, and the screen feels much smaller. Overall, however, I’m happier with the iOS device.

    I’m not implying that iOS is better than Android. That’s a highly subjective choice, but given the way I use my phone  (and tablet), I prefer iOS.

    These thoughts continue with these posts:

  • 2013 Tribal Awards

    We’re the #sqlfamily on Twitter, and often in person where we often get together for a #sqlrun in the morning and a bit of #sqlkaraoke at night. In some sense, we are a tribe within the larger technology community, focused on our common work with SQL Server. I thought the title for  was fantastic, bringing together new authors to share their knowledge, and raise money for a charity.

    At SQLServerCentral and Simple Talk, with the sponsorship of Red Gate Software, we decided to create some end of year awards in various categories, based on the community, not companies or products. We kick off our nominations today in a number of categories, including Advice that saved my bacon in 2013, Best Speaker, Best Outfit, and more. You can read more about the categories in today’s announcement.

    The idea is that the community can recognize others in the community with a nomination, and some supporting material that encourages others to nominate the same individual, and vote for the winner. The top five with the most nominations will get voted on over the holidays with awards presented in January.

    I hope you have fun with this, and think back to those people and events that stand out in your mind in 2013.  Nominate them, give a few reasons, and celebrate the help that each of us gives each other as a part of the SQL Server tribe.

    PS: we had a great #sqlski last year for SQL Saturday in Albuquerque and we’re doing it again this year. Feel free to join us at Taos on Friday, January 24th, right before SQL Saturday #271 in Albuquerque on Jan 25, 2014.

    Steve Jones

    Video and Audio versions

    Today’s podcast features music by Everyday Jones. No relation, but I stumbled on to them and really like the music. Support this great duo at www.everydayjones.com.

    Follow Steve Jones on Twitter to find links and database related items and announcements.
    Steve Jones Windows Media Video ( 15.2MB) feedMP4 iPod Video ( 18.5MB) feed

    MP3 Audio ( 3.7MB) feed

    Feeds are available at iTunes and Mevio

    To submit an article, rant or editorial,
    log in to the Contribution Center

  • The Future of Auditing

    I was reading Captain’s Share the other day and enjoying a quiet afternoon at home. It’s a science fiction book about one man’s journey in the future as a captain of a space freighter. It’s an interesting series from Nathan Lowell that I’ve enjoyed and recommended to other science fiction fans. In the book, there’s a scene where the main character is leaving his old ship as first mate and moving to a new ship as the captain. However he notes that the formal process is to deactivate his records on the old ship and ensuring they will be read only forever. The book notes they can’t be deleted because they are a part of the ship’s records, log entries, etc.

    That seems to be a far cry from the way auditing takes place in current computer systems. Auditing of systems is under the control of the sysadmins (who are sometimes hackers) and can be altered, changed, etc. We, as software designers, haven’t done a good job of ensuring the integrity and longevity of log records. In some sense, it seems to be a fundamental flaw in OS and software design to not have separated out the auditing and recording of actions from the administration and rights of the rest of the system.

    I’d hope that we would recognize that auditing actions and preserving this data is something that ought to be tightly linked to, but separate from, the rest of system operation. I’d like to think that fundamental changes and actions taken on the system should be written separately to an area that is easily marked as readable by non-sysadmins that are designated to review the information. I know we have the challenges of managing the space and the problems of spurious actions being generated to fill (or rollover) logs, but I’d think after 50+ years of computing we would have considered some sort of event log that isn’t under the control of the people whose actions it is recording.

    SQL Server has improved its auditing features and capabilities, but far too much is still linked invariably to the sysadmin, often the same person the auditing should be watching. This is certainly one area that I hope matures in future versions as the need grows to track and review actions taken by privileged accounts.

    Steve Jones

    Video and Audio versions

    Today’s podcast features music by Everyday Jones. No relation, but I stumbled on to them and really like the music. Support this great duo at www.everydayjones.com.

    Follow Steve Jones on Twitter to find links and database related items and announcements.
    Steve Jones Windows Media Video ( 19.5MB) feed

    MP4 iPod Video ( 23.7MB) feed

    MP3 Audio ( 4.6MB) feed

    Feeds are available at iTunes and Mevio

    To submit an article, rant or editorial,
    log in to the Contribution Center