The Art of SQL Server Database Administration, Development, and Career Skills for the Technically Minded
Today was my first dress rehearsal presenting my PASS 2015 presentation to a living audience. I was fortunate enough to get an invite to 24 hours of PASS. My session along with all the other great content was recorded and will be available for free to anyone who logs on. You can also get the slide deck there. I’ll do my session again this weekend here at the Denver SQL Saturday.
It was an appropriate topic category, dealing with stress, in that I am really stressed out about speaking at PASS. This is the big time. I screw up there, I may never get another shot… ever. Too dramatic ?? Sorry, my inner DIVA came out.
One thing I know for sure is that the real deal is going to be a lot of fun. I’m much better interacting with a crowd that is all in the same room. Presenting in a webinar is hard for me – you can’t read the audience, and in the back of your mind your constantly thinking, they are all bored to tears. Plus, I’ll have prizes for the live audience and a challenge.
Script Libraries and Checklists
If you are squared away on those two items…, newflash: You don’t really need to sit through my presentation at all.
Two very popular topics were building a good script library and establishing checklists for your critical activities. Honestly, I’m not sure if there are two more effective ways at inoculating yourself against stressful situations then by having all the tasks necessary pre-organized into solid checklists and backed by vetted, peer reviewed scripts that you don’t have to type from memory.
To drive that home my presentation today included a demo where I had to hypothetically restore a production database back to a point in time via multiple log backups in under 5 minutes. Writing out TSQL by hand to restore each backup vs running a single script that does all the work for you is a great way to reserve mental resources for things you can’t pre-plan… because after all, if you are a production DBA, I can pretty much guarantee that at some point in your career, you will need to restore log backups under duress.
By the way, if you want the powershell script that I showed, the one that will restore all log backups in a folder in order of date, one by one to any database you specify. You can find that here:
Import-Module "sqlps" $logBackupFolder="f:\backups\log" ## your log folder $databaseName = "abacoswidgets" ## your database foreach ($logName in (Get-ChildItem $logBackupFolder | Where {$_.Extension -eq ".trn"} | Sort-Object CreationTime)) { $logBackupPath = $logName.FullName Invoke-SqlCmd -Query "restore database $databasename from disk='$logBackupPath' with norecovery;" }
As for checklists, a colleague of mine ( Josephine Bush @sqlskunk ) is starting a project right now to build checklists related to SQL Server tasks and share them with the SQL Community. Tasks such as building clusters, setting up AG groups, mirrors, log shipping etc. She only just started this project, so there isn’t anything on the site yet, but it will be coming soon to http://www.sqlchecklists.com. I’ll send out an announcement when it’s up.
Finally, we also talked about building good script libraries. The result was a really productive pow-wow on twitter regarding what people do to organize and make their script libraries accessible. In my next blog post, I’m going to tackle that topic. SQL Script Libraries, building, managing, maintaining, using, and sharing. I’m starting on that post tonight!! Pssst, it will contains words like GIT, TFS, Redgate, SSMS, and more!