Monthly Archives: January 2017

A Letter To A Younger Yates

deskphotoHello much younger Yates. Hope you’ve been doing well. Why don’t you pull up a chair and stay for a few minutes so we can talk and maybe help another data professional that is just starting out on his or her journey. Nah, it won’t take us a long time to get through our talk, but I think it is now prudent more than ever to share with you some of life’s journey’s you are about to embark on.

I know you are starting out as a developer and you won’t know where your career will take you at this point; you are just happy to have a job out of college and that’s okay. One thing I do want to iterate to you though, when you see variables in the code that reference the Gilligan’s Island characters it is not okay nor best practice to do such, and while we are on this topic please line your code up – the future you being a DBA will thank you; trust me.

Life is going to throw you some curveballs along the way, both professionally and personally. This is part of growing on both fronts; what you need to know is to learn from them and not to be afraid to make mistakes in either scenarios. You will fail; you need to accept that. However you need to take solace in the fact that if you fail it means you are trying and never be ashamed to own up to anything you do. Don’t try to hide mistakes; address them head on and remember that if you get knocked down nine times you get up ten. Hard work will eventually pay off and you can take those lessons learned and teach them to others who are coming up.

Explore all avenues of learning, you’ll eventually get to know a group of people called SQL Family. They aren’t a perfect bunch, but then again neither are you. It is there you will find new colleagues, friends, mentors and heck you may even find yourself helping run user groups and help plan a SQL Saturday – – bet you didn’t ever believe that would happen would you?

You’ve come along way from the basketball courts where you poured your heart and soul into being the best you could be. Your dreams may have come up short in your mind but oh my friend you couldn’t be more wrong. The lessons and injuries you learned from that time were molding and making you into the data professional you will become. The discipline you had then will still apply even more so later on. That coach that entrusted you with the rock at the end of the game will again be the same in business. As you become a database administrator who will eventually lead and serve alongside a group of dedicated professionals in which you will find again the ball in your court. Attack it the same way with hard work and dedication; don’t ever let anyone tell you that you can’t do something….remember when someone did that to you – – you ended up with a triple double.

There will be naysayers and there will be harsh critics – – this is life. I wish I could tell you the world will stop for you and you can hop on. That’s not the case; you’ll find yourself having a great family which in turn will teach you more lessons. You’ll learn that you’ll have a new hero in your life in a son who has Type 1 diabetes. In him you’ll find how resilient a kid can be and realize that you will have nothing to complain about. Sure you’ll lose a step as you get a bit older, but what that kid goes through on a daily basis you’ll never have to endure, at least not as of today. You will have the roughest day and you will go home and see smiling faces. When you step out of that car make sure you touch the tree as you walk by to hang up all the work related activities – – you won’t get that for a very long time but when that light bulb goes off you’ll know what I’m talking about. As you left basketball on the court; you in turn will need to leave work at work sometimes. It will be hard…trust me on this ~ your family will need you.

When you get older I ask that you reflect on where you came from and realize how thankful and blessed you are. Investing in others like others have invested in you will be a key component in your future. Don’t let corporate politics detour your outlook that you started with. A passion to grow and also a passion for helping others grow.

As we end our conversation today remember one thing. You’ll never know what other people are going through. Your family, your team, your colleagues, or other data professionals. Win each day and make a difference in someone’s life. Set goals and dreams and never let anyone tell you that you can’t achieve them. If they do use that as the fire to motivate you to do the extraordinary. Be thankful for your mentors both professionally and personally and don’t ever be scared to use the words “Thank You” and “Sorry”. Those aren’t a sign of weakness.

Be humble yet assertive and when you give your word on something you follow through on it. You will have no idea how much communication will come into play – you got this younger Yates – Let’s Roll

**To the young data professional out there**

You may think you are all alone and in a big ocean swimming helplessly around. I want to assure you that you are and were not alone. Each day is a learning day and the lessons you learn along the way will be your story. You are the CEO of your career – – take charge of it. There will be others that come and go in your life professionally; I implore you to build a good base of about 5 data professionals that you can learn from and model your techniques after – – the best of the best if you will. At the end of the day you be the best you and when you get to your future self; take time to give thanks and reflect back on where you came from.

Thanks,

