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';