oracle中imp命令Linux下使用

首先root登录

切换到oracle用户

su - oracle

1. 获取帮助

imp help=y

2. 导入一个完整数据库

imp system/manager file=bible_db log=dible_db full=y ignore=y

3. 导入一个或一组指定用户所属的全部表、索引和其他对象

imp system/manager file=seapark log=seapark fromuser=seapark

imp system/manager file=seapark log=seapark fromuser=(seapark,amy,amyc,harold)

4. 将一个用户所属的数据导入另一个用户

imp system/manager file=tank log=tank fromuser=seapark touser=seapark_copy

imp system/manager file=tank log=tank fromuser=(seapark,amy) touser=(seapark1, amy1)

5. 导入一个表

imp system/manager file=tank log=tank fromuser=seapark TABLES=(a,b)

6. 从多个文件导入

imp system/manager file=(paycheck_1,paycheck_2,paycheck_3,paycheck_4) log=paycheck,filesize=1G full=y

7. 使用参数文件

imp system/manager parfile=bible_tables.par

bible_tables.par参数文件:

#Import the sample tables used for the Oracle8i Database Administrator's

#Bible.

fromuser=seapark touser=seapark_copy file=seapark log=seapark_import

8. 增量导入(9i中已经取消)

imp system./manager inctype= RECTORE FULL=Y FILE=A


数据的导入
  1 将D:daochu.dmp 中的数据导入 TEST数据库中。
   imp system/manager@TEST file=d:daochu.dmp
   imp aichannel/aichannel@HUST full=y file=file= d:data ewsmgnt.dmp ignore=y 
   上面可能有点问题,因为有的表已经存在,然后它就报错,对该表就不进行导入。
   在后面加上 ignore=y 就可以了。
  2 将d:daochu.dmp中的表table1 导入
  imp system/manager@TEST file=d:daochu.dmp tables=(table1) 

原文地址:https://www.cnblogs.com/wpcnblog/p/12506428.html