Oracle如何导出空表?

来源:互联网 发布:淘宝口红代购ysl 编辑:程序博客网 时间:2024/05/01 18:17
        1、先查询一下当前用户下的所有空表
select table_name from user_tables where NUM_ROWS=0;

        2、用以下这句查找空表
select 'alter table '||table_name||' allocate extent;' from user_tables where num_rows=0

        把查询结果导出,执行导出的语句

'ALTERTABLE'||TABLE_NAME||'ALLOCATEEXTENT;'-----------------------------------------------------------alter table AQ$_AQ$_MEM_MC_H allocate extent;alter table AQ$_AQ$_MEM_MC_G allocate extent;alter table AQ$_AQ$_MEM_MC_I allocate extent;alter table AQ$_AQ_PROP_TABLE_T allocate extent;alter table AQ$_AQ_PROP_TABLE_H allocate extent;alter table AQ$_AQ_PROP_TABLE_G allocate extent;alter table AQ$_AQ_PROP_TABLE_I allocate extent;alter table AQ$_KUPC$DATAPUMP_QUETAB_T allocate extent;alter table AQ$_KUPC$DATAPUMP_QUETAB_H allocate extent;alter table AQ$_KUPC$DATAPUMP_QUETAB_G allocate extent;alter table AQ$_KUPC$DATAPUMP_QUETAB_I allocate extent;
3、然后再执行导出即可。

0 0
原创粉丝点击