It has been over a year since I have blogged, I know… that’s a long time! I have not retired, but rather focused on other parts of my life and career and I hope to get back to blogging. One of my major focuses for the last year was a new course on SQL Server 2016 in Arabic, a training course that’s almost 15 hours long. The team at MySkill4Afrika (Microsoft) and the Microsoft Virtual Academy have helped in the production of this course and I want to thank them for their tremendous efforts.
Previously, two courses were launched one for SQL 2012 and one for SQL 2014 BI via my personal YouTube Channel. With more than 150,000 views and more than 500,000 minutes watched we decided that it was worthwhile to start investing in a new course; hence the development for this latest series.
Just so you understand, all of the recording was done in Microsoft’s Technology Center in Malvern, PA (just outside of Philadelphia). The content editing was done by myself as I am the only person with both the technical and linguistic knowledge in the group. The rest of the editing/formatting/cleaning up, etc was done by our team in South Africa. The supervision was under our team in Egypt. The final walk-through was done by my brother, a SQL PFE also working for Microsoft. It was truly a worldwide effort and I’m proud to present it to the SQL Community.
I had this problem where I needed to gather Transaction Log information on multiple databases and check for valuable statistics on them. Running the command [DBCC Loginfo] brings back a number of rows for each Virtual Log File (VLF) in your Log File. It is really hard to do anything useful with that information on a larger scale. Each row returned gives you an estimate for the number of VLFs per Log File. Sure you could use the internal (and hidden) system stored procedure sp_msforeachdb to get the information for all database but it looks horrible. Here try it out for yourself before you read the rest of the post:
So why not make it better? That’s what I thought to myself, and I have recently been playing with storing DBCC command output to tables for analysis. I’ve put some together some code that allows you to capture the output of DBCC LogInfo into a Temp Table and then get some interesting information about the number of VLFs per database and other valuable information; see the comments for more information. Just by storing some of this data temporarily, I was able to write queries against it and discovered a major inconsistency in the size of my VLFs in a Log File that could potentially cause performance issues.
Feel free to create a permanent table for this data and run it on a regular basis to get an understanding of what your system is doing for troubleshooting. I also commented out the date field since I deemed it unnecessary, but if you’re looking for trending it maybe a good option to have that additional data.
الزملاء الأعزاء من العالم!
السلام عليكم و رحمه الله و بركاته
أقدم لكم دورة تمهيدية شاملة في SQL Server 2014 BI. وتقدم هذه الدورة التدريبية باللغة العربية، وتهدف إلى المساعدة فى التقديم للمفاهيم الأساسية للمهنيين المتخصصين فى قواعد البيانات عامه وبخاصه SQL Server BI في محاولة متواضعه منى لنشر هذه المعرفة والعلم بين اخوانى الناطقين باللغه العربية.
تهدف هذة الدورة التدريبية الى تلبيه فضول واثاره اهتمام المتخصصين فى مجال SQL Server BI وعلى وجه الخصوص BI Developers كما ان هذة الدورة مبسطه الشرح خاصة فى الدروس الاولى لكى يسهل على المبتدئين فى مجال SQL Server BI متابعتها واضعا فى اعتبارى انه لا يوجد الا القليل من المواد فى هذا المجال باللغة العربية. فقررت بعون الله وتوفيقه ان ايسر هذا العلم بين ايديكم لعل الله ينفع به احد من اخوانى و اخواتى فى اي مكان فى العالم. اسال الله عز وجل ان تنال هذه الدروس اعجاب الجميع و خاصه المهتمين بمجال SQL Server BI ارجو من جميع الأخوة والأخوات ان يذكرونى فى صالح دعائهم
و لاتترددوا فى مراسلتى و ابداء ارائكم و مقترحاتكم البناءة لتطوير هذا العمل الخيرى باءذن الله تعالى
أخوكم
أيمن الغزالى
3/2015 فى واشنطن- الولايات المتحدة الأمريكية
Dear Colleagues of the Database World!
I present to you a comprehensive introductory course in SQL Server
2014 BI. This course is presented in the Arabic language, and is
intended to introduce core concepts to Database Professionals that are
trying to acquire knowledge in SQL Server BI. The course is geared
towards those that aspire to become BI Developers, or those just
interesting in learning the basics of SQL Server BI. Since there is very
little material in Arabic, I decided to try to use my skills to bridge
the knowledge gap for my SQL Family that communicates in Arabic. I
hope you enjoy the classes and please feel free to share and leave
constructive feedback.
Thank you and good luck future SQL Server Professionals world wide!
Special thanks to my friends Mohamed Elsharkawy for his help and support with this production.
Finally the arrival of Part 3 of my SQL Snack Pack on Performance Tuning! The series is dedicated to help beginners understand how to start performance tuning with SQL Server. The first video was about performing a baseline using the PAL tool.I would highly recommend you review that video as well as my SQL Snack on Instant File Initialization. Also, if you missed part two from yesterday you can review it here.
If you are still interested in learning more about Performance tuning with SQL Server, I will be giving an hour long presentation with the PASS DBA Fundamentals Virtual Chapter on January 6, 2015 (11 am Central Time/Noon Eastern Time). For more information please visit http://dbafundamentals.sqlpass.org/ and join PASS for a great way to learn more about SQL Server.
Finally the arrival of Part 2 of my SQL Snack Pack on Performance Tuning! The series is dedicated to help beginners understand how to start performance tuning with SQL Server. The first video was about performing a baseline using the PAL tool.I would highly recommend you review that video as well as my SQL Snack on Instant File Initialization. This second video discusses the importance of properly sizing Data files, placement, and how the Proportional Fill-Algorithm works for data insertion. I’m hoping you get some last minute Performance tuning in before 2015 and so I will be posting the third video within the next 24 hours.
Welcome to Part 1 of my SQL Snack Pack on Performance Tuning! The series is dedicated to help beginners understand how to start performance tuning with SQL Server. This first video describes how to setup a baseline for your system using the PAL tools. It is essential to get a baseline before you start performance tuning so that you can determine how effective the efforts done in trying to tune your SQL Server have been. The PAL tools at first look a little intimidating but they are really very easy to use and extremely helpful for performance analysis. Enjoy and happy baselining!
A special thanks to Edgardo Valdez for showing me the how to use this tool.
Welcome back for part 3 of my SQL Snack Pack on Table Partitioning! If you have not watched the first two videos, I would highly encourage you to do so.
I hope you’re hungry for another SQL Snack! In fact, this will be one of a series of snacks (dare I call it a SQL Snack pack?). Table partitioning is a fantastic feature that is easy to learn and can significantly improve your OLTP and Data-warehouse environments. It can be a little intimidating because it is tricky to get started with, but once you get the basics down you’ll realize it’s pretty straight forward and a very useful feature to have. I will be providing the code and outline for each of the SQL Snacks related to table partitioning so that you have a chance to practice on your own. Happy partitioning!
This is a special edition for SQL Snacks. It is one (of many hopefully) SQL Snacks that has been recorded with the intention of fulfilling a request by a SQL community member looking to learn more about SQL Server. It is straight forward, very basic, beginner level information about Joins with a few examples.
Instant File Initialization (IFI) is an interesting topic with regards to how SQL Server works with storage. It is an easy feature to turn on and can improve the performance of your server; specifically with creation and growth of data files including TempDB rebuilds with SQL Server restarts. There is a slight security risk where a professional data thief could potentially recover bits of data that have not been over written since IFI was turned on, but the chances of that happening are slim. Plus, if they have physical access to the hard drives on your server, you will have bigger problems to fix.
So without further ado here is the next delicious SQL Snack for Instant File Initialization:
There are many features/options we sometimes overlook and then wonder later what went wrong. The COPY_ONLY option with backups is one that I felt is important to highlight to SQL Server DBAs. This backup is independent backup that is not part of the regular cycled backups that you perform; hint if you’re not performing regular backups please get up and schedule them NOW! Sorry for yelling 🙂
Using this option when doing backups allows you to take backups that do not interfere with your regularly scheduled backups in order to move them off to a QA, Development, or Staging area where you can test against that database or fix bugs without interrupting your production environment. Many times, I have seen that off-cycle backups are taken which become part of the backup set and then are deleted. This can cause negative consequences when doing restores as I will demonstrate in today’s SQL Snack:
Code is provided below if you would like to test it yourself. Please watch the video in order to understand how to test this yourself:
In December 2013 I presented at a SQL Saturday event in Washington DC. My presentation was about Backup and Recovery Fundamentals which I had done before for the PASS DBA Fundamentals Virtual Chapter. This time around, I decided to add a Tail Log (Active Log) Backup and Recovery demo to enhance my Presentation. The presentation went quite well, and so I’ve decided to put a short video together to demonstrate how to do a Tail Log Backup and Recovery.
***Make sure you change the backup, database, and log file paths to match your configuration***
To snack lovers every where now you can consume SQL Learning the same way, in Snack Size! Introducing the new way to snack with 0 calories intake, a simple solution to your learning cravings and available 24/7 from the click of a button!
Late last year I introduced my YouTube Channel with a short video on Hyper-V followed by a 10 hour series of teaching SQL Server in Arabic. This year, I hope to continue with those projects and in addition to that add to my newest delicious invention, the SQL Snack. The idea of this video series is to provide short videos to teach SQL Server content; and other technologies relevant to SQL Professionals on a daily basis. This allows for people to grab a snack and enjoy a short learning experience instead of having to sit down for a long drawn out lecture. Real snack is optional and not provided by me… sorry!
Below is the SQLSnacks Playlist you can also access it at the top menu by hovering over “Videos” and selecting it.
Please enjoy and please feel free to suggest topics you would like to see in the comments and I will try to do my best to accommodate your requests.
Today I will be reviewing the product ApexSQL Log which is a tool designed for Transaction Log discovery and recovery.
The team at ApexSQL were very friendly and offered me lots of support and help in using the product. I opted to do everything myself just to see how easy it is to learn and use the product. It took me about 30 minutes to get fully acquainted with it; although I’m not an expert now I know my way around the product very well. It’s always great to have a product with an easy to use interface that does not have a steep learning curve.
الزملاء الأعزاء من العالم!
السلام عليكم و رحمه الله و بركاته
أقدم لكم دورة تمهيدية شاملة في SQL Server 2012. وتقدم هذه الدورة التدريبية باللغة العربية، وتهدف إلى المساعدة فى التقديم للمفاهيم الأساسية للمهنيين المتخصصين فى قواعد البيانات عامه وبخاصه SQL Server في محاولة متواضعه منى لنشر هذه المعرفة والعلم بين اخوانى الناطقين باللغه العربية.
تهدف هذة الدورة التدريبية الى تلبيه فضول واثاره اهتمام المتخصصين فى مجال SQL Server وعلى وجه الخصوص DBAs و كذلك Developers كما ان هذة الدورة مبسطه الشرح خاصة فى الدروس الاولى لكى يسهل على المبتدئين فى مجال SQL Server متابعتها واضعا فى اعتبارى انه لا يوجد الا القليل من المواد فى هذا المجال باللغة العربية. فقررت بعون الله وتوفيقه ان ايسر هذا العلم بين ايديكم لعل الله ينفع به احد من اخوانى و اخواتى فى اي مكان فى العالم. اسال الله عز وجل ان تنال هذه الدروس اعجاب الجميع و خاصه المهتمين بمجال SQL Server ارجو من جميع الأخوة والأخوات ان يذكرونى فى صالح دعائهم
و لاتترددوا فى مراسلتى و ابداء ارائكم و مقترحاتكم البناءة لتطوير هذا العمل الخيرى باءذن الله تعالى
أخوكم
أيمن الغزالى
ديسمبر2013 فى واشنطن- الولايات المتحدة الأمريكية
Dear Colleagues of the Database World!
I present to you a comprehensive introductory course in SQL Server
2012. This course is presented in the Arabic language, and is
intended to introduce core concepts to Database Professionals that are
trying to acquire knowledge in SQL Server. The course is geared
towards those that aspire to become DBAs, Developers, or those just
interesting in learning the basics of SQL Server. Since there is very
little material in Arabic, I decided to try to use my skills to bridge
the knowledge gap for my SQL Family that communicates in Arabic. I
hope you enjoy the classes and please feel free to share and leave
constructive feedback.
Thank you and good luck future SQL Server Professionals world wide!
Special thanks to my friends Mohamed Elsharkawy, Jihad Abouhatab and my brother Islam El-Ghazali for their help and support with this production.
That’s right, it’s time to take this blog up a notch! Last week I posted a video about using Hyper-V on Windows 8 to design your own SQL Lab. I’m starting to like the whole concept of adding video to my blog. If a picture is worth 1000 words so a video at 30fps should be about 30,000 words per second. Well I guess you can’t do the math like that but it was worth a try! Now you don’t have to just read my posts anymore, you can enjoy the sound of my voice speaking geek at you while clicking all over the screen to show you how things are done.
So how do I get to this YouTube channel you speak of? Here is the link https://www.youtube.com/TheSQLPro or you can just click on the top navigation menu where it says “Video.”
There isn’t much up on the channel yet but later this month I will be releasing a very special video series. No hints, that’s all I’m saying. This is just the start with hopefully a lot more quality content to come in 2014.
A huge thanks to all my blog readers/supports/subscribers for their support and feedback over the last 18 months. This is blog post #60 and I just wanted to say thanks for being the driving force that keeps me blogging!
Alright, I’ve got your attention. You’re probably thinking “who is this crazy guy that is using the word Love with Windows 8 in the same sentence?” Honestly though, I have not had many problems with Windows 8 and I’ve been happy running it for a long time. I’m actually disappointed that I don’t have Windows 8 at my job, so I can only use it at home. It has been extremely beneficial for me for my SQL Server related work. Why? And why am I stalling to answer your question? And why am I going to change the subject to Hyper-V?
If you’re still reading, then great, you’ve got the patience for what is coming next. Windows 8 Pro includes a Hyper Visor in it (Hyper-V to be exact). I’m not talking about software to connect to virtual environments, I’m talking about an actual Hyper Visor that allows you to create and manage virtual machines. Once you enable the option you’re ready to go after a restart, it’s that simple.
So what does this have to do with me as a SQL Server Professional? Well, how else are you going to build your own lab environment at home or at work where you can play around, build and break things, and be your own domain admin (warning: power may go to your head on that last one). It’s all part of your life long learning journey and your drive to become a better SQL Server Professional and get the latest and greatest version on your machine to test out without ruining your OS. It so happens that I’m a nice guy, and I’ll show you how to get your environment setup and how to create “templates” for future VMs with this Hyper-V Tricks for the SQL Professional Video I put together.
Are you ready to push SQL Server to it’s limits, test things you’ve never tested before, build and break environments without losing your job? If the answer is yes then this video is for you! When you’re done with this video make sure you check out my Virtual SQL Server Lab with Clustering post to enhance your own Virtual playground.
PowerShell Scripts mentioned in video (Remember to rename your VM if you like and to change the paths to match your setup):