oracle 11g 如何导出空表

1.查询当前用户下的所有空表

select table_name from user_tables where num_rows=0 or num_rows is null

2.根据上述查询的语句,可以构建针对空表分配空间的命令语句,具体如下;

select 'alter table '||table_name||' allocate extent;' from user_tables where num_rows=0 or num_rows is null

 

3.上述代码可产生批量的修改表extent的SQL语句(有多少张空表就产生多少条),我们只需要将其生成的所有sql代码全部执行,就可以给每一张已经存在的表来分配空间。

参考:http://blog.sina.com.cn/s/blog_5f0e9ca50101it7n.html

猜你喜欢

转载自blog.csdn.net/bojinyanfeng/article/details/86605826