导入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;执行完后可对数据库进行导出
本文介绍了解决Oracle数据库在导入dmp备份文件时遇到的空表无法导入的问题。通过查询并生成分配空间的SQL语句,确保空表在导入过程中能够被正确处理。
3285

被折叠的 条评论
为什么被折叠?



