we have table that being used for sending sms and other notification for confirmation as second factor.
Some changes in business logic requires us to alter table to make some columns NOT NULL.
Our stumbling-stone is that table should be accessed during 24/7, application writes to and reads from it pretty frequently and table has tens of millions rows. And when command like
alter table NOTIFICATION_TABLE
alter column C1 int null
starting to execute it obviously tries to lock table and seemingly cannot do it because table is being used by other requests. That situation end up with that alter
command hangs out and nothing happened during 5 minutes. After that timeout we stop it because do not want occasionally crush our system.
Any thoughts about how we can implement this modification without stopping our system?
Best Answer