Oracle 数据库导出全库(包含空表)

来源:互联网 发布:张家界导游软件app 编辑:程序博客网 时间:2024/04/29 22:37

导入Oracle数据库全库dmp备份文件时,提示找不到表和视图…..

原因是Oracle默认导出时,不导出空表

具体解决办法

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

用该语句查询数据库的空表,同时生产分配空间的语句,把导出结果保存到文件中tsv格式的,样例数据如下:

 alter table TBL_PORTALWB_LINK allocate extent; alter table TBL_VEHICLE_STORES_RELATION allocate extent; alter table TBL_VEHICLE_STORES allocate extent; alter table TBL_VEHICLE_PRIVATE_DETAIL allocate extent;

1、补充,若不行改用下面这个

select 'alter table '||table_name||' allocate extent(size 64k);' from tabs t where not exists (select segment_name from user_segments s where s.segment_name=t.table_name);

2、打开导出的文件,执行里边的sql;执行完后可对数据库进行导出

0 0
原创粉丝点击