Oracle逻辑导入数据(IMP/IMPDP)

使用IMPDP导入数据的前提是数据是使用EMPDP导出的,同样也是在DOS窗口下直接输入IMPDP和登录数据库的用户名,即可导人数据。

impdp导到指定用户下:

impdp student/123456@orcl DIRECTORY=dir DUMPFILE=student.dmp  logfile=student_imp.log SCHEMAS=student

  


1、directory指定的是目录对象,这里的目录对象就是在使用expdp导出时创建的目录对象。语法解析:

2、dumpfile指定的是要导入的dmp文件,

3、SCHEMAS指定要导入的数据是导入到哪个用户下。


impdp导入表空间:

impdp student/123456@orcl DIRECTORY=dir DUMPFILE=student_tablespace.dmp logfile=student_imp.log TABLESPACES=student

  


1、tablespaces指定要导入的是表空间下的所有对象和数据,这里导入的表空间为student表空间。语法解析:


impdp导入数据库:

impdp student/123456@orcl DIRECTORY=dir DUMPFILE=student_full.dmp logfile=student_imp.log full=y

  


1、full=Y指定要导入的是数据文件中全库数据,包括各种数据库对象。这里前提是dmp文件是全库导出的数据文件。语法解析:


impdp导入追加数据:

impdp student/123456@orcl DIRECTORY=dir DUMPFILE=student.dmp SCHEMAS=student TABLE_EXISTS_ACTION=append

  


1、利用 table_exists_action=append指定要导入的dmp文件中,当存在表已经在库里存在的情况下,会直接对表数据进行追加,而不会报错。语法解析:

dir为系统默认缺省值:DATA_PUMP_DIR

猜你喜欢

转载自www.cnblogs.com/achengmu/p/11834592.html