Imp导入与exp导出,Imp导入exp导出
按方案导入(须加log文件):
C:\Users\Administrator>exp scott/scott@orcl11g file='d:/temp/1.dmp' log='d:/temp/log.log'
导出注意事项:导出的是当前用户的的数据,当前用户如果有DBA的权限,则导出所有数据!所以 full=y要确定应用环境
C:\Users\Administrator>exp scott/scott@orcl11g file='d:/temp/1.dmp' log='d:/temp/log.log' full=y
导出特定表
C:\Users\Administrator>exp scott/scott@orcl11g file='d:/temp/1.dmp' log='d:/temp/log.log' tables=scott.dept
将数据库中system用户与sys用户的表导出
exp scott/scott@orcl11g file=d:\daochu.dmp owner=(system,sys)
将数据库中的表emp中的字段empno以"79"打头的数据导出
exp scott/scott@orcl11g file=d:\scott.dmp tables=(emp) query=\" where empno like '79%'\"
不同名之间的数据导入:(按方案导入导出)
C:\Users\Administrator>imp scott2/scott2@orcl11g file='d:/temp/1.dmp' log='d:/temp./1.log' fromuser=scott touser=scott2
同名之间数据导入
C:\Users\Administrator>imp scott2/scott2@orcl11g file='d:/temp/1.dmp' log='d:/temp./1.log'
imp hkb/hkb@xe file=c:\orabackup\hkbfull.dmp log=c:\orabackup\hkbimp.log full=y
是可以实现的,我测试了一下你看看
数据导出:
1 将数据库TEST完全导出,用户名system 密码manager 导出到D:\daochu.dmp中
exp system/manager@TEST file=d:\daochu.dmp full=y
2 将数据库中system用户与sys用户的表导出
exp system/manager@TEST file=d:\daochu.dmp owner=(system,sys)
3 将数据库中的表inner_notify、notify_staff_relat导出
exp aichannel/aichannel@TESTDB2 file= d:\data\newsmgnt.dmp tables=(inner_notify,notify_staff_relat)
4 将数据库中的表table1中的字段filed1以"00"打头的数据导出
exp system/manager@TEST file=d:\daochu.dmp tables=(table1) query=\" where filed1 like '00%'\"
--测试语句(注意替换下回车)
exp Usename/passwd@sid file=d:\t
est.dmp query=\" where columnname between DATE '2004-04-05' AND DATE '2004-04-10
'\" tables=(tablename)
exp help=y
imp help=y
说的很清楚
数据库归档不归档都可以,scott是一个用户名,tiger是这个用户的密码,举两个例子
exp scott/tiger owner=scott file=temp.dmp log=temp.log
exp scott/tiger tables=(emp,dept) file=temp.dmp log=temp.log