RDS - Restore Oracle Database backup with another name / service name in the same instance

0

Hello friends.

I have created a new RDS instance for my Oracle database. It is an instance of homologation.

I backed up my production database by exporting datapump. DBMS_DATAPUMP.open( operation => 'EXPORT', job_mode => 'SCHEMA' I uploaded my backup file to S3.

Then, I downloaded the backup (exported file) from S3, to the Datapump of the homologation instance.

Now, I'm trying to restore this backup, however, as it is an approval instance, I need to have more than one database, from the same application, that is, in the production environment, my database is called DBSYSTEM, and in my homologation environment, I need to restore this same database with other names in the same instance, like DBSYSTEM1, DBSYSTEM2, DBSYSTEM3...

But here I can't move forward.

DECLARE

hdnl NUMBER;

BEGIN

hdnl := DBMS_DATAPUMP.OPEN(operation=>'IMPORT', job_mode => 'SCHEMA', job_name => null);

DBMS_DATAPUMP.ADD_FILE( handle => hdnl, filename => 'exp_dbsystem.dmp', directory => 'DATA_PUMP_DIR', filetype => dbms_datapump.ku$_file_type_dump_file);

DBMS_DATAPUMP.ADD_FILE( handle => hdnl, filename => 'imp_dbsystem.log', directory => 'DATA_PUMP_DIR', filetype => dbms_datapump.ku$_file_type_log_file);

DBMS_DATAPUMP.METADATA_FILTER( handle => hdnl, name => 'SCHEMA_EXPR', value=> 'IN (''DBSYSTEM'')');

DBMS_DATAPUMP.METADATA_REMAP( handle=> hdnl, name => 'REMAP_SCHEMA', old_value => 'DBSYSTEM', value => 'DBSYSTEM2');

DBMS_DATAPUMP.METADATA_REMAP( handle=> hdnl, name => 'REMAP_TABLESPACE', old_value => 'DBSYSTEM_DATA', value => 'DBSYSTEM_DATA2);

DBMS_DATAPUMP.METADATA_REMAP( handle=> hdnl, name => 'REMAP_TABLESPACE', old_value => 'DBSYSTEM_INDEX ', value => 'DBSYSTEM_INDEX2');

DBMS_DATAPUMP.START_JOB(hdnl);

END;

When executing the above statement, the following is returned:

Bug report -

ORA-39001: invalid argument value

ORA-06512: in "SYS.DBMS_SYS_ERROR", line 79

ORA-06512: at "SYS.DBMS_DATAPUMP", line 4929

ORA-06512: at "SYS.DBMS_DATAPUMP", line 5180

ORA-06512: in line 5

Does anyone have any tips on how to resolve this issue?

I thank!

2 Answers
1

Hello,

From your query, I can understand that you are trying to restore a database in your instance using DATAPUMP and need to create multiple databases in the same instance using that backup. However you are getting some errors in performing the same.

As you have mentioned that you are facing the following errors:

ORA-39001: invalid argument value

ORA-06512: in "SYS.DBMS_SYS_ERROR", line 79

ORA-06512: at "SYS.DBMS_DATAPUMP", line 4929

ORA-06512: at "SYS.DBMS_DATAPUMP", line 5180

ORA-06512: in line 5

I would like to mention that these errors are quite generic errors and can happen due to even a minor syntax error. This error does not give much information about what actually is going wrong, hence, I would suggest raising a support case with AWS Premium Support so that the issue can be troubleshooted further. You can refer the following article to raise a case with the AWS Technical Support team:

[+] Contact AWS: https://aws.amazon.com/contact-us/

Furthermore, you can refer the following documentation which mentions how you can use the DATAPUMP Utility for RDS Oracle while importing your backups:

[+] Importing using Oracle Data Pump: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Oracle.Procedural.Importing.DataPump.html

AWS
SUPPORT ENGINEER
Vidit S
answered a year ago
0

Hi, An ORA-39001 error indicates that a parameter in the calls to DBMS_DATAPUMP is invalid. In your case, The error stack indicates that the error occurs on line 5 of the PL/SQL block, indicating that one of the parameters in below line is incorrect

DBMS_DATAPUMP.ADD_FILE( handle => hdnl, filename => 'exp_dbsystem.dmp', directory => 'DATA_PUMP_DIR', filetype => dbms_datapump.ku$_file_type_dump_file);
Please check the dump file referenced in the DBMS_DATAPUMP.ADD_FILE is correct and accessible, no permission issues etc.

AWS
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions