1.查看dump文件的基本信息
[oracle@redhat ~]$ strings example.dmp |head -10
2.得到dump中的表信息
[oracle@redhat ~]$strings example.dmp|grep "CREATE TABLE"|awk '{print $3}'|sed 's/"//g'
3.解析dump文件生成的parfile
[oracle@redhat ~]$ strings example.dmp|grep "CREATE TABLE"|awk '{print $3}'|sed 's/"//g'|awk '{ if(FNR==1) print "tables="$1 ; else print ","$1}'
4.导入dump时需要注意的隐患
(1)关于外键(得到的dump中的表可嵌入查看)
select 'alter table ' || table_name || ' distable constraint ' ||
constraint_name || ';'
from user_constraints
where constraint_type = 'R'
union all
select 'alter table ' || uca.table_name || ' distable constraint ' ||
uca.constraint_name || ';'
from user_constraints uca,
(select constraint_name
from user_constraints
where constraint_type in ('R', 'U')) tmp
where uca.constraint_type = 'R'
and tmp.constraint_name = uca.r_constraint_name;
(2)关于触发器(大多数情况下需要把触发器设置为disable)
select 'alter trigger '||trigger_name||' distable ; ' from user_triggers;
(3)关于buffer size
buffer size的设置在数据导入中也很重要;如果dump存在一个表较大的分区别,很有可能导致出现的buffer size不够的问题!可以设置一下buffer size 的大一点可以设置4M或者9M