background preloader

SQL

Facebook Twitter

Get Index Fragmentation Percentage for all Tables in SQL Server Database - Code Samples & Tutorials. Index Defrag Script, v4.1 « SQL Fool. It’s been quite some time since my last index defrag script update. A big part of the reason for that is because I wanted to implement many of the suggestions I’ve received, but I just haven’t had the time. I still have those changes planned, but I’m not sure quite when I’ll get to it.

Rather than continue to wait for a major release, I’m releasing a small update to my defrag that will take care of the most common complaints I receive. Change Log: Bug fix for databases containing spaces or special charactersSupport for case-sensitive databasesRe-executable CREATE script (for those who want to re-run the whole script)Comma-delimited list of databases is now supported for the @database parameter Feature List: Defrag a single database, a list of databases, or all databases (@database)Time Limitations: stop defragging after the specified amount of time has elapsed (@timeLimit). I often receive the same questions about this script, so allow me to answer them here:

SQL Server 2005 and 2008 - Backup, Integrity Check and Index Optimization. SQL Server Book Reviews for DBAs. There’s a ton of SQL Server books out there to help get you started on the road to becoming a database administrator. I’m going to start at the start of your career, and go forward. My Favorite Non-SQL Server Books These books aren’t specific to DBAs, but are things I’ve found really helpful in my career: Getting Things Done Getting Things Done by David Allen Do you get nervous at the thought of opening your email in-box because there’s so much piled up, and you don’t know where to begin? Do you struggle with to-do lists and project management software?

David Allen’s book Getting Things Done has been the answer for me and for a few of the folks I work with. I showed my current manager into the GTD philosophy, and he caught on right away. You can buy the paperback on Amazon, and there’s also a Kindle version. Time Management for Systems Administrators by Thomas Limoncelli You can buy the paperback on Amazon, and there’s also a Kindle version. The Whuffie Factor by Tara Hunt. Rankings | SQLRockstar. Free Training Videos and Tutorials.

We speak at SQL Server user groups and live events, and we record presentations and post them here whenever possible. Every Tuesday at 11:30AM Central, we run a free webcast covering SQL Server, virtualization, storage, and more. If you can attend live and ask questions, that’s great! You can register for our upcoming webcasts, and add a recurring calendar reminder so you can make it each week. If you have to miss a webcast, we post recordings to the blog each week.

Want to automatically get new videos and set up easy viewing on your tablet or phone? Pop some popcorn and turn down the lights…. SQL Server Performance Tuning Tutorials SQL on SSDs: Hot and Crazy Love – Brent Ozar talks about the attractions and perils of super fast storageDevelopers, Performance, and the SQL Server Transaction Log – Kendra Little talks about how application patterns impact performance of the transaction logDBA Darwin Awards: Index Edition - Brent Ozar shows you common mis-steps people make with indexes.

SQL Server Backup Options and Commands tutorial and example. Selecting the SQL Server database recovery model to ensure proper backups. ProblemOne of the first things that should be done when managing SQL Server is to setup an appropriate backup plan in order to minimize any data loss in the event of a failure. Along with setting up a backup plan there are certain database configurations that need to be setup to ensure you are able to backup databases correctly. In this tip we will look at the different recovery models that SQL Server offers and how to choose a recovery model for your database.

SolutionFor SQL Server 2000 and 2005, Microsoft offers three different recovery models for your databases. Each database on your server can be setup differently and you also have the ability to change the recovery model as needed, so this choice is not permanent. The three recovery models are: SimpleThe simple recovery model does what it implies, it gives you a simple backup that can be used to replace your entire database in the event of a failure or if you have the need to restore your database to another server. Next Steps.