导出DMP文件:
CMD进入命令行;输入:
1、将数据库TEST完全导出,用户名username,密码password,数据库连接IP:URL,导出路径C:\files\MyDmp.dmp中
exp username/password@URL file=C:\files\MyDmp.dmp full=y
2、将数据库中username用户与sys用户的表导出
exp username/password@URL file=C:\files\MyDmp.dmp owner=(username,sys)
3、将数据库中的表table1 、table2导出
exp username/password@URL file=C:\files\MyDmp.dmp tables=(table1,table2)
4、将数据库中的表table1中的字段filed1以"00"打头的数据导出
exp username/password@URL file=C:\files\MyDmp.dmp tables=(table1) query=\" where filed1 like '00%'\"
导入DMP文件:
1、CMD进入命令行;输入:
imp userName/userPass@url:post/tableName file=fileURL\fileName.dmp log=c:file\log.log full=y ignore=y statistics=none
例如:
imp FTPXIB/vprisk@192.168.5.56:1521/orcl file=c:\file\ftpxib.dmp full=y ignore=y statistics=none
buffer缓冲区大小,64M,再往上也没有明显的性能提升
statistics:表示不导出分析数据
grants:相关对象的授权
consistent:确保在imp的时候,不会出现fk不能enable的情况
报错与解决:
1、oracle导入提示“IMP-00010:不是有效的导出文件,头部验证失败”
select * from v$version查看Oracle版本号(11.2.0.2.0)
进入dmp文件查看版本号(V11.03.00)
2、Oracle导入提示“IMP-00003:遇到 ORACLE 错误 20001,导入数据出现问题”
在导入语句后面加上statistics=none或statistics=recalculate即可
3、Oracle导入提示“IMP-00003: 遇到 ORACLE 错误 1917”
因为用户或角色不存在
先添加角色,再单独执行赋权限语句