简体   繁体   English

在Oracle 12g中使用DBMS_DATAPUMP导入Oracle Dump时出错

[英]Error while importing oracle dump using DBMS_DATAPUMP in oracle 12g

I have been trying to import a dump file into Oracle 12g under RDS in AWS and getting below error all the time and I can't figure it out on what is happening. 我一直试图将转储文件导入AWS的RDS下的Oracle 12g中,并且一直都在错误以下,我无法弄清发生了什么。 Any help or pointers are greatly appreciated. 任何帮助或指针,我们将不胜感激。

Here is what I am trying to do. 这是我想要做的。

1) I got a .dat dump file from customer (not sure how they have exported this dump from oracle) and my aim is to import this to AWS oracle RDS instance. 1)我从客户那里获得了一个.dat转储文件(不确定他们是如何从oracle导出此转储的),我的目标是将其导入到AWS oracle RDS实例。

2) As per How to transfer Oracle dump file to AWS RDS instance? 2)按照如何将Oracle转储文件传输到AWS RDS实例?

I have created new EC2 instance and installed Oracle Express edition and then copied .dat file to DATA_PUMP_DIR directory ( /u01/app/oracle/admin/XE/dpdump/ ). 我创建了新的EC2实例并安装了Oracle Express版本,然后将.dat文件复制到DATA_PUMP_DIR目录( /u01/app/oracle/admin/XE/dpdump/ )。

3) Created database link to AWS oracle RDS instance and able to copy this to rds instance using DBMS_FILE_TRANSFER.PUT_FILE . 3)创建到AWS oracle RDS实例的数据库链接,并能够使用DBMS_FILE_TRANSFER.PUT_FILE将其复制到rds实例。

4) I can see the file under DATA_PUMP_DIR path in oracle rds instance. 4)我可以在oracle rds实例的DATA_PUMP_DIR路径下看到该文件。

so far so good. 到现在为止还挺好。

5) Now, I am trying to import the dump file into RDS using below procedure 5)现在,我正在尝试使用以下过程将转储文件导入RDS

DECLARE
hdnl NUMBER;
BEGIN
hdnl := DBMS_DATAPUMP.OPEN( operation => 'IMPORT', job_mode => 'SCHEMA', job_name => null);
DBMS_DATAPUMP.ADD_FILE( handle => hdnl, filename => 'sample.dat', directory => 'DATA_PUMP_DIR');
DBMS_DATAPUMP.START_JOB(hdnl);
END;
/  

All the time I get below error 我一直都低于错误

DECLARE
*
ERROR at line 1:
ORA-39001: invalid argument value
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 79
ORA-06512: at "SYS.DBMS_DATAPUMP", line 4087
ORA-06512: at "SYS.DBMS_DATAPUMP", line 4338
ORA-06512: at line 5

I understand the error is pointing to the line DBMS_DATAPUMP.ADD_FILE() but I could not able to make out what is wrong here. 我知道该错误指向DBMS_DATAPUMP.ADD_FILE()但我无法确定这里出了什么问题。

I have tried various options to import but none helped. 我尝试了各种导入选项,但没有一个帮助。 I have created tablespace and also make sure user is having correct permissions. 我已经创建了表空间,并且还确保用户具有正确的权限。

Any pointers are greatly appreciated. 任何指针,不胜感激。

1)Connect to the RDS instance with the Amazon RDS master user account. 1)使用Amazon RDS主用户帐户连接到RDS实例。

2) Run this pl/sql block 2)运行此pl / sql块

    DECLARE
    hdnl NUMBER;
    BEGIN
    hdnl := DBMS_DATAPUMP.OPEN( operation => 'IMPORT', job_mode => 'SCHEMA', job_name=>null);
    DBMS_DATAPUMP.ADD_FILE( handle => hdnl, filename => 'sample_copied.dmp', directory => 'DATA_PUMP_DIR', filetype => dbms_datapump.ku$_file_type_dump_file);
    DBMS_DATAPUMP.METADATA_FILTER(hdnl,'SCHEMA_EXPR','IN (''SCHEMA_NAME'')');
    DBMS_DATAPUMP.START_JOB(hdnl);
    END;

/ 

3) You can start importing from any oracle client. 3)您可以开始从任何oracle客户端导入。 For example, Instance EC2. 例如,实例EC2。

impdp RDS_master_user/password@rds_instance DUMPFILE=sample.dmp   DIRECTORY=DATA_PUMP_DIR parfile=import_parfile

import_parfile import_parfile

SCHEMAS =SCHEMA_NAME

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

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