Oracle导入转储文件抛出ORA-39088错误

发布于 2025-01-04 19:01:59 字数 424 浏览 3 评论 0原文

我正在尝试从 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

:这个错误的原因是什么?

I am trying to import data from a dump file created by Oracle 10g data pump utility. The command that I am issuing is

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

I am getting the following error message:

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

What is the cause of this error?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

糖果控 2025-01-11 19:01:59

来自文档

ORA-39088: 文件名不能包含路径规范
原因:转储文件、日志文件或 sql 文件的名称包含路径规范。
操作:使用目录对象的名称来指示文件的存储位置。

这表明您显示为 DUMPFILE=db.dmp 的参数实际上类似于 DUMPFILE=C:\some\dir\path\db.dmp,即不允许。您必须使用数据库识别的目录并使用 DIRECTORY参数。


正如@ruffin 在该目录参数链接中指出的那样,您可以将转储文件放在默认的 DATA_PUMP_DIR 目录中,您可以从 dba_directories 视图中找到该目录,或者如果您有权限的话要使用该对象,即 all_directories 视图。您导入的用户必须已被授予读写权限才能使用它。您还需要能够将转储文件移动到操作系统目录中,因此权限也可能是一个问题。

如果您没有具有数据库权限和操作系统访问权限的合适目录对象,则需要创建一个并授予合适的权限。这需要由具有适当权限的人来完成,通常是 SYS

create directory my_data_pump_dir as 'C:\some\dir\path';
grant read, write on directory my_data_pump_dir to <username>;

然后将导入修改为:

... DUMPFILE=db.dmp DIRECTORY=my_data_pump_dir

请注意,操作系统目录必须可供 Oracle 用户帐户使用(无论谁正在运行数据库服务器上的数据库进程(pmon 等)。您无法使用本地文件导入到远程数据库,除非本地目录以某种方式安装在远程服务器上。旧的 imp 命令是一个客户端应用程序,通常在服务器上运行,但并非必须如此; impdp 是一个服务器端应用程序。

From the documentation:

ORA-39088: file name cannot contain a path specification
Cause: The name of a dump file, log file, or sql file contains a path specification.
Action: Use the name of a directory object to indicate where the file should be stored.

This suggests that the parameter you've shown as DUMPFILE=db.dmp is really something like DUMPFILE=C:\some\dir\path\db.dmp, which is not allowed. You have to use a directory that is recognised by the database and specify it with a DIRECTORYparameter.


As @ruffin notes from that directory parameter link, you can put the dump file in the default DATA_PUMP_DIR directory, which you can find from the dba_directories view or, if you have permission to use that object, the all_directories view. The user you're importing as has to have been granted read and write privileges on that for you to be able to use it. You also need to be able to move your dump file into the operating-system directory, so permissions may be an issue there too.

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文