问题描述
我已遵循 AWS将数据导入RDS 指南.
我已将.dmp
文件从另一台计算机上的源Oracle实例复制到RDS实例上的DATA_DUMP_DIR
.
I have copied the .dmp
file from Source Oracle Instance on another machine to the DATA_DUMP_DIR
on RDS Instance.
现在,我正在尝试使用以下代码导入它:
Now I am trying to import it using the code below:
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 (''CORE_API'',''CORE_DAP'', ''CORE_MD'', ''CORE_ST'', ''CORE_BI'', ''CORE_MAPI'', ''CORE_MAPI_LOG'', ''CORE_LEG'')');
DBMS_DATAPUMP.METADATA_REMAP(hdnl,'REMAP_TABLESPACE','LOG','STORAGE_DATA');
DBMS_DATAPUMP.METADATA_REMAP(hdnl,'REMAP_TABLESPACE','CORE_LEG_TBS','LEG_DATA');
dbms_datapump.metadata_transform ( hdnl, 'OID' , 0 , null ) ;
DBMS_DATAPUMP.START_JOB(hdnl);
END;
/
当我在sqlplus
中执行上述操作时,我得到:
When I execute above in sqlplus
, I get:
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 3507
ORA-06512: at "SYS.DBMS_DATAPUMP", line 3756
ORA-06512: at line 5
如何使以上内容起作用? AWS Doc非常抽象&我发现其余的东西也无济于事.
How do I get the above to work? AWS Doc is very abstract & rest of the stuff I found isn't helping either.
推荐答案
1)使用Amazon RDS主用户帐户连接到RDS实例.
1)Connect to the RDS instance with the Amazon RDS master user account.
2)运行此pl/sql块
2) Run this pl/sql block
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 (''CORE_API'',''CORE_DAP'', ''CORE_MD'', ''CORE_ST'', ''CORE_BI'', ''CORE_MAPI'', ''CORE_MAPI_LOG'', ''CORE_LEG'')');
DBMS_DATAPUMP.METADATA_REMAP(hdnl,'REMAP_TABLESPACE','LOG','STORAGE_DATA');
DBMS_DATAPUMP.METADATA_REMAP(hdnl,'REMAP_TABLESPACE','CORE_LEG_TBS','LEG_DATA');
DBMS_DATAPUMP.START_JOB(hdnl);
END;
/
3)您可以开始从源Oracle实例导入.例子
3) You can start importing from a Source Oracle Instance.Example
impdp RDS_master_user/password@rds_instance DUMPFILE=sample_copied.dmp DIRECTORY=DATA_PUMP_DIR parfile=import_parfile
import_parfile
import_parfile
REMAP_TABLESPACE=LOG:STORAGE_DATA
REMAP_TABLESPACE=CORE_LEG_TBS:LEG_DATA
SCHEMAS =CORE_API,CORE_DAP,CORE_MD,CORE_ST,CORE_BI,CORE_MAPI,CORE_MAPI_LOG, CORE_LEG
这篇关于在AWS RDS Oracle DB中导入.dmp文件时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!