从文档:
ORA-39088:文件名不能包含路径规范
原因:转储文件、日志文件或 sql 文件的名称包含路径规范。
行动:使用目录对象的名称来指示文件应该存储在哪里。
这表明您显示的参数DUMPFILE=db.dmp
实际上类似于DUMPFILE=C:\some\dir\path\db.dmp
,这是不允许的。您必须使用数据库识别的目录并使用DIRECTORY
参数指定它。
正如@ruffin 从该目录参数链接中指出的那样,您可以将转储文件放在默认DATA_PUMP_DIR
目录中,您可以从dba_directories
视图中找到该目录,或者,如果您有权使用该对象,则可以从视图中找到all_directories
。您要导入的用户必须已被授予读取和写入权限,您才能使用它。您还需要能够将转储文件移动到操作系统目录中,因此那里的权限也可能是一个问题。
If you don't have a suitable directory object that you have database privileges for and operating-system access to, you'll need to create one and grant suitable privileges. This needs to be done by someone with the appropriate privileges, usually as SYS
:
create directory my_data_pump_dir as 'C:\some\dir\path';
grant read, write on directory my_data_pump_dir to <username>;
Then the import is modified to have:
... DUMPFILE=db.dmp DIRECTORY=my_data_pump_dir
Note that the operating system directory has to be available to the Oracle user account (whoever is running the database processes, pmon
etc.) on the database server. You cannot import to a remote database using a local file, unless the local directory is somehow mounted on the remote server. The old imp
command was a client-side application that often ran on the server but didn't have to; impdp
is a server-side application.