之前都是玩9i,10g,最近把一个10G上的exp 的 dmp imp 11gR2的实例里,再exp出一个rows=n compress=y的dmp,再用这个dmp imp至另一个用户时,发现所有的无数据表全没了?困惑…问了一圈人,都没见过这问题,还是上网查吧,果然有结论:
http://mocca3in1.javaeye.com/blog/739023
一、使用expdp,impdp(注意:这两命令仅能在数据服务器上使用)
下面是我的expdp,impdp实例:
1.先sys执行一下这个:创建系统目录,并分配给指定用户
create directory dpdata1 as 'G:\project_dmp';
grant read, write on directory dpdata1 to dev;
2.导出(cmd窗口执行)
expdp dev/dev directory=dpdata1 dumpfile=dev_20110117.dmp logfile=dev_20110117.log
3.create一个新用户new,导入(cmd窗口执行)
impdp new/new directory=dpdata1 dumpfile=dev_20110117.dmp logfile=dev_new_20110117_imp.log remap_schema=dev:new remap_tablespace=from:to
二、如果还是想用exp\imp导出导入(可以在客户端机上执行啊)
执行此语句产生的脚本 (原理:为所有空表分配segment)
select 'alter table '||table_name||' allocate extent;'from user_tables where num_rows=0
然后像往常一样使用exp\dmp即可。
其它参考资料: