Oracle导入转储文件抛出ORA-39088错误
我正在尝试从 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
来自文档:
这表明您显示为
DUMPFILE=db.dmp
的参数实际上类似于DUMPFILE=C:\some\dir\path\db.dmp
,即不允许。您必须使用数据库识别的目录并使用DIRECTORY
参数。正如@ruffin 在该目录参数链接中指出的那样,您可以将转储文件放在默认的 DATA_PUMP_DIR 目录中,您可以从 dba_directories 视图中找到该目录,或者如果您有权限的话要使用该对象,即
all_directories
视图。您导入的用户必须已被授予读写权限才能使用它。您还需要能够将转储文件移动到操作系统目录中,因此权限也可能是一个问题。如果您没有具有数据库权限和操作系统访问权限的合适目录对象,则需要创建一个并授予合适的权限。这需要由具有适当权限的人来完成,通常是
SYS
:然后将导入修改为:
请注意,操作系统目录必须可供 Oracle 用户帐户使用(无论谁正在运行数据库服务器上的数据库进程(
pmon
等)。您无法使用本地文件导入到远程数据库,除非本地目录以某种方式安装在远程服务器上。旧的imp
命令是一个客户端应用程序,通常在服务器上运行,但并非必须如此;impdp
是一个服务器端应用程序。From the documentation:
This suggests that the parameter you've shown as
DUMPFILE=db.dmp
is really something likeDUMPFILE=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 aDIRECTORY
parameter.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 thedba_directories
view or, if you have permission to use that object, theall_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
:Then the import is modified to have:
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 oldimp
command was a client-side application that often ran on the server but didn't have to;impdp
is a server-side application.