1、备份语句(数据库导出)
exp username/password@ip:port/servername file="C:\Users\Administrator\Desktop\kpms.bak" full=y ignore=y;
2、导入语句(数据库还原)
①全部导入:imp 用户名/密码@数据库实例名 full=y file=C:\Users\Administrator\Desktop\kpms.bak ignore=y;
②单表导入:imp username/password@ip:port/servername file="C:\kpms.dmp" tables=(emp) ignore=y;
③只导入表结构:imp username/password@ip:port/servername file="C:\kpms.dmp" fromuser=from_username touser=to_username rows=n;
④只导入数据:imp username/password@ip:port/servername file="C:\kpms.dmp" fromuser=c##from_username touser=to_username statistics=none ignore=y;
⑤更改表空间和用户导入:impdp username/password@ip:port/servername directory=DATA_DIR dumpfile=example.dmp REMAP_SCHEMA=olduser:newuser remap_tablespace=oldtablespace:newtablespace,EXAMPLE_TEMP:newtablespace_temp