The Alagad crew (well my team at least) is happily working with a client to help them create a next-generation product data management system. This is easily the largest and most complex system I’ve ever worked on. Yesterday I was breaking ground on the next and final major section of the application. I spent the previous days coming up with use cases, etc, and planning my approach to the architecture for this section. As a part of that I defined a set of SQL tables and I spent yesterday actually creating the tables. I tend to create tables in my local database and, once they’re finalized, I email scripts to our DBA who adds them to the “gold” copy of the database which is deployed to our client’s servers.
So, today, I’m working through some high-level code and I realize I need the latest copy of the database. So I grab the latest revision out of SVN and restore it over my local copy. (Anyone see where this is headed?) And get back to work. This is when I start getting weird errors about objects not existing. D’oh! I’d restored over my changes without first generating my scripts! The first thing I do is look for my SQL backups. (Yes, I run SQL backups of development databases.) But, for some unknown reason it seems like my SQL Agent has been shut off since August! So, needless to say, I had no backups of the database. So, after complaining to a co-worker and enabling SQL Agent, I was about to get back into recreating tables when I realized a couple things:
- SQL Server is running in VMWare.
- I’m on a Mac using Time Machine so I should be able to restore yesterday’s backup of the VM.
- I don’t need to restore yesterday’s backup! I have automatic snapshots enabled in VMWare!
To solve my dilemma all I had to was create a snapshop of the VM’s current state, roll back to the last snapshot, generate my scripts, roll forward and apply my scripts. Problem solved! I really love VMWare!