简体   繁体   中英

What is the best approach to use when upgrading a Database

We have a system that has a Mysql database with about 2Gigs of data.

The PC application that talks to the database has just been updated.

There are a number of tables whose structure have changed and we need to run a conversion script.

The system is only used in office hours

Question:

What is the best approach to doing this upgrade?

  1. Wait until no one is using the system (since that's an option for you, I would plan to do it after hours).
  2. Backup the database.
  3. Check your backup to make sure it worked.
  4. Double check you backup.
  5. Run the update script.
  6. Make sure your daily backup job still does what is needed (not usually an issue, but worth the energy to check).

A couple of other extra things. Let your users know you are going to do this even if it is after hours. The financial people get cranky when they plan to stay late to get W2s out (they have a legal deadline) and find out that they can't access the database.

If your database will allow you to put it into single user user mode, do this before making the changes. That way no one random person who is staying late will be able to make changes while you are midway through the change.

Be very ready to revert back in the morning when the users come back in if something is wrong. That means you need to be there at start of business even if you normally come in later.

There are basically two approaches. Both start with setting the database offline and creating a backup.

Then you could build the new database and copy to the new database.

Or you could update each table/query.

Then you could put the database back online.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM