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 Antworten
0
Akzeptierte Antwort

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; /

beantwortet vor 10 Monaten
0

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

beantwortet vor 10 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen