导出空表表结构方法

 在导出数据库dmp文件时,有数据库表空记录的情况下,该空表不会被导出表结构,应用如下格式代码:

select 'alter table ' || table_name || ' allocate extent(size 64k);' sql_text,
       table_name,
       tablespace_name
  from user_tables
 where 1=1
 and table_name like '%'
 and table_name not in
       (select segment_name from user_segments where segment_type = 'TABLE');
View Code
posted @ 2017-05-22 09:01  GLing  阅读(559)  评论(0编辑  收藏  举报