Import using remap_schema for AWS RDS Oracle

0

Hi, I am trying to import an Oracle schema into an AWS RDS.

Usually in a Oracle database this data pump command will do it

impdp user/pwd@sid Directory=test logfile=imp.log dumpfile=dump.dmp schemas=test remap_schema=test:test_copy

If there an equivalent command in AWS RDS.

I have been using the following API to import schemas in AWS RDS

DECLARE hdnl NUMBER; BEGIN hdnl := DBMS_DATAPUMP.OPEN( operation => 'IMPORT', job_mode => 'SCHEMA', job_name=>null); DBMS_DATAPUMP.ADD_FILE( handle => hdnl, filename => '123xyz_prod.dmp', directory => 'DATA_PUMP_DIR', filetype => dbms_datapump.ku$_file_type_dump_file); DBMS_DATAPUMP.ADD_FILE( handle => hdnl, filename => '1234xyz.log', directory => 'DATA_PUMP_DIR', filetype => dbms_datapump.ku$_file_type_log_file); DBMS_DATAPUMP.METADATA_FILTER(hdnl,'SCHEMA_EXPR','IN (''TEST'')'); DBMS_DATAPUMP.START_JOB(hdnl); END; /

Can this be used to remap schemas, in the above case the export is of TEST schema and is being imported into TEST schema, Can I use this API to remap it to say TEST_CLONE schema?

Or can DMS be used to remap schemas

2 個答案
0
已接受的答案

I got the answer here is the API that is to be run, for those into similar situation

DECLARE hdnl NUMBER; BEGIN hdnl := DBMS_DATAPUMP.OPEN(operation => 'IMPORT', job_mode => 'SCHEMA', job_name => null); DBMS_DATAPUMP.ADD_FILE(handle => hdnl, filename => 'dump.dmp', directory => 'DATA_PUMP_DIR', filetype => dbms_datapump.ku$_file_type_dump_file); DBMS_DATAPUMP.ADD_FILE(handle => hdnl, filename => 'imp.log', directory => 'DATA_PUMP_DIR', filetype => dbms_datapump.ku$_file_type_log_file); DBMS_DATAPUMP.metadata_remap(handle => hdnl, name => 'REMAP_SCHEMA', old_value => 'TEST', value => 'TEST_COPY'); DBMS_DATAPUMP.START_JOB(hdnl); END; /

已回答 10 個月前
0

I am trying to import a schema but I want to remap it to a different schema

已回答 10 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南