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달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