Older Yates

Advertisements

Backup/Restore–What’s My Status?

WaitingThe day begins and you find yourself going through a list in your mind of things that need to be accomplished. You either make a mental note, jot it down on paper, or input notes into your mobile device. The day is getting off to a great start; you feel as though you have a sense of direction and purpose before you even open up shop for the day. It is then the phone rings or you get alerted to trouble; issues on the horizon.

The issue at hand requires a backup or restore to be completed and you find yourself dependent on the mercy of SQL processing the request. We’ve all been there; phone rings again and it is someone on the other line asking you:

  1. Are we done yet?
  2. What’s the status?
  3. How much longer will this take?

These are all legitimate questions that you will be asked, and it’s okay. Pressure situations are opportunities to make it happen. Over the years data professionals have built out their own script and document libraries. I’ve carried scripts around for years, one script I like to utilize regarding backups and restores is below. I have some variations to this script with what it pulls back, but the standard script hits the sys.dm_exec_requests  DMV.

SELECT  r.session_id ,
r.command ,
CONVERT(NUMERIC(6, 2), r.percent_complete) AS [Percent Complete] ,
CONVERT(VARCHAR(20), DATEADD(ms, r.estimated_completion_time,
GETDATE()), 20) AS [ETA Completion Time] ,
CONVERT(NUMERIC(10, 2), r.total_elapsed_time / 1000.0 / 60.0) AS [Elapsed Min] ,
CONVERT(NUMERIC(10, 2), r.estimated_completion_time / 1000.0 / 60.0) AS [ETA Min] ,
CONVERT(NUMERIC(10, 2), r.estimated_completion_time / 1000.0 / 60.0
/ 60.0) AS [ETA Hours] ,
CONVERT(VARCHAR(1000), ( SELECT SUBSTRING(text,
r.statement_start_offset / 2,
CASE WHEN r.statement_end_offset = -1
THEN 1000
ELSE ( r.statement_end_offset
– r.statement_start_offset )
/ 2
END)
FROM   sys.dm_exec_sql_text(sql_handle)
))
FROM    sys.dm_exec_requests r
WHERE   command IN ( ‘RESTORE DATABASE’, ‘BACKUP DATABASE’ );

By checking only for the restore and backup command lines you will be able to quickly identify your session id and get an  approximate ETA and percentage complete. you can tinker of course with the estimations if you’d like or pull back more fields. This is just a simple technique in utilizing a helpful DMV to provide info quickly.


Additional information

Aaron Bertrand (b|t) wrote a post several years ago around sys.dm_exec_requests that has good information in it that you can find here.

You can find the MSDN listing for sys.dm_exec_requests here.

What are DMV’s?

DMV’s are Dynamic Management Views within SQL that can help with a myriad of troubleshooting, performance tuning, and overall health of a system. You can find all the categories for DMV’s and learn more about them here.

Wrapping Up

I’ve been on both sides of the fence in the past where third-party tools are not always possible to have. These DMV’s can be life savers in certain situations; you can parachute in and parachute out gathering knowledge on any given situation. I urge you to explore and learn new things that may help you in your future.

**DISCLAIMER – Do not take code blindly from the internet because you found it on a blog and execute it without first testing it yourself.**

5 Characteristics Every Leader Should Practice

leadershipTodayThe word leadership has many synonyms attributed to it. Something that can be learned early on in one’s career is that having a leader you can trust is very important. Trust is something that is earned; not given. As I reflect over the years I’ve noticed mistakes that have been made along the way; mistakes that have often been learning experiences for myself to hopefully improve areas that need improving.

Below are characteristics that, in my opinion, make up a good leader, but the list is not an exclusive set. No, in fact there are many more that won’t be listed. This post is just to get your thought process flowing and maybe spark some interest in areas that you (the data professional) might not have thought of before.

Communication

This topic in and of itself could have its own dedicated blog post. This is something that many data professionals have a hard time with – myself included at times. The art of communication is a key component in a data professionals tool belt; many only think of a tool belt that consists of technical utilities. I am of the opinion that one should add necessary skill sets such as communication in their every day repertoire for it is in this we get to interact with people on a daily basis.

  • Team based communication
  • Client based communication
  • Business unit based communication
  • Meeting based communication

