4

我正在尝试从 Oracle 10g 数据泵实用程序创建的转储文件中导入数据。我发出的命令是

impdp \"username/password@DB as sysdba\" remap_schema=SRC_SCHEMA:TARGET_SCHEMA remap_tablespace=source_tablespace:target_tablespace DUMPFILE=db.dmp

我收到以下错误消息:

ORA - 39001: Invalid argument value
ORA - 39000: Bad dump file spcification
ORA - 39088: file name cannot contain a path specification

这个错误的原因是什么?

4

1 回答 1

10

文档

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.

于 2012-02-13T10:53:19.617 回答