Problems displaying this newsletter? View online.
SQL Server Central
Featured Contents
Question of the Day
The Voice of the DBA
 

Daily Coping Tip

Try a new online exercise, activity, or dance class

I also have a thread at SQLServerCentral dealing with coping mechanisms and resources. Feel free to participate.

For many of you out there working in a new way, I'm including a thought of the day on how to cope in this challenging time from The Action for Happiness Coping Calendar. My items will be on my blog, feel free to share yours.

Scripting Makes Mistakes Easier Than Ever

A number of you likely use Atlassian products like Jira, Confluence, Opsgenie, or something else. You might have been affected by a large outage they had (post incident blog, Company Q&A, TechRepublic report) recently which lasted at least 9 days. I don't know if all customers have their data back and are working, but this was a surprisingly poorly handled incident according to a number of reports from customers. There's a great write-up from the outside that you might want to read.

The bottom line in this issue is that Atlassian looked to deactivate a legacy product with a script, but they apparently didn't communicate well among their teams. The script ended up using the wrong customer IDs and also marked the sites for permanent removal, not temporary removal (soft delete). While they supposedly test their restore capabilities, they weren't prepared for partial restores of subsites. I'm guessing this is likely a partial database restore, which many of us know is way more complex than a full database restore.

Leave aside the issue of a software-as-a-service (SaaS) company failing their customers, and the lack of communication with customers. The more interesting thing for me is the challenge of poor coding and communication internally. Clearly, the project to deactivate their legacy app wasn't well planned or tested and the code used was probably executed at too wide a scale initially.

When we deploy code changes to a large number of items, we want to test them at a small number first. Whether we are deploying to multiple databases, against many customers, or different systems, a standard method of making changes at scale involves working in rings. Azure DevOps describes this in docs, and they actually use rings to change the platform. We used the same pattern 20 years ago for software and database updates to many systems. We would internally deploy to a few users to look for issues. Then a week later we would deploy to a small number of systems to check for unexpected issues. Then typically to most systems in the third ring with a fourth ring a week later to catch up stragglers that needed more time to prepare.

I find many customers, especially those with sharded/federated databases or many systems unwilling to spread out deployments in this manner. Often they yield to pressure from business users to ensure everyone gets the same update at the same time. I would never recommend this approach as we need to ensure we are looking at scripts in a controlled environment, or even two, before we deploy things widely. I'd be even more cautious about one-off administrative scripts that might make a change similar to the one Atlassian attempted. Those are often not seriously tested enough.

At the very least, any of us working with multiple customers in a single database or in multiple databases ought to ensure we can backup and restore a single customer, but more importantly, can you restore a group of customers. If you make a mistake like Atlassian, which scripting allows us to do extremely rapidly, can you recover a partial set of data? Many of us don't test this, but that's likely something we ought to consider when we work with scripts that are designed to only change some data. Most of us don't experience complete failures, but partial ones, usually because of human error.

Steve Jones - SSC Editor

Join the debate, and respond to today's editorial on the forums

 
 Featured Contents
SQLServerCentral Article

DAX in Power BI Tutorial

Daniel Calbimonte from SQLServerCentral

Introduction to DAX in Power BI This time we will ...

External Article

Getting an Overview of Changes to a PostgreSQL Database using Flyway

Additional Articles from Redgate

How to use Flyway and PowerShell to automatically generate a database build script every time Flyway successfully created a new version. You can then investigate schema changes between versions simply by using a Diff tool to compare build scripts.

External Article

Site Reliability Engineering vs. DevOps

Additional Articles from SimpleTalk

What’s the difference between Site Reliability Engineering and DevOps? In this article, Grant Fritchey defines each one and compares them.

Blog Post

From the SQL Server Central Blogs - T-SQL Advice For Young, Old, and even Eccentric

SQLRNNR from SQL RNNR

Be mindful of advice. Give an ear to those offering it. Just be mindful, there is no need to accept the advice, but it is wise to at least...

Blog Post

From the SQL Server Central Blogs - Book Review – Pro Serverless Data Handling with Microsoft Azure

Koen Verbeeck from Koen Verbeeck

Yet another book review! I just finished the book Pro Serverless Data Handling with Microsoft Azure: Architecting ETL and Data-Driven Applications in the Cloud (what a title :), written...

 

 Question of the Day

Today's question (by Steve Jones - SSC Editor):

 

Creating Azure SQL Databases

I want to delegate the ability of someone else in my organization to create Azure SQL databases in my subscription. I create a login for another user, and want to give them the ability to create new databases. Which role should I assign in the logical master database?

Think you know the answer? Click here, and find out if you are right.

 

 

 Yesterday's Question of the Day (by Steve Jones - SSC Editor)

SQLCMD Variables

I have this script saved on my filessystem:

USE AdventureWorks;

SELECT x.$(ColumnName)
FROM Person.Person x
WHERE x.BusinessEntityID < 5;

I want to call this from SQLCMD and replace the variable with a value. What parameter should I add to this code to get this to work?

sqlcmd -S localhost -E  -i sqlcmdvar.sql

Answer: -v Columnname="FirstName"

Explanation:

Discuss this question and answer on the forums

 

 

 

Database Pros Who Need Your Help

Here's a few of the new posts today on the forums. To see more, visit the forums.


SQL Server 2017 - Administration
What are the dangers of utilizing the "No validation expected" in MSDTC - In our current circumstance we have two servers on two separate areas (one is in DMZ, other in inside organization) and we really want them to have the option to utilize dispersed exchanges. The exchanges would be started from the server on the inside network through connected server. The server on the DMZ would simply […]
Backup verify with third party tools - Is backup verify option available with third party tools (DDBoost or Lite speed or Redgate) like native backup in sql? What are the negative impact using backups with verify option?
Pre allocating free space to db growth - Hi SQL experts, What are advantages/Disadvantages, if you  pre allocate the extra space to the database growth (70-90%) ahead. How can you release the pre allocated free space? When I choose task shrink file, release unused space. It didn’t release any space even though there’s is 90% free space Thanks Ramana
Seeing messages in Errorlog - Hi All, We are seeing below messages in ERRORLOG. Does it indicate any pressure or just informational messages? Anything needs to be looked into? 2022-04-16 00:01:05.360 spid21s FlushCache: cleaned up 134823 bufs with 18733 writes in 62497 ms (avoided 3639 new dirty bufs) for db 27:0 2022-04-16 00:01:05.360 spid21s average writes per second: 299.74 writes/sec […]
SQL Server 2017 - Development
When run Python script from SQL server 2017 get error ? - when run python script from sql server  2017 I get error Msg 39004, Level 16, State 20, Line 0 A 'Python' script error occurred during execution of 'sp_execute_external_script' with HRESULT 0x80004004. Msg 39019, Level 16, State 2, Line 0 An external script error occurred: Error in execution. Check the output for more information. Traceback (most […]
Error when import data from excel to SQL server using Python ? - I work on SQL server 2017 I add script python to import data from excel to SQL python version 3.10 when run query below i get error declare @ImportPath NVARCHAR(MAX)='G:\ImportExportExcel' declare @DBConnectionString NVARCHAR(MAX) = 'Database=z2data;Uid=sa;Pwd=321' declare @ImportAll BIT=0 declare @CombineTarget BIT=0 declare @ExcelFileName NVARCHAR(200)='dbo.studentsdata' declare @ExcelSheetName NVARCHAR(50)='students2' --BEGIN TRY SELECT @ImportPath = CASE WHEN RIGHT(@ImportPath,1) […]
SQL server 2017 question - Hi all. Im wondering if you could all point me in the right direction. Im currently in school and the schools machines have SQL Server 2017 developper installed. Im trying to find myself and install media to install it on my own machind but every link a find brings me back to the 2019 version […]
SQL Server 2016 - Development and T-SQL
Maintenance Plan to Sever All Connections - Before I ask the question, I know this can be done via *.bat files and task scheduler on the server or a forced reboot of the server and a few other methods, but unfortunately, due to security reasons at my company,  we do not have the ability to do this outside of SQL Server itself, […]
Development - SQL Server 2014
SQL Server 2014 Standard - I just bought a SQL 2014 standard license from a vendor, but noticed that the product key can be looked up on google..... Does SQL 2014 have unique keys or does it just use one product key based on editions?
SQL Server 2019 - Administration
Delta Airlines Reservations Contact Number 818-286-3607 - Delta Airlines Reservations Contact Number - Delta Airlines is one of the major carriers of the world. It is the world largest carrier of the world by its fleet size, passenger carried, revenue and profit. Together with its regional partner Airlines Delta Eagle, they offer 6700 flights daily to 350 destinations in 50 countries. It […]
SET QUERY_STORE settings (SQL Server 2019) - I have a query I periodically run against the query store for retrieving the number of milliseconds of CPU consumed by the current database for time windows of the recent past (e.g. each 5-minute window for the past 4 hours).  That's all I'm using the query store for.  What are the best values to use […]
CPU usage of database for time spans in SQL Server 2019 - I want to track how much CPU usage (in ms, not %) was consumed for a database in a given time window.  I know how to do this with the Query Store, but I think it stores a lot more than I need, and I don't want to lose data due to seldom-used query plans […]
SQL Server 2019 - Development
OPENJSON unable to parse Portuguese characters - I'm trying to convert my JSON data into a table format in SQL Server Express 2019. Following are my JSON data: DECLARE @token INT; DECLARE @ret INT; DECLARE @url NVARCHAR(MAX); DECLARE @json AS TABLE(Json_Table NVARCHAR(MAX)) SET @url = 'http://www.test.com/webservice.php?user=DHRWWF&pass=CVernise&key=DFGJRTSrnwieuwn3&format=json' EXEC @ret = sp_OACreate 'MSXML2.XMLHTTP', @token OUT; IF @ret <> 0 RAISERROR('Unable to open HTTP connection.', […]
How a batch can get how much CPU it used in SQL Server 2019 - Is there something I can put at the end of a batch to find out how many milliseconds of CPU it used? Something like SET STATISTICS TIME but for the whole batch, not each statement.
SQL Azure - Development
Is it possible to use Azure Data Studio to connect to on-prem SQL Server? - I'm getting this error when trying to create a connection to an on-prem SQL Server through Azure Active Directory - Universal with MFA authentication. Microsoft.Data.SqlClient.SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 35 - An internal exception was caught) Thanks!
 

 

RSS FeedTwitter

This email has been sent to {email}. To be removed from this list, please click here. If you have any problems leaving the list, please contact the webmaster@sqlservercentral.com. This newsletter was sent to you because you signed up at SQLServerCentral.com.
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved.
webmaster@sqlservercentral.com

 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -