0

I am in a small company and require to fix a bunch of data in production which are inconsistent. I have written the script to handle the fix.

I understand that writing sql to fix data is way more risky than working on fixes normal front end or backend code. For front end or back end, we can write thousands of test code to automatically test result or even little bug the affect might not be as dramatic.

How do you guys fix the data in production normally if many data was inconsistent? Are there any method or strategy which can reduce the risk

0

How do you guys fix the data in production

Very very carefully!

This may be too general a question: there are many variables involved regarding data size, error severity, how active that data is, what service level agreements you have with the client, ...

Some tips:

  1. Test the scripts in your dev/test environments as extensively as time allows.
  2. If you can, take a copy of the production system to test the scripts on. You probably need to do this on production services if your application handles PPI or other sensitive data.
  3. If you have an upcoming maintenance window when you can offline the production environment to test and apply the change (and rollback the DB if something goes wrong).
  4. If there is time in that window take a fresh copy of production database to retest before applying to production proper.
  5. Take a backup of production, so you can rollback if the update fails and makes more mess.
  6. Apply the change to production and test that the result is as desired.
  7. If all is well, drop the extra test copies and turn production back on, if not rollback to your backups and try again...

Of course if the data fix needs to be made more urgently, you may need to be much less cautious than the above list.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.