John McCormack DBA

SQL Server Databases and Cloud

  • Personal
    • About
  • Free Training
    • SQL Server on Amazon RDS (Free Course)
    • Free practice questions to help you pass DP-900
  • Save money in Azure
    • Azure IaaS SQL Backups – Stop burning money
    • Your Azure SQL Database and Managed Instance is too big
    • Turn the cloud off at bedtime to save 70%
    • Your Azure SQL Virtual Machine might be too big
    • Save money with Azure SQL DB serverless
    • Save up to 73% with reserved instances
    • Delete unused instances to save money in Azure
  • Hire me
    • 60 minute cost optimization
    • Let me solve your SQL Server problems
    • Take a look at my Sessionize speaker’s profile

Search Results for: aws

PowerShell Splatting – What was wrong with backticks?

8th December 2020 By John McCormack Leave a Comment

T-SQL Tuesday

t-sql tuesday logo

This month’s T-SQL Tuesday is hosted by Lisa Griffin Bohm. (b|t). Lisa asks “This month, I’d like those of you who have presented, or written a presentation, to share something technical THAT DID NOT RELATE to the topic of the presentation, that you’ve learned in writing or giving the presentation.” I’m going to write about how I came across PowerShell Splatting and how it made me better at PowerShell, despite presenting on a cloud topic.

Powershell splatting

At DataScotland 2019, I did a presentation on AWS RDS for SQL Server. The technical content was about how RDS works, what you can do with it, and how to provision it etc. As part of my demos, I decided to use AWS PowerShell commands. When I had made this presentation at previous events, I had used AWS CLI so I had to update my code examples. I’m ok with PowerShell, but I’m not an expert. I just wanted to show that were were multiple ways to interface with AWS.

My code was full of backticks. You could say I was daft about backticks. I loved them and thought they made my PowerShell code readable because they stopped the lines from running off the monitor. Someone asked me why I don’t use PowerShell splatting? “Whatting” I asked? I had never heard of splatting.

At the break, I spoke to a couple of people who were more experienced in PowerShell than me. They advised that PowerShell splatting was the way to go for large commands because they make the code more readable. More readable was definitely something I was interested in so I decided to go away and learn about splatting, and update my code for future events.

So what is PowerShell Splatting?

Rather than passing a long list of parameters into commands, you can create a variable in advance to hold these values. The variable is an array or a hash table and includes as many parameters as you need. If you need to pass in parameter names and values, use a hash table. If you just need to pass in a list of parameter values, you should use an array. Then, when you run the command, you simply pass in the hash table parameter instead of all the individual parameters.

Example command before splatting

New-RDSDBInstance -dbinstanceidentifier "datascotland-posh" -region "eu-central-1" -VpcSecurityGroupId "sg-00a1234g567c3d4ab" `
    -allocatedstorage 20 -dbinstanceclass "db.t2.micro" -engine "sqlserver-ex" `
    -masterusername "rds_name" -masteruserpassword "secure_pw_here" -availabilityzone "eu-central-1a" `
    -port 50000 -engineversion "14.00.3049.1.v1"

Example command after splatting

$HashArguments = @{
dbinstanceidentifier= "datascotland-posh"
region = "eu-central-1"
VpcSecurityGroupId = "sg-00a1234g567c3d4ab"
allocatedstorage = 20
dbinstanceclass = "db.t2.micro"
engine = "sqlserver-ex"
masterusername = "rds_name"
masteruserpassword = "secure_pw_here"
availabilityzone = "eu-central-1a"
port = 50000
engineversion = "14.00.3049.1.v1"
}
New-RDSDBInstance @HashArguments

At a glance

As you can see, the 2nd example which uses splatting is easier to read and you can pick out the value of each parameter at a quick glance. It was worth learning to make my code more readable and improve my overall PowerShell knowledge.

“Writing this post has just made me realise that I should update my RDS course ↙ as the examples in it don’t use splatting. 🤦‍♂️”

https://johnmccormack.it/2020/07/sql-server-on-amazon-rds/

Filed Under: front-page, PowerShell, T-SQL Tuesday, Uncategorised Tagged With: powershell, splatting, t-sql tuesday

2020 blog – a year in numbers

18th December 2020 By John McCormack Leave a Comment

Blog Performance

A few thoughts on my blog performance for 2020.

I have more than doubled my page views from 2019 to 2020 so I’m naturally delighted about that. At the time of writing and with 13 days of 2020 to go, I have had 16,773 page views. The average time on each page was 3 minutes and 53 seconds which tells me that real people are reading the content. I wasn’t really tracking this all year so these numbers were a bit of a surprise to me. In the full year of 2019, I only had 7018 page views with an average page viewing time of 3 minutes and 26 seconds.

  • 2019 blog visitors
    2019 blog visitors
  • 2020 blog visitors
    2020 blog visitors

Things are going quite well and I’ve decided to aim for 30,000 page views in 2021. Doubling the numbers again is not going to be easy, but I hope to achieve this with a steady flow of new content and updating some old material. Breaking it down, it is a modest target of 82 page views per day so is achievable if I continue to add good content.

Regular Content

I’ve been trying to put out regular content, although it is not all the same theme. I tend to find that when I solve an interesting problem, I tell myself that it would make an interesting blog post. So I’ve blogged on Azure, PowerShell, Performance tuning and whatever the #tsql2sday topic was that month. My aim for 2021 is to be a bit more specialised so you will see more posts on Azure SQL DB and Managed Instance, as well as performance tuning. These are areas I would like to work more on in 2021. Of course, I’m going to keep going with the #tsql2sday posts because they usually provide an interesting topic I wouldn’t otherwise think of.

Blog successes

One of my recent posts on database mail with managed instances has gained some traction. Although only published in October, it is already in my top 10 page views for the year. My feeling is that this is the sort of thing that people are googling for now, the MS documentation isn’t amazing either and its on trend.

One of my first ever blogs about sending html emails using database mail is at number 9. I find that hard to believe because when I see old dates on blog posts, I tend not to want to read them. I remember publishing this post and wondering if anyone would read it and even worse, if I would be ridiculed for it.

My number 1 post for the 2nd year running was EC2 SQL Server Backups to Amazon S3. I haven’t read it for a while and I think it might be in need of a major update, so I plan to do that in the next few weeks.

My 2nd most popular post, also for the 2nd year running was How to create a table in AWS Athena. I used Athena a lot in my old job and I found the documentation difficult to understand so I put together my own instructions. I can’t believe that it is still one of my most popular posts and in fact, it grew from 768 views in 2019 to 2741 views in 2020. It’s a sign to me that AWS Athena is gaining a lot of popularity. The post is 3 years old though so I think it needs to be refreshed too.

Blog disappointments

I wrote a full video series about SQL Server on AWS RDS. It wasn’t a hit. In fact, it only accounted for 246 page views. The videos are on YouTube as well and have only had 237 views. The videos were all subtitled to help with accessibility and it took me a long time. My son also did some subtitling and he got some pocket money for helping out. I have to learn from this though, I didn’t appear in the videos, they were purely PowerPoint and demos and when I think of the videos that I enjoy watching, they always have an engaging presenter.

I’m currently creating a new video series called fundamentals of Azure SQL DB Managed Instances. I hope to learn from the mistakes of my RDS course, and hopefully it will reach a wider audience.

Filed Under: front-page, Personal Tagged With: blog performance

Let me solve your SQL Server problems

11th January 2021 By John McCormack Leave a Comment

I’ve started a SQL Server consultancy business, focussing on short term engagements with ongoing support where needed. I’m keen to know what problems you are having with SQL Server that you would like someone to have a look at it.

What do you get from me?

In my bespoke SQL Server health checks ,I’ll present the results with actionable steps for you to take. View a sample health check. I also offer cost optimization reviews to help you save £1,000s from your Azure Bill.

What is the cost?

The SQL Server health check is £295 + VAT. The cost optimization review depends on the size of your environment. You can book a free introductory call to discuss.

Why would you want my help?

Experience

I’ve been working with SQL Server for around 10 years now. I’ve worked with large multinational companies and privately held enterprises, that operate on a global scale. I have a track record of solving problems related to SQL Server performance and I’m an experienced production DBA as well.

I also have a proven track record in cost optimisation of cloud resources, on both AWS and Azure. In my last contract, I saved the customer over £400k per year between SQL and storage costs.

My Certifications

  • MCSE: Data Management and Analytics certification
  • AWS Cloud Solutions Architect Associate
  • Azure: AZ-900 & DP-900

Client feedback

DBA Troubleshooting Impact

It’s been a genuine pleasure John. You’ve come to the rescue so many times I’ve lost count.

Duncan Lundie, Head of Application Operation, City Facilities Management

Best of luck John. It’s been a pleasure and you’ve been a lifesaver (more than…) a few times

Ronnie McGee, Senior Project Manager, City Facilities Management

Thanks for everything John. You will really be missed in terms of approach, achievements, mindset and skills! It’s been great working with you and hopefully our paths will cross again.

Stephen Meeke, Principal Engineer, City Facilities Management
Cost optimization (cloud)

Superb work on project X! Proactive, detailed, outcome driven and focused!

Nick Prudhoe, CTO, City Facilities Management

John is doing a fantastic job on Project X pushing the boundaries and saving thousands of pounds to Mercury. For me, it’s not just the cost savings which makes him stand out but the “Agile” thinking and drive to make things better.

Gautam Sivakumar, Cluster Lead, City Facilities Management

Public Profile

I’ve spoken at major data platform conferences such as SQLBits, Data Scotland and DataGrillen. I blog regularly and I also contribute to open source projects on GitHub. I try to be a member of the SQL community who gives as much as he takes.

What other things can I help with?

  • I can review and fix your indexes.
  • Tune queries, stored procedures or views to return data faster.
  • Health check of your instance, to reassure you or tell you what needs to be fixed.
  • Review your cloud expenditure and identify savings.
  • Configure Availability Groups.
  • Most production DBA activities/tasks.

These are just a few examples, you can ask me anything.

Let’s do this, send me your details to request a SQL Server Health Check.

If you prefer, you can book a free 15 minute introductory call directly with me.

Alternatively, you can call me on:  +44 (0) 330 133 2710.

Filed Under: front-page Tagged With: sql server health check, sql server problems

A month in the life of a DBA contractor

8th February 2019 By John McCormack Leave a Comment

DBA Contractor in GlasgowI left what I considered to be a great permanent job to become a DBA contractor in Glasgow. It was one where I could pick some of my own projects, work with new and interesting technology and work in a team which collaborated well, liked each other and were good at sharing knowledge.

My reasons for moving on were two-fold. First of all, I wanted some career progression and it unfortunately just wasn’t available in my permanent job. Secondly, I wanted to work more with SQL Server and Azure. My last job started out as a SQL DBA but as a lot of people in this line of work will know, the duties have evolved considerably over time. This is mostly due to large scale cloud adoption. In my case, my workplace started heavily using AWS along with other RDBMSs and data platforms. (RDS MySQL & Aurora, ElasticSearch, Elastic Map Reduce (EMR), Glue and Athena). This gives you a lot to learn. Don’t get me wrong, I threw myself into learning about cloud solutions and I loved working with AWS (hopefully I will again) but as time went on, I was worried I would start to lose some SQL Server knowledge.

So what has the first month been like?

I have been working exclusively on the Microsoft Data Platform. At my first client, I’ve worked with SQL Server on-premises, SQL Server running on Azure VMs, Azure SQL DB, Azure Analysis Services and Azure SQL Data Warehouse.

On-Premises

The on-prem SQL Servers are mostly for hosting the databases of legacy applications and 3rd party vendor products. Some of the versions are ‘rather old‘ although these instances actually give the business the fewest headaches. I’ve worked on decommissioning unused databases that were still online, server side traces and native backups.

Azure VMs running SQL Server (IaaS)

These host the databases that have the most active development work. I’ve looked at performance issues and SQL Server configurations to help improve performance. I’ve shared best practice with the team in terms of tempdb and helped to reduce the volume of unnecessary emails from servers. (You know the ones which someone set up years ago but never induce any action from the DBAs).

Azure Analysis Services (PaaS)

This was fun. I only did some basic configuration and permissions but as I’ve never used Analysis Services much over the years, it was cool to see what was involved.

Azure SQL Data Warehouse (Paas)

It was great to get my hands on tech like this. I spent time modernising their manual point and click refresh process with PowerShell. This was a bit of a learning curve but extremely rewarding. This process will make future refreshes much easier. (I’ll share the code once I’m confident it’s good, I’d still like a few more run-throughs before doing this). Next month, I’d like to try to implement a self service process for the developers that allows them to do their own refreshes, freeing up DBA time to work on more critical items.

Azure SQL DB (PaaS)

So far, I haven’t had to do too much with Azure SQL DB on this project. I’ve listed out the instances and instance types using PowerShell. My plan is to review if these are right sized or if efficiencies can be made and I’ll also make sure the alerting is set up correctly.

Plans for next month

I’d like to offer some in depth server health reviews and work with the developers to help them make their code run faster. There is a lot of blocking due to long running stored procedures and sub optimal code. Improving a few of the big hitters will make them much happier and will ease the strain on some of our servers – at least that’s the idea.

Further Reading

  • Azure SQL Data Warehouse
  • PowerShell cmdlets and REST APIs for SQL Data Warehouse

Filed Under: Azure, Azure SQL Analysis Services, Azure SQL Data Warehouse, Azure SQL DB, front-page, Personal

Who is John McCormack

21st January 2016 By John McCormack Leave a Comment

John McCormack profile

John McCormackHi. I’m John McCormack and I’ve been working professionally with SQL Server since 2012. I spent 6 years as a production DBA with Monster and now work as an DBA Contractor. I love working with SQL Server but also with other cloud solutions. It’s a job that I love and I’m constantly learning.

Prior to deciding I wanted to work with computers, I had a wide and varied career. I joined RBS and worked my way through various positions including mortgage adviser and finished up as a manager in a contact centre. I was always looking for other jobs and skipped through a few other sales and management jobs with British Gas, and T-Mobile/EE but I was ultimately looking for a change.

It was in 2008 that I decided a full change of direction was required and I managed to secure myself a place on a Web Development degree at UWS. I changed to evening/weekend work at T-Mobile and started the degree. At the time, I was pretty sure I wanted to be a web developer but I found I really enjoyed the database modules. It was upon hearing a talk from a Database Architect about various career routes in the database world that I knew I wanted to be a DBA. Fast forward 4 years and I had earned my degree and had landed a job with Monster.

Next steps

Landing my first database job as an associate DBA was only step 1. I knew that the next thing I had to do was learn, learn and learn more to become a competent DBA. Coming into IT 10 years later than I perhaps could have, I felt I had some catching up to do. To do this, I’ve learned from my colleagues, taken on challenges in work, studied for and gained MCSA in SQL Server 2012, then MCSE Data Platform. My next aim is to learn more topics about SQL Server in greater detail and to share my knowledge with the community as I go about. I’m have also achieved the AWS Cloud Practitioner and AWS Certified Solutions Architect – Associate qualifications.

Personal life

I’m married to Julie Ann and have 2 great boys, Graham and Johnny. We live in Paisley, Scotland. When I’m not working, I enjoy high impact exercise classes such as Boxfit and Metafit.

You can follow me on twitter but I can’t promise I’ll only talk shop. I’ve been known to tweet quite a lot about football, in particular, Saint Mirren FC of whom I am a big fan.

Filed Under: Personal Tagged With: john mccormack, john mccormack dba

  • « Previous Page
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • Next Page »
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

John McCormack · Copyright © 2025

 

Loading Comments...