EXP、EXPDP导出和IMP、IMPDP导入语句
当我们没有远程服务器系统操作权限,而只有远程数据库操作权限的时候,无法将DMP文件copy在服务器目录下,只能使用EXP和IMP操作。
EXP全库导出语句:
exp username/password@ip:port/servername file="E:\dmppath.dmp" full=y ignore=y;
IMP全库导入语句:
imp username/password@ip:port/servername file="E:\dmppath.dmp" full=y ignore=y;
IMP单表导入语句:
imp username/password@ip:port/servername file="E:\dmppath.dmp" tables=(emp) ignore=y;(如果是多张表可以用逗号隔开)
IMP只导入表结构(包含视图、函数,不含触发器和存储过程):
imp username/password@ip:port/servername file="E:\dmppath.dmp" fromuser=from_username touser=to_username rows=n;
IMP只导入数据:
imp username/password@ip:port/servername file="E:\dmppath.dmp" fromuser=c##from_username touser=to_username statistics=none ignore=y;
IMPDP数据泵导入:
impdp tzxmspsx/Tzxmsp123_hl@61.185.238.209:1521/tzxmsppub schemas=tzxmspsx directory=XSDDIR dumpfile=E:\TZXMSPDF1129.dmp logfile=exp.log
IMPDP更改表空间和用户导入:
impdp username/password@ip:port/servername directory=DATA_DIR dumpfile=example.DMP REMAP_SCHEMA=olduser:newuser remap_tablespace=oldtablespace:newtablespace,EXAMPLE_TEMP:newtablespace_temp