由于对大表dorp column很耗时,可以先用 set unused逻辑删除,等找到时间窗口再做物理删除,
所以usused的列是不可以恢复的。
create table t ( x int not null, y int not null, z int not null);
insert into t values (1,2,3);
commit;
alter table t set unused column z;
查看有unused列的表
select * from user_UNUSED_COL_TABS where table_name='T';
物理删除unused列
alter table t DROP UNUSED columns;
对于大表可以加checkpoint来减少undo的使用
ALTER TABLE t DROP UNUSED COLUMNS CHECKPOINT 1000;
删除正常列会导致所有unused列被删除
ALTER TABLE t DROP COLUMN x;
同时前面unused列"z"也会被删除
所以usused的列是不可以恢复的。
create table t ( x int not null, y int not null, z int not null);
insert into t values (1,2,3);
commit;
alter table t set unused column z;
查看有unused列的表
select * from user_UNUSED_COL_TABS where table_name='T';
物理删除unused列
alter table t DROP UNUSED columns;
对于大表可以加checkpoint来减少undo的使用
ALTER TABLE t DROP UNUSED COLUMNS CHECKPOINT 1000;
删除正常列会导致所有unused列被删除
ALTER TABLE t DROP COLUMN x;
同时前面unused列"z"也会被删除
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/37279/viewspace-2136410/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/37279/viewspace-2136410/