EXP导出
- 导出某张表:
exp wjz/XXX@orcl file=/home/oracle/wjz.dmp tables=IP,T,TEMP log=/home/oracle/exp.log
- 导出某个用户的库:
exp wjz/XXX@orcl file=/home/oracle/wjz.dmp owner=wjz
- 导出用户全部数据库:
exp ywxy/ywxy@ORCL file=d:/daochu1.dmp full=y
- 其他
1. query指定要添加的条件,把表中的数据进行过滤导出。
exp student/123456@orcl file=d:\student.dmp tables= stuinfo buffer=4096 log=d:\student.log query="'where sex=1'"
2. 只导出表结构
exp ahtsp/ahtsp@106.12.129.118/orcl file=E:\ahtsp.dmp owner=ahtsp rows=n --rows=n不导数据只导表结构
IMP导入
imp scott/tiger@ORCL file=/home/oracle/expdat.dmp tables=IP
1. 导入时报错DBA权限问题,这时需要用到fromuser和touser
imp wjz/XXX@ORCL fromuser=wjz touser=scott file=/home/oracle/expdat.dmp tables=IP
2. 有的表已经存在,然后它就报错,对该表就不进行导入。 在后面加上 ignore=y 就可以了。
参考文章: