|
这个需求很常见了, 主要是alter table 过程中会有表级别的排他锁。 在这个级别即使select 都不行。
为了缩短整个时间 没有什么办法。 如果为了缩短年 表级别的排他锁,还是比较容易的。
altert table test add a int, b int; 锁表,但很快
update test set a=xx ,b= xxx where xxx; commit; 分批操作(正果过程中没有dml ,太适合这种做法了)
alter table test modify a default xx;
alter table test modify b deault xx; (这2步也很快)
这样整个过程就完成了。 |
|