Something I Sometimes Wish SQL Server Did…

I was looking into a MySQL security issue today and realized that the ability to limit rights not only by user but also by host could come in handy.  Such that you could have it so some accounts might have some specific system rights or role memberships only if they were connected directly to the server for example might come in handy.

MySQL can do this and dealing with it today (it was preventing me from doing something) I realized that it could be kind of handy.

Some Curling Info You May Not See Other Places Pt 3…

So was the 7 point end for the UK vs the US a big deal?

Yes, it was/is.  You don’t see 7 point ends that often at this level of competition. Heck you don’t see them that often at any level. It requires really good shooting for one rink (team) and some missed shots for another rink (team).  Usually you don’t even try or have the chance to get 7 in the house, no less have them all in scoring position…

It will be interesting to see how they bounce back from that.

 

Some Curling Info You May Not See Other Places Part 2….

Why Shots Miss…

There are several different reasons why a shot misses, you would think. “Hey these guys do this all the time why did he miss that”, here are some of them.

You throw the wrong weight:  That is either the stone was thrown too hard or too soft.  That can be a mistake on the part of the curler who has thrown the stone or on the part of the skip who called the weight on the stone.  Sweeping can help this somewhat, but if the weight is off by too much all the sweeping in the world isn’t going to help

The skip misread the curl:   Keep in mind the location on the ice where the skip puts their broom is where you are supposed to aim your release, not where the stone is supposed to end up. The skip is reading the curl of the ice and using that information to determine the target line.  It isn’t an exact science.

A bad throw: Just generically sometimes even at the top levels you just have a bad throw.  Something happens during the slide or release and you screw up, just like Tiger Woods shanks one once in a while even top curlers do.

The ice has changed: Ice does not stay exactly the same as a match progresses, it might get faster, slower, the curl may change etc.  At the top events the ice is really, really good, but it still changes.

Something on the ice:  Something on the ice as small as a human hair can impact the path of a stone.  This is part of the reason you see curlers ‘clean’ the ice, that is very lightly sweep in front of a stone, sweep the bottom of a stone before the throw it and even sweep when there is no stone moving.

 

 

 

 

 

Some Curling Info You May Not See Other Places Part 1.

Ok,

Way off the normal database stuff, but I am also a curler (with the stones, brooms and ice) and wanted to share a few things about curling you may not see other places on-line.

Why do they pass up a chance to score 1 point at the end of the end?

Because if you have the hammer (the last stone in a end) at this level getting 1 point (unless it is in the 10 end to win) is not worth giving up the hammer normally.  If you can get 2 points when you have the hammer and hold the other rink (team) to 1 point when they have the hammer, you win.  So that is why you will sometimes see the rink with the hammer pass up the chance to score 1 point.

Why the different types of sweeping?

In curling sometimes you sweep lightly about 2 feet in front of the stone, this is called cleaning.  When you are doing this you are not trying to directly influence the path of the stone but you are just making sure there is nothing on the ice that is going to impact the path.  Something as simple as a hair can seriously impact the path of the stone.

When they are sweeping hard, they are trying to impact the path of the stone, either by making it go further or by reducing the curl (when you sweep hard near the stone you will make it go further and curl less, it will do both).  Also yes, it is physically hard and a workout when you are sweeping hard.

What the hell are they yelling?

They are yelling directions to the sweepers: Hard means sweep directly in front of the stone and depending on who is yelling the volume tells you how hard the hard needs to be.

Moving Dynamics Databases To A New Database Server…

Turned out to be easier than I expected.  You can Google how to do it and most of the current stuff out there seems logical enough.  More than anything else I would suggest is Don’t Panic.

A couple of things, keep in mind GP will encrypt passwords that is uses for defined SQL Server users, your best bet may just be after the move have the GP admin just reset all the user passwords in GP and have the users change them at first logon.  It will also kind of force the users to perhaps use a different password.

Also don’t forget to look for orphan users when you are done restoring.

Why NOLOCK is NSFW and FUD…

Ahh NOLOCK……

I have written before about NOLOCK and why I feel it is a bad idea, so I will point you to Grant Frichey’s blog about some of the issues with NOLOCK here.

But what makes NOLOCK NSFW is pure and simple, it isn’t consistent.  A dirty read by it’s very definition is inconsistent and consistency is one of the primary reasons you are using a database in the first place.  Consistency in any system, is an expectation and a requirement.  People have to have confidence in that what any system is showing them is the ‘truth’ at that moment. With NOLOCK you lose that ability, since by reading dirty data you can see data that was never ‘truth’. In my opinion nothing hurts a system’s credibility faster than that inconsistency, ‘that was wrong’ is always going to be worse that  ‘that was slow’.  Think about it, would you rather get a wrong answer or no answer at all?

Do you want to be the person behind a system in any way shape or form that is inconsistent?  I would take slow over inconsistent in a heartbeat.

To use a bit of a relevant example today for me, is that if you are in a fantasy football league and you check your score during a game, you wouldn’t expect it (nor would you want it to) to reflect plays that are in progress because you don’t know if the play is going to undone by a penalty or whatever.

I get that NOLOCK can solve all sorts of issues without much effort, but in solving those issues you are using a blunt instrument that can and will eventually undermine the faith users have in your system.  In the long run it isn’t worth it…

 

 

If In Doubt Cast Last…

Had a situation come up that resulted in a conversion failure on taking a string to datetime while moving some data around.  The thing was we didn’t even want the record with the bad value to make the move, but since we were converting then qualifying on other values the operation failed.  But by qualifying into a temp table and then converting the data to datetime we were able avoid the issue entirely.

Since casting has all sort of index impacts and the like when used on table data (causing indexes to be ignored for example) in many situations it is easier to put stuff in a temp table with a partial qualification then do your casting against the temp object than it is against the larger object.

The End Of The MCM Program And Why You Should Care….

As has been blogged other places Microsoft announced they are ending the MCM program.  This was the highest Microsoft Certification for SQL Server skills and was generally considered the one exam you could not cram for.  That if you passed that exam set you had a demonstrable skill set.  Unlike in the opinion of some, some of the other Microsoft Certifications that seems to demonstrate you can learn what you need to know to pass an exam.

Full disclosure: I think I may still be a Microsoft Certified Product specialist, I passed some NT exams and a couple of SQL Server exams many years ago (I think my certified professional number is below 30,000) and I passed my first exam the first year they offered exams at TechEd many years ago. However I have not sat for an exam in at least 10 years if not 15 or more.

The thing is, even though the MCM is rather impressive and I think demonstrated some real understanding, it is for most folks in a DBA role to some degree irrelevant.  Why?  Well in a nutshell, certification exams of any nature by their nature may cover a host of things that you may likely never need to know or deal with at least in your current role.  For example, as I have mentioned before I worked for a software company for a long time (almost 8 years) during that time I never had a reason to do replication.  It wasn’t something we supported with our product and it wasn’t something we wanted our customers to use. So the value to my employer of me learning about replication was next to nill…  So if you are looking to consult an MCM would have put a ‘stamp’ on you that indicated you knew what you were doing. There is a lot to be said for the value of one of those stamps.  But if you were a staff DBA I suspect much of what you would have to learn would quickly become stuff you never, ever had to use.

Having been in the ‘industry’ for over 20 years now and doing SQL Server for the last 18 years or so if I had list the biggest change, fundamentally, in the industry from a professional standpoint it has been the availability of quality information on the Internet. I still remember the days of manuals being your primary source for information about something you didn’t understand and your secondary source being the vendor and a support call.  There wasn’t a search engine where you could type in your error message and get 10 different examples of folks who had solved that problem.    The ability to combine your own experience with the ability to figure out what the best answer the hive mind produces is in some ways the most valuable skill a DBA (or anyone who deals with issues) can have.

So, after kind of raining on the certification parade a bit, why I think ending the MCM program is a bad idea (even for those of us who likely would never try for the certification).  The answer is simple, it shows Microsoft doesn’t care enough to create a ‘hard’ certification, it doesn’t see the value in it apparently.   That’s the problem, that Microsoft is taking away the one tool they gave to identify who they felt really knew SQL Server…

But wait, they have the MVP program. Yeah, but that is driven in part by community involvement not so much pure skill set.  Nothing wrong with community involvement, it is a good thing. But there are a host of smart SQL Server folks who for whatever reason be it time, employer rules or whatever who can not or chose not to be that active in the community. It doesn’t mean they don’t know SQL Server like a skilled guru, just they didn’t hit some undefined definition.  Think of the folks who don’t get renewed as MVPs, did they get dummer?  Did they lose knowledge of the product?  Unlikely.

So why should you care, because when it comes down to it, it appears Microsoft doesn’t.

 

 

SQL Server Things Someone Running GP Dynamics Should Care About. Part 2

Ok,

So now that you have a documented, tested and implemented backup plan in place what is next?

Checking the health and integrity of your databases, much like your own there are ways sometimes to detect problems before they become big problems, not every problem, not every time but sometimes.

The most direct way of doing this is by running DBCC CHECKDB. It’s is the easiest, most direct way of looking for integrity issues but there are some things you need to keep in mind while running and when running DBCC.

In general DBCC CHECKDB will not find any issues because odds are you don’t have any issues but if you do see an issue reported by DBCC CHECKDB.

First, do not, I repeat, do not run DBCC Checkdb with any repair option unless instructed to do so by Microsoft or someone you trust implicitly.  Do not take the advice given on some web page, blog or forum post that tells you to run any sort of repair stuff. Period, full stop.  If you walk away with nothing else from this entire post, that is your take away…

Secondly, if anyone tells you to run DBCC CHECKDBwith a repair option take a backup first.  Do not overwrite any existing backup, put the backup it it’s file and clearly name it so you know you took a backup of a potentially corrupt database.  Yes, you are backing up a potentially corrupt database, but running any sort of fix may make things worse and you may want/need to have what you had before running any sort of fix.

Third, if DBCC CHECKDB does find an issue, run DBCC CHECKDB again while you Google the issue you found the first time. There is a chance the issue may not appear a second time, this is not generally true with DBCC CHECKDB, but it is worth trying. If it comes up clean a second time, then run it a third.

If you are still seeing errors then depending on the issue you may have to restore from backup, so get your backups ready and accessible if they are not already ready.

Finally, if recovering from a backup is not an option (too much data lost, etc) contact Microsoft  Support for suggestions and next steps. Yeah it is going to cost you money, but it is money you are going to have to spend.