针对大表,如果直接alter table1 drop (column1,column2);
或者alter table1 drop column column1;和alter table1 drop column column2; 的话,需要执行很长时间,这期间该表被锁,会影响到其它应用。
使用set unused,等系统空闲时再drop unused。
可以使用 SET UNUSED 选项标记一列或者多列不可用。使用DROP SET UNUSED 选项删除被被标记为不可用的列。
每1000笔资料commit一次。
SQL> select count(1) from t11;
COUNT(1)
----------
30100005
alter table t11 set unused column name;
alter table t11 drop unused columns checkpoint 1000;
版权声明:本文为博主原创文章,未经博主允许不得转载。
oracle
- 上一篇:Oracle使用外部身份认证登录数据库
- 下一篇:oracle唯一索引转化为普通索引