July 5, 2013 at 1:53 pm
hi
i am adding new column with default value
this table has millions of rows, so while i am executing my query ,its causing blocking to other user.
how to solve this
example
alter table emp
add column senti_v int default 0
thanks
July 8, 2013 at 2:10 am
Firstly, change the "add column" part to just "add".
Secondly, this kind of process will definitely take exclusive locks on the table which will block other processes.
I suggest that you run this process during a very quiet time or during a downtime period.
Regards
July 11, 2013 at 12:29 pm
You could add the column without a default value, that usually works quite quick.
Afterwards you could update the column in chunks of for example 1 Mio rows.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply