1. 設置導出文件路徑
sqlplus / as sysdba
SQL> alter session set container=spdb1pdb;
SQL> create directory dump as '/tmp/dumpdata';
ORA-00955: name is already used by an existing object
處理方法:語句優化
SQL> CREATE OR REPLACE DIRECTORY dump as '/tmp/dumpdata';
2. 數據泵導出
1)expdp user/passwd@localhost:1521/spdb1pdb directory=dump dumpfile=dump191018.dump logfile=dump191018.log cluster=n;
UDE-12541: operation generated ORACLE error 12541
ORA-12541: TNS:no listener
處理方法:查看tnsnames.ora文件設置,因HOST設置為scan-ip,將localhost修改為scan-ip
expdp user/passwd@scan-ip:1521/spdb1pdb directory=dump dumpfile=dump191018.dump logfile=dump191018.log cluster=n;
2)expdp user/passwd@scan-ip:1521/spdb1pdb directory=dump dumpfile=dump191018.dump logfile=dump191018.log cluster=n;
ORA-39002:invalid operation
ORA-39070:Unable to open the log file
處理方法:查看導出文件路徑是否存在,或者更換路徑
SQL> select * from dba_directories where DIRECTORY_NAME='DUMP';
SQL> CREATE OR REPLACE DIRECTORY dump as '/tmp/dumpdata';