Oracle 11g导出空表、少表的解决办法

执行下面语句:

begin
  for obj in (select ‘alter table ‘||table_name||‘ allocate extent‘ objsql from user_tables where num_rows=0) loop
    execute immediate obj.objsql;
  end loop;
end;

==================================================================================

批量处理空表

       首先使用下面的sql语句查询一下当前用户下的所有空表

select table_name from user_tables where NUM_ROWS=0;

  然后用一下sql语句执行查询

select alter table ||table_name|| allocate extent;from user_tables where num_rows=0

  假设我们这里有空表TBL_1,TBL_2,TBL_3,TBL_4,则查询结果如下:

alter table TBL_1 allocate extent; alter table TBL_2 allocate extent; alter table TBL_3 allocate extent; alter table TBL_4 allocate extent;

  最后我们把上面的sql语句执行就可以了。

相关文章

Java Oracle 结果集是Java语言中处理数据库查询结果的一种方...
Java AES和Oracle AES是现代加密技术中最常使用的两种AES加密...
Java是一种广泛应用的编程语言,具备可靠性、安全性、跨平台...
随着移动互联网的发展,抽奖活动成为了营销活动中不可或缺的...
Java和Oracle都是在计算机领域应用非常广泛的技术,他们经常...
Java 是一门非常流行的编程语言,它可以运行于各种操作系统上...