Communication is all around us; it is how we interact. Are we one who people like to come to with problems? Perhaps people shy away from us because we constantly tell them how wrong they are? Whatever the case may be there are gaps in communication and this characteristic is something that will always have to be worked on daily.

Humility

Whether you lead a team or you are a sole data professional doing your thing there will be times we all need a dose of humility. I can honestly say, personally, that our team I’m on would not be where it is today without everyone included. I’m going to just say this here to get it out-of-the-way; there will always be something that someone else knows that you don’t. That’s okay; it is part of our journey we call gaining knowledge. What I’ve seen over the years that sets data professionals apart from one another are a few things:

  • Thirst for learning and gaining knowledge
  • When a mistake is made; own up to it. Learn from it and move on
  • Do not play the I’m right, you’re wrong game
  • Rest in the fact that albeit how smart one is; you can always learn

Some of my best mentors have been ones that are constantly asking “What can I do to help you” instead of  “That is wrong and here is what you have to do”. You cannot be afraid to fail; for in times of failure you can gain great knowledge. A fear of failure will cause you to not be innovative.

When my time with my group has gone there will be one thing I hope they can glean from me; do not be afraid to try new and innovative ways to accomplish resolutions.

Responsible

Responsibility is a key component to any data professional. I was brought up in life that if you give your word than you better follow through. This doesn’t mean that bumps or obstacles in the journey will not crop up. I’m here to tell you they will; it is then when that first characteristic pops up and you communicate out to the necessary parties with updates on what is going on. Transparency is key and goes hand in hand with responsibility.

As I sit back and I look at any company, heck even consultants, for that matter – the most successful ones are ones that you can rely on and people deem the “go to” people. That’s great Chris, but how to I get there? Responsibility is something you have to show day in and day out. It falls in line with communication and you have to work on it daily. Once you become responsible you will begin to garner trust. Once you have trust then you can begin bridging gaps between teams, groups, clients, and much more.

PASSion

For those that know me they know that I have a strong passion for what I do. I fall into the category of loving the work that I do on a daily basis and also have a passion for SQL Community. If you have a passion for what you do it will show and be a reflection of your work. To me I don’t have a job but a lifestyle; granted there are days that aren’t so rosy, but when we signed on to be data professionals we knew there would be late nights and sometimes exhausting issues. End of the day though do you enjoy what you do? Is it a passion?

One thing I think that has been beneficial to me is seeing the passion in team members. Being in a group, such as the one I am in now, we all drive and push each other to be a better data professional; having a passion for something doesn’t just mean having one from a technical perspective. It can be with your family, your hobbies, or your career. Whatever the case may be; find that fire from within and let it drive you to become as successful as you can be. Once you have passion you can become infectious and it takes just one to make a difference. Will you be that one?

Decisiveness

There will come a time when every leader will have to make the call. This is something that trips a lot of people up; I will tell you as I am typing this that I have made some good calls and I have made some not so good calls through the years. Any good leader will show the ability to make a decision; and once you make that decision you live with it. You don’t go and point the fingers at someone else because when we do one should look at how many point back at us.

Set up some time throughout the week and look at the decisions you made. You don’t need to be a manager over a group to do this; see what were the good ones and what were the bad ones. Learn from them; if there are gaps then look for patterns. What could you have done differently?

If you lead the team you are on then you are the responsible party. Make the decision and then own it; even if you’re not the one performing the action to get the job done – you are the coach so to speak and the buck stops with you.

Conclusion

These are just a few characteristics that make up a good leader. Believe me this is only scratching the surface and I hope to dive into more; end of the day a good leader should be able to look at the day and say they gave it their all. Leave 110% on the court and you had nothing left to give – this isn’t always easy, but then again being a leader is not always easy.

Another set of 5 characteristics I’ll touch on in another blog post will be:

  • Love your team
  • Give praise
  • Cast your vision
  • Surround yourself with a solid work force
  • Big egos can lead to demise of a team (including leaders)

Get after it and make it happen. You and you alone are the CEO of your career. Change is possible; you just have to be willing to make it happen.

Why Use Red Gate’s SQL Multi Script?

Someone once told me at the shop that we have plenty of software utilities laying around that could be very useful that no one is utilizing. I got to thinking about that from a DBA standpoint; we are fortunate enough to have the Tool Belt from Red Gate and with that comes a plethora of utilities such as SQL Data Generator, SQL Document Manager, SQL Compare, SQL Data Compare, and the list could go on (full listing).

One of those said utilities is a little gem called SQL Multi Script. For me I have found this utility most useful. First of all I’m a heavy SQL Compare (why use SQL Compare) user. We utilize it here in the shop daily for the most part and I like the ease of how to call all of Red Gate’s apps from one location:

By clicking on the icon in top left you will be presented with a list of utilities in your tool belt (pending on your licenses and I’m using version 12.1)

RedGateIcon

As you can see the SQL Multi Script utility is the last on my drop down menu:

RedGateIcon2

The Why?

So, now that we’ve established how easy it is to call the utilities from any said location within the product line; exactly what does multi script mean for me? Glad you asked; I’m going to try to take you on a journey inside a utility while painting an example of how to use to tool in a real life example.

When you first come into the utility you will see a screen similar to the one below:

RedGateIcon3

What I like about the utility is the ease and flow of the product. It didn’t take long to get up and running with it. If you notice on the left hand side you have the option of adding existing or new scripts to the template. In my case for releases this allows us to save multiple schema changes for various databases and incorporate them into one setting for a quick review and execution. One thing that I have ran across, that is no fault to the utility, is static data scripts that may need to be run in a certain order, but that is up to me to put in the correct order of execution once I get the scripts into multi script. I will show an example below of what multiple scripts look like within the utility.

On the right hand side you will see  a distribution list. By clicking on configure you can set up a list of servers that you normally deploy or execute to in one location. One thing to keep in mind is to execute the scripts according to which server (databases) you select. Be cognizant of which ones you are selecting within the utility.

Example of adding existing scripts:

RedGateIcon4

Example of configuration set up:

RedGateIcon5

At the far right you can see I have a test distribution list set up. This affords me the ability to add servers from the list on the left or I can add any SQL server into my listing. From there I can pull down exact databases on that server to execute scripts against. For this purpose I’ll pick a couple of databases from the local server for review:

RedGateIcon6

I have two scripts I want to execute against two databases on my local. I can execute both scripts if I want at the same time or I can execute one script at a time. I also have the ability to select only one database I want to run the scripts against or I can select both databases to run the script against (think of syntax and proper use of database names if you go this route in the script). This is just flexible functionality in which the utility presents.

Back to my case at hand; since we deploy to multiple servers against multiple databases also think about the big picture. I can include databases from all over the enterprise environment if needed and let the Multi Script utility control when to run what, where, and in what order. If you look closely you will notice a blue arrow pointing down in the “Scripts to Execute” section. This arrow, along with the up error next to it, allows me to move my scripts up and down in the order I want to. So I can add all the scripts I want at one time and then come back through and organize them when I am ready.

The Results

Now, after the script execution is complete you can review the results in the lower window pane of the Multi Script utility. Will look similar to results window below:

MultiScriptResults

A feature I like is the ability to save multiple script executions in different formats on work that was completed; this comes in handy when supplying back a summary report of what was changed to a:

  • Change Management Team
  • QA Team
  • Dev Team

MultiScriptSaveResults

Said All That To Say This

There are various utilities available to us that we may not even have explored yet. This little utility by Red Gate has come in real handy for myself and my team. Take the time to look at what is available to you and see what may fit your needs. This concept does not just pertain to Red Gate utilities. Look at various things in your everyday routine and ask yourself:

  1. What can I utilize to become more efficient?
  2. Why am I not utilizing the utility?
  3. Is there a lack of knowledge?
  4. Where are my gaps that I can improve on and how do I get there?
  5. Is there a utility out there where I won’t have to reinvent the wheel?

Look for the hidden gems and continue to provide “Leadership Through Service”

Hold The Fort

stressHave you ever heard the phrase “Hold The Fort”? Long ago in battle supply routes were targeted by enemy regiments that would cut off rations to fighting units. As the battle ensued the enemy had driven back their counterparts to a small area on a hill. They were being overwhelmed with many wounded and dying; that is until in the distance they noticed reinforcements were on the way.

