简体   繁体   English

windows下如何通过SqlDeveloper或CMD将dmp文件导入oracle DB?

[英]How to import dmp file to oracle DB via SqlDeveloper or CMD in windows?

I have an Oracle dump file that got exported from an unfamiliar database.我有一个从陌生数据库导出的 Oracle 转储文件。 I need to import it to my Oracle DB with either SqlDeveloper or command line in windows.我需要使用 Windows 中的 SqlDeveloper 或命令行将其导入我的 Oracle DB。 When using Data Pump Import Wizard in SqlDeveloper I'm getting the below error: ORA-00942: table or view does not exist在 SqlDeveloper 中使用数据泵导入向导时,出现以下错误: ORA-00942: table or view does not exist

When using the CMD I'm getting the below error: ORA-39002: invalid operation ORA-39070: Unable to open the log file. ORA-29283: invalid file operation ORA-06512: at "SYS.UTL_FILE", line 536 ORA-29283: invalid file operation使用 CMD 时出现以下错误: ORA-39002: invalid operation ORA-39070: Unable to open the log file. ORA-29283: invalid file operation ORA-06512: at "SYS.UTL_FILE", line 536 ORA-29283: invalid file operation ORA-39002: invalid operation ORA-39070: Unable to open the log file. ORA-29283: invalid file operation ORA-06512: at "SYS.UTL_FILE", line 536 ORA-29283: invalid file operation

My command line:我的命令行:

impdp USER/password DUMPFILE=c:\\folder_name\\file_name.dmp TABLES=All LOG=dump_log.log

I tried different variations and each time the same error.我尝试了不同的变体,每次都出现相同的错误。

Thank you for your help.感谢您的帮助。

The command is missing the directory or the files in the proper directory on the db server.该命令缺少 db 服务器上正确目录中的目录或文件。 The default is DATA_PUMP_DIR which can be found from the DB as follow.默认值为DATA_PUMP_DIR ,可以从 DB 中找到,如下所示。

SQL>  SELECT directory_name, directory_path FROM dba_directories
  2   WHERE directory_name='DATA_PUMP_DIR';
DIRECTORY_NAME    DIRECTORY_PATH
_________________ _________________________________________________________________
DATA_PUMP_DIR     /opt/oracle/admin/ORCL/dpdump/8967C87908440D12E053020011AC6F8A

To make a new directory:要创建一个新目录:

CREATE DIRECTORY MY_DIR AS 'c:\\folder_name\\'; CREATE DIRECTORY MY_DIR AS 'c:\\folder_name\\';

Then add the directory and remove the path from the file parameter.然后添加目录并从文件参数中删除路径。

impdp USER/password directory=MY_DIR  DUMPFILE=file_name.dmp TABLES=All LOG=dump_log.log 

ref:参考:

IMPDP > https://docs.oracle.com/cd/E11882_01/server.112/e22490/dp_import.htm#SUTIL907 IMPDP > https://docs.oracle.com/cd/E11882_01/server.112/e22490/dp_import.htm#SUTIL907

Create directory > https://docs.oracle.com/cd/E11882_01/server.112/e41084/statements_5007.htm#SQLRF01207创建目录 > https://docs.oracle.com/cd/E11882_01/server.112/e41084/statements_5007.htm#SQLRF01207

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM