Tag Archives: best practices

You didn’t know that?! But that’s so obvious!

Rant-mode activated

Today I noticed a tweet from Andrew Prewski (@DBAFromTheCold)

Loving all the passive aggressive comments about my article on SQL on linux, keep ’em coming!

Andrew’s tweet piqued my interest and I went to look at his blog-post “Killing databases in SQL Server on Linux“. In the post, Andrew investigates how files are handled inside Linux, in particular how database files are handled. Go and read it, it is really interesting and a possible eye-opener for anyone who has no experience with Linux.

Now, the reason for this rant is the comments that came through from people who do have experience with Linux/Unix (go and read those too). Many of them boil down to basically scoffing at how Andrew didn’t know that Linux handles files differently to Windows and has done for years/decades. The tone of these comments were aimed to belittle Andrew for not knowing about this behaviour.

This pisses me off!

Maybe I’m just having a bad day or something, but it seems wrong to me that someone who is trying to learn should be made to feel in any way stupid for exploring something. It seems even wronger for this sort of behaviour to come from an area of the IT world which generally prides itself with the idea of “hacking”. The whole premise of taking a technology that you don’t understand and prodding, poking, dissembling and rebuilding – that is the “way of the hacker”, or at least how I have always understood it.

I for one hope that Andrew won’t be deterred by this shitty behaviour and also would hope that anyone reading this would think twice about how they respond to a similar situation. Everyone starts out at zero, not even Linus Torvalds was born being able to code.

Please remember: Don’t be condescending. Offer tips, advice or references to help, not ridicule.

The case of the non-starting SQL Agent Job

I ran into an interesting situation recently that involved a SQL Agent job that would not/could not run. Looking at the job settings everything seemed fine, yet the SQL Agent deemed the job “un-runnable”.

As we can see here “My Test Job” is enabled, and scheduled, but has no “Next Run” and is deemed not “Runnable”.

Job Activity Monitor

Taking a closer look at the job properties, we can further see that the job is enabled:

Job Properties - General_3

We also see that there really is a schedule for the job:

Job Properties - Schedules

And on further investigation I saw something that I have never really looked at before. The “Targets” properties:

There are no entries here, but more importantly, the radio button “Target local server” is not selected. This turned out to be the cause of the job not running!

If I try and exit the properties with “OK” (which you should never do unless you have intentionally changed a setting somewhere), then we are presented with a clear error message informing us about the missing Target:

Job Save Error

“You must specify the Target Servers on which this multi server job will execute.”

The “Targets” section of a SQL Agent Job is something that I have never delved into in any detail, but is a long standing feature to allow for administration of large server environments. You can read more into Multiserver Environment Administration on MSDN.

The reason for the setting being missing was through an incomplete scripting process for the affected job. If you script out a SQL Agent Job in SQL Server Management Studio, you will see that one of the last steps in the script is a system stored procedure “msdb.dbo.sp_add_jobserver”:

EXEC msdb.dbo.sp_add_jobserver @job_id = @jobId, @server_name = N'(local)'

This stored procedure associates a job to a jobserver, which in my experience has always been “(local)”. Obviously, this will be different if you are using master servers and target servers in your environment.

As soon as I had set the target server to local for the job, everything was back to normal and the job ran again according to it’s schedule.

1 Year Emsland SQL User Group

Moin Moin!

Unser User Group feiert 1 Jahr mit einem Sondertreffen:

Am 04.09.2015 ab 15:00 Uhr finden insgesamt 4 Sessions statt. Es sind 4 Auswärtssprecher am Start die zu unterschiedlichen Themen vortragen werden.

Die Sessions werden gerade festgelegt, aber der Termin steht schon fest. Schaut euch die Details an und meldet euch mit dem unten stehenden Button an!

Eventbrite - Emsland SQL Server User Group: SQLGrillen

Wir freuen uns auf euch!!

P.S. Gebt das bitte weiter, wir wollen so viele Leute da haben wie möglich, danke!

 

SQL Server 2012 SP2 – Making SIMPLE recovery simple again

Yesterday morning I blogged about how SQL Server 2012 RTM and SP1 are both flawed with regards to the model database and SIMPLE recovery model usage.  The error is fixed in a Critical Update, but many customers cannot/do not want to install CUs as they are less tested than Service Packs.

In that post I mentioned that SQL Server 2012 SP2 would include the fix for the issue I mentioned, but there were no details on when it would be released.

It seems Microsoft read my blog, because they released SQL Server 2012 SP2 late last night/early this morning!

This rolls up an entire set of CUs that have been released since the last SP in November 2012. So go out, download the SP and install it on test machines and then, after testing, onto your production boxes.

Speaking at SQL at the Weekend, Southampton UK

I have had this down on my calendar for a while and forgot to mention it, but I will be coming over to speak in the UK again in July this year.

The SQL Soton User Group leaders John Martin (twitter) and Steph Middleton (twitter) are putting on a one-day SQL Server event (not a SQL Saturday, but similar in setup) and asked me if I would come and speak,

I will be presenting my seemingly popular “Replication: What, How and Why?” session along with a bunch of other speakers from around Europe.  We’ll be a single track of one hour sessions, starting in the morning and going into the late afternoon. I’m sure there will be plenty of opportunity to chat about all sorts of topics on the sidelines too. It looks like it will be a fun time and it would be great to see some new or old faces around.

The whole thing is taking place in Southampton on the 12th of July – the weekend before SQLBits, so if you can’t wait for that (or can’t make it to Bits), then SQL at the Weekend is the thing for you.

You can check out the line-up and register for the event here: SQL at the Weekend

Hope to see you there!

SQL Server Consolidation – Resistance is Futile: Remote presentation for SQL Southwest, 21st November 2013

I am booked to speak at the SQL Southwest User Group in the UK on the 21st of November at some time from 18:00 (GMT) onwards.

This will be a new session on SQL Server consolidation titled “SQL Server Consolidation – Resistance is Futile!”.  The session will cover the reasons for and against consolidation and hopefully help you to understand how consolidation can be performed in your environment. Due to the subject there won’t be many demos (if at all) and it will be more of a high-level discussion.

The session will be run remotely using a yet to be decided medium (GoToMeeting, WebEx or something similar), which will be a first for me.  A suitable link or login details will be made available via the SQL Southwest website and I will tweet the details ahead of time too.  I have been informed that there will be some sort of question/answer capability which will also be communicated in advance and during the session.

I hope to see you there!

Be prepared!

While I was on my recent trans-global sojourn I came to the conclusion that the boy scouts really had a valid point with their motto “Be Prepared”. Of course, I am not meaning it quite in the semi-military sense that Robert Baden-Powell meant, but being prepared before the large system roll-out really saved a lot of time, nerves and money.

The roll-out was a set of reporting servers in a transactional replication setup, pushing operational data from a central server to the outlying branch offices around the world. I spent a great deal of time preparing these systems for the roll-out; standardising the installations, scripting out each step required to set up users, roles, permissions, DB objects, linked servers, jobs etc. This long preparation period was very tedious and I would often lose the motivation to keep at it.

The final payoff for this long drawn-out process has been the actual roll-out at each location. I have been able to arrive at each office, totally jet-lagged and tired from the entire travel regime and basically sit and watch the scripts run through and see the systems come to life. Had I not been prepared, I would have been in a world of pain, trying to remember what needed doing and when whilst fighting off sleep and headaches.

As a side note: A former colleague/mentor told me to save every script I ever run. If you don’t, you’ll need to repeat that script that took you an hour to write the very next day after you deleted it. This task has been made much easier to do thanks to the SSMS Toolspack provided by the more than awesome Mladen Prajdić. His SSMS extension has saved me hours of time when I have written code and accidentally thrown it away, or when SSMS has crashed. Use his tool and donate to the cause!

So, before you start any project, always keep the Scouts motto in mind – “Be prepared”. Hard disk space is so cheap as to be free, how cheap is your time?