How many times have you, as a data professional, been stuck wondering the same thing? Battered, worn down, and flat-out exhausted until you look and see reinforcements on the horizon. Sure, we’ve all been there, but to some it is a question of how do I call in re-enforcement’s or how do I even go about sending out a help signal? Below are some various ways you can tackle problems:

Forums

There are several forums out there that can provide some great insights into similar issues that you may be experiencing. To a certain extent I think forums are a great avenue to explore potential solutions. With that said however you cannot take every answer verbatim. There can be some off the wall answers out there that shouldn’t be followed. It is important to test anything you find on the web regardless of who it comes from.

You can find some of the forums I frequently attend here.

#sqlhelp

One thing that I’ve learned about the community is the willingness to help each other out. Remember above when I stated “Hold the fort, and reinforcements are on the way”; this is a good twitter hashtag to be familiar with. Professionals from all over the world take this seriously and it is not to be mistreated on how it is utilized. I have received great assistance in the past on issues I’ve been stuck with.

Phone a friend

We all have our “go to group” we bounce ideas off of. Sometimes it is helpful to bounce ideas off of another data professional. You may surprise yourself and actually start talking through your problem and come to an answer you may not have arrived to had you not initiated the conversation.

Old Fashion Testing

As a data professional you cannot be afraid to get your hands dirty. Prove your theories and test the scenarios as you run across them. One should be doing this anyway, but in doing so a wealth of knowledge gained is at your fingertips. We stop learning when we stop trying; just because you encounter one failure doesn’t mean you stop. You keep fighting and beating down that door until you make it through the other side. How bad do you want it?

Is It A Vendor Product?

I have the opportunity to work with a plethora of vendors. Maybe your issue revolves around a vendor product and you are not able to make any changes. Great, this happens all the time to data professionals. Some questions I’ll throw out there are:

  1. Have you opened a dialogue with the vendor about the issue?
  2. Have you documented the issue; not just call and say I have a problem?
  3. Have you tried to reproduce the error?
  4. It it already a known bug?
  5. Is it something that we can address internally before we talk with the vendor?

I’ve worked with a couple great vendors in Red Gate and SentryOne over the years. As a data professional I’ve seen vendors (not all) take pride in a quick response time. If there is an issue with a product they will want to take care of it in a swift manner or provide feedback as to why, when, and what to expect.

Internal Resources

I’m going to say this here, and it may shock some of you. No one knows everything; there may be some who elude or perpetuate appearances that they know everything there is to know,  but that is not the case. Whether you are in a shop or maybe a consultant (who can tap into their contact base) there are internal methods to maybe approach a different business unit or tech unit on an issue to get an outside perspective. Sometimes a fresh set of eyes goes a long way.

Technical Blogs

There are many great technical blogs out there; I have listed some in my DBA Blogs section to the right of this page. Each person is different and has their own go to Blog for review. I receive questions all the time from readers and other data professionals; being respectful is key but I have not seen one data professional out there who would not extend a helping hand if presented in a respectful manner. DO NOT TAKE this as one will provide an answer. We may show you how to connect the dots, but it is important one takes the necessary steps to get to the answer on their own. Nothing is given….work hard for it.

User Groups

Maybe your issue is not a hot ticket item and it can wait to a user group meeting. These are great places to bring up questions and issues in a local environment with some pretty stellar professionals. I guarantee that if you ask a question and no one knows the answer then someone will do their best to find out that answer and further the discussion. An example of a user group can be found here.

PASS Summit

Perhaps your issue is ongoing and you are at the PASS Summit. Great, besides being at a conference with over 6k of our closest friends I would take advantage of the SQLCat and AzureCat Team’s hours. It is a great way to tell Microsoft of your issues and get advice from some of the top-tier people in our industry.

Conclusion

I don’t know what your situation is or will be. Obstacles will come from all angles this year; it is up to us on how we deal with them. I would be amiss if I sat here and didn’t tell you that it won’t always be easy. Nothing in life is easy; some days you will have to work and grind your way through until you get to an answer for an issue. In the end though, when you do find that answer (and you will) you will be able to learn from it and move on. It is part of a data professionals journey.

Keep fighting and keep working toward your end goals. Never stop learning; never stop gaining knowledge.