Oracle Data Pump
Data Pump Export
Create directory object
// 先要手动创建目录
$ mkdir /home/oracle/dump_dir
$ sqlplus / as sysdba
SQL> CREATE OR REPLACE DIRECTORY dump_dir as '/home/oracle/dump_dir';
SQL> GRANT READ, WRITE ON DIRECTORY dump_dir TO HR;
Export
# 导出
$ expdp username/password \
SCHEMAS=HR \
DIRECTORY=dump_dir \
DUMPFILE=expdp_20210724.dmp \
LOGFILE=expdp_20210724.log
Data Pump Import
# 导入
$ impdp username/password \
DIRECTORY=dump_dir \
DUMPFILE=expdp_20210724.dmp \
LOGFILE=impdp_20210724.log \
SCHEMAS=HR