|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: 2 days ago @ 8:46 AM
Points: 2,750,
Visits: 1,410
|
|
doobya (10/22/2008) Some very nice techniques and ideas in the article
But I have never rolled back a change to a production database in 10 years.
I rarely have to roll back a live deployment but deployments into a QA environment are another matter. And before anyone jumps up and down QA in this case is the environment where we throw testers and bloody minded users at systems to see if they can break the code.
As we move towards more agile practices the ability to rollback/deploy on the fly are important.
As far as tools are concerned you can use Red-Gate Compare and generate a snapshot of the schema. Cheap though the tool is not all companies see the benefit of buying a £400 tool against £x,000 in DBA time.
In terms of deleting columns from existing tables I take either the backup table approach or bcp the file and table create script out to a tape before I do it. It depends on how big the table is.
To be honest we are much more likely to add/change columns than delete them. When we do delete them we are pretty damn sure they will never be used again.
LinkedIn Profile
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Thursday, February 21, 2013 8:55 AM
Points: 219,
Visits: 807
|
|
Hi,
I can use something like SQL Compare which has been around for a while, has been thoroughly tested out by thousands of users, and probably does all (or almost all) this. Why should I spend my time on doing something which has been done before and works very well? Unless I am missing something, this sounds like reinventing the wheel. What am I missing?
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Monday, May 06, 2013 2:30 PM
Points: 143,
Visits: 191
|
|
Alexander Kuznetsov (10/22/2008) Hi,
I can use something like SQL Compare which has been around for a while, has been thoroughly tested out by thousands of users, and probably does all (or almost all) this. Why should I spend my time on doing something which has been done before and works very well? Unless I am missing something, this sounds like reinventing the wheel. What am I missing?
SQL Compare does not generate "rollback" scripts. The article was not about deployment scripts. It was about writing rollback scripts to undo the changes that SQL Compare would generate.
|
|
|
|
|
SSC-Insane
         
Group: General Forum Members
Last Login: Yesterday @ 9:37 PM
Points: 21,359,
Visits: 9,542
|
|
Stupid question here... but what happens if you reverse the order of the servers just after creating the migration scripts?
Doesn't that help you create the rollback scripts.
I'm sure it won't put back lost or altered data, but if that's the only thing left to worry about, it seems like a great start to me.
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Thursday, February 21, 2013 8:55 AM
Points: 219,
Visits: 807
|
|
hurcane (10/22/2008)
Alexander Kuznetsov (10/22/2008) Hi,
I can use something like SQL Compare which has been around for a while, has been thoroughly tested out by thousands of users, and probably does all (or almost all) this. Why should I spend my time on doing something which has been done before and works very well? Unless I am missing something, this sounds like reinventing the wheel. What am I missing?SQL Compare does not generate "rollback" scripts. The article was not about deployment scripts. It was about writing rollback scripts to undo the changes that SQL Compare would generate.
SQL Compare absolutely does generate rollback scripts. I do just that every time I deploy: open up SQL Compare, generate deploy/rollback scripts, test them both out, check them in in Subversion etc.
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Thursday, February 21, 2013 8:55 AM
Points: 219,
Visits: 807
|
|
| Just looked up in Subversion: more than one hundred rollback scripts, all generated by SQL Compare of course.
|
|
|
|
|
Right there with Babe
      
Group: General Forum Members
Last Login: Thursday, February 14, 2013 12:01 PM
Points: 743,
Visits: 900
|
|
This was an excellent article and well written. And I cannot overemphasize the point you made about code readability. In fact, I think my team is getting tired of me talking about literate programming.
--- Timothy A Wiseman SQL Blog: http://timothyawiseman.wordpress.com/
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Wednesday, May 09, 2012 10:26 AM
Points: 891,
Visits: 1,958
|
|
I teach readability by stressing that you're writing code for the person who follows you. It jolts their perception a bit to think that 'this previous project would have been so much easier if it had been better documented, so I'll document my current project better for the person who comes after me.'
Of course, some people, regardless of how well the case is argued, will never improve their documentation and readability. :D
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: 2 days ago @ 1:18 PM
Points: 215,
Visits: 610
|
|
I see what proposed in the article is an overkill most of time in SQL2K5 EE. For DB side rollback, is there anything better/quicker than the database snapshot? i.e. Do a db snapshot before the deployment, and if anything goes wrong, and you need to research, compare with the snapshot db, or if you want to rollback, rollback with the snapshot db.
Just my two cents... :)
Rgds, JY
|
|
|
|
|
SSC-Insane
         
Group: General Forum Members
Last Login: Yesterday @ 9:37 PM
Points: 21,359,
Visits: 9,542
|
|
jeffrey yao (10/25/2008) I see what proposed in the article is an overkill most of time in SQL2K5 EE. For DB side rollback, is there anything better/quicker than the database snapshot? i.e. Do a db snapshot before the deployment, and if anything goes wrong, and you need to research, compare with the snapshot db, or if you want to rollback, rollback with the snapshot db.
Just my two cents... :)
Rgds, JY
That's a good point Jeffrey, have you had any troubles with that method when you rolled back a failed deployement, any hints we need to know to use this method?
|
|
|
|