Oracle 11g rename. Guaranteed to be atomic?

前端 未结 5 1815
伪装坚强ぢ
伪装坚强ぢ 2021-01-13 13:00

I have some (5) rename statements in a plsql script

drop table new;
rename old to new;

\"old\" tables hold very valuable information.

5条回答
  •  佛祖请我去吃肉
    2021-01-13 13:53

    Rename will be atomic, so you should be fine. As APC has noted,

    I can't imagine how a renaming would cause you to lose your data.

    The only thing I can see in your script would be the time after the drop and before the rename, there is no new table, so potentially some SQL may fail. However, that time will be pretty short and anything more complicated (like an Insert From Select) would be even more problematic.

提交回复
热议问题