[英]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. 我们有一个系统,它有一个包含大约2Gig数据的Mysql数据库。
The PC application that talks to the database has just been updated. 与数据库通信的PC应用程序刚刚更新。
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? 进行此升级的最佳方法是什么?
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.
当他们计划迟到W2s(他们有一个合法的截止日期)并发现他们无法访问数据库时,财务人员会变得暴躁。
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. 然后你可以把数据库重新上线。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.