SQLServerCentral - www.sqlservercentral.com

A community of more than 1,600,000 database professionals and growing

Featured Contents

Featured Script

The Voice of the DBA

Rollbacks Are Normal

Do any of you think that a rollback of a version for your application is easy? Most people struggle, and when I talk DevOps and improving your process, the number one question is about rollbacks. In fact, recently I had a few people that struggled to even listen to the early parts of DevOps because all they could think about were previous failed releases and the need to roll back. They kept saying, what about rolling back. Hopefully you can stick with me a bit longer.

I'd argue that rollbacks are the process that needs DevOps more than ever, with smaller, more regular releases and practice at making changes. Whether forward or backward, we ought to be able to rev our software easily. I ran across a piece from the cloud platform blog at Google called Reliable releases and rollback - CRE life lessons. The title is an interesting one, but suspend some of your database skepticism until the end.

It's easy to consider rolling back in the early parts of the article and say "it's way easier to roll back your application", and it is. Applications just stomp down new (or old) versions on top of what's there, which is often an easy thing to do. As they say at Google, "rollbacks are normal", which certainly seems to fit with the application paradigm.

In fact, they recommend rolling back a good release. After all, it's much easier to practice this sort of thing when you have a working new version of software. When the release breaks your system, as mentioned in the piece, everyone's stress level rises and the fixes often aren't well built. Even when they work, which isn't anywhere near all the time, there are often problems later. The idea should be to roll back and ensure everyone knows how to undo a version change. They can document the reasons for rollback and get the previous state of the application running. I hadn't thought about this, but it makes sense. Practice in advance and be prepared. You can always re-deploy the working version.

What about databases? They have a solution, and I like it. They want the app developers to build two versions of the application. One pre-schema change, and post. That way you deploy the first version, then the schema change(s). Then you deploy the second version. If there's an issue, you rollback to the first version and undo the database changes. This sounds hard, but once you get into the swing of building code that survives additive changes to the database, this is easy.

This doesn't solve any destructive changes to the database, like dropping objects or manipulating data. I would suggest that drops are a completely separate release, and have a full backup (or snapshot) taken and saved for awhile. For data manipulation, save off the previous state of data, just in case you need to reload things.

Becoming better at not only delivering changes to the customer, but also removing them when issues are detected is a valuable skill, and since we're likely to have a bad release at some point, this might be a way to even further reduce the risk of deploying database changes.  

Steve Jones from SQLServerCentral.com

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


The Voice of the DBA Podcast

Listen to the MP3 Audio ( 4.7MB) podcast or subscribe to the feed at iTunes and Libsyn. feed

The Voice of the DBA podcast features music by Everyday Jones. No relation, but I stumbled on to them and really like the music.

ADVERTISEMENT
RGUni

Redgate University

Self-paced online training courses with easy to follow classes on getting started, exploring advanced features, and making the most of Redgate products. Learn the fundamentals, best practices, and top tips from the experts - Redgate’s Microsoft Data Platform MVPs and engineers.
Start Learning

Webinar

Simplifying SOX Compliance in DevOps

Being compliant shouldn’t have to result in restricting your own work or slowing down your release time. Microsoft Data Platform MVP Grant Fritchey will explore how IT Teams fit into this story and how to best protect your company and customers.
Register now

Featured Contents

 

Stairway to Biml Level 8 – Using the Relational Database Metadata to Build Packages

Andy Leonard from SQLServerCentral.com

In this next level of the Stairway to Biml, we will examine how you can use the information stored in your RDBMS to build packages. More »


 

Free eBook: SQL Server Transaction Log Management

Press Release from Redgate

When a SQL Server database is operating smoothly and performing well, there is no need to be particularly aware of the transaction log, beyond ensuring that every database has an appropriate backup regime and restore plan in place. When things go wrong, however, a DBA's reputation depends on a deeper understanding of the transaction log, both what it does, and how it works. More »


 

The Changing Role of SQL Server Monitoring

As SQL Server estates continue to grow quickly, and change in nature, due to the ease with which new cloud-based, containerized or virtual machine-based SQL Servers can be provisioned, so too the role of the monitoring tool changes. More »


 

From the SQLServerCentral Blogs - Only one Log Reader Agent can connect to a database at a time error – Transaction Replication/CDC

Dharmendra Keshari from SQLServerCentral Blogs

An interesting issue regarding SQL Server Transaction Replication/CDC log reader agent job can’t be started with the following error: Msg 18752, Level... More »


 

From the SQLServerCentral Blogs - SQL Server Automatic Tuning in the Real-World

jsterrett from SQLServerCentral Blogs

In SQL Server 2016 we saw Query Store.  Query Store was a game changer to help database administrators identify troublesome... More »

Question of the Day

Today's Question (by Steve Jones):

I have this code inside of the sample.py file.

 def TwiceThePrice(Price): Twice = Price * 2 print(Twice) 

I open a Python 3.5 REPL and import this file with this code:

 from sample import TwiceThePrice 

Now I edit the sample.py file in a text editor to add look like this:

 def TwiceThePrice(Price): Twice = Price * 2 print("$%d" % Twice) 

In the same REPL, I want to get the updated function definition with the dollar sign in the output. What should I do?

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


We keep track of your score to give you bragging rights against your peers.
This question is worth 1 point in this category: Python.

We'd love to give you credit for your own question and answer.
To submit a QOTD, simply log in to the Contribution Center.

ADVERTISEMENT

Exam Ref 70-774 Perform Cloud Data Science with Azure Machine Learning

Prepare for Microsoft Exam 70-774 and help demonstrate your real-world mastery of performing key data science activities with Azure Machine Learning services. Designed for experienced IT professionals ready to advance their status, Exam Ref focuses on the critical thinking and decision-making acumen needed for success at the MCSA level.  Get your copy today from Amazon.

Yesterday's Question of the Day

Yesterday's Question (by Steve Jones):

I have this table.

 CREATE TABLE UserConfig ( UserConfigKey INT IDENTITY(1,1) NOT NULL CONSTRAINT UserConfigPK PRIMARY KEY , UserID INT , IsActive BIT SPARSE , IsSubscriber BIT SPARSE , DefaultQuantity INT SPARSE )

How do I add a column set to this table?

Answer: This table needs to be dropped and recreated with the column set as part of the definition

Explanation:

A column set cannot be added to a table if there are already sparese columns. This table needs to be recreated with the column set in the original definition.

Ref: Use Column Sets - click here


» Discuss this question and answer on the forums

Featured Script

T-SQL to compress (shorten) IPv6 address

jianqing_ye from SQLServerCentral.com

select dbo.udf_IPAddrCompress('2a03:b600:0104:0000:0000:0200:0000:0000');

More »

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 : SQL Server 2017 - Development

JSON AUTO, WITHOUT_ARRAY_WRAPPER not returning all the columns - Hi I have this View with these fieldsSELECT     FisrtName         ,LastName         ,IDNumber         ,Address1         ,Address2


SQL Server 2016 : SQL Server 2016 - Administration

Question: Recover database with minimal data loss example question - Recover database with minimal data loss question Hope someone can help a bit.  I've been going through some practice questions online for...


SQL Server 2016 : SQL Server 2016 - Development and T-SQL

Why such a big log size? - I have a datamart with one main fact table that is about 45Gbs of data and 9Gbs of index It contains...


SQL Server 2014 : Administration - SQL Server 2014

Audit In SQL Server - I need to save an audit trail of changes made to some tables.

Replication Snapshot scheduling - How often is the good practice for replication snapshot schedule in sql server transactional replication? My understanding is that the...

Could not find stored Procedure error - Hello, Using SQL Server 2014, Visual Studio 2015 and IIS 8.0.9, using Windows Authentication I'm at my wit's end with this issue...

The database principal has granted or denied permissions to catalog objects in the database and cannot be dropped - Dear all, I get the following error message when trying to remove a login on SSISDB even though it has no...


SQL Server 2014 : Development - SQL Server 2014

Changing the case of letters in SQL - update of rows - Hi there I have a large table showing lists of world countries with some rows showing e.g. UNITED KINGDOM and some...

Is there a better way to write a simple query? - This is pretty typical SQL Code for me: -- SET NOCOUNT ON added to prevent extra result sets from  -- interfering...


SQL Server 2012 : SQL Server 2012 - T-SQL

Avoid duplicate values - Hey guys, Got this table and I want to avoid inserting the same records. CREATE TABLE . (   (255) NULL,   (50) NULL,  ...

HOW TO GET FIRST DATE - Dear all, I have data like:      NAME                             SPONSOR_NAME     DATE_OF_CALL        A                                    FI

Multiple Join Behaviour - Hi guys, I've read 2 or 3 articles on Multiple Joins but I'm still failing to understand exactly what's happening...


SQL Server 2008 : SQL Server 2008 - General

How can I get a set Date and Time Range between Yesterday and Today? - Hello, I am looking to create a query that will get data between Yesterday at 6AM until 1AM today.  Is there...

Shrink data file issue - Hi All  I shrank data file in a production database . at first the size was 99 GB , after shrinking it...

Disable TDE - Guys, What is the best way to disable TDE. I uncheck the "Set Database Encryption On property" but I am still...


SQL Server 2008 : SQL Server 2008 Administration

Log file doesn't clear after backup - I have two databases on a sql server 2008 r2 instance that are mirrored to a second server. I do...


SQL Server 2008 : Data Corruption (SS2K8 / SS2K8 R2)

DBCC CheckDB successful but Backup teminates (Msg 3203, Level 16, State 1, Line 3 Read failed: 23) - Following a SAN issue one database was marked Suspect. No other corruption was apparent on any of the system dbs...


Reporting Services : Reporting Services 2005 Administration

Exporting in Excel without cells or excel columns merging for one column of data table(need sorting, data filters perfectly) - Hi, I have an issue with the excel exporting of the report using ssrs. I am using only the body...


Reporting Services : SSRS 2016

SSRS Scale Out Deployment Behind F5 Load Balancer - Morning Guys, It has been dictated to me that I cannot use Microsofts' NLB and must use F5 instead. Has anyone had...


SQL Server 2005 : SQL Server 2005 Integration Services

SSIS Package Execution - Hi everyone, I am new to this subject (MSBI-SSIS).I have a question related to SSIS package. I am trying to execute the...

This email has been sent to newsletter@newslettercollector.com. 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.
Feel free to forward this to any colleagues that you think might be interested.
If you have received this email from a colleague, you can register to receive it here.
This transmission is ©2018 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved.
Contact: webmaster@sqlservercentral.com