oracleamazon-web-servicesrds

How to export using DATA_PUMP to S3 bucket?


We have RDS (Oracle) instance, I need to export specific Schema into dumpfile. Export works and copies dump file into DATA_PUMP_DIR. Issue is that RDS do not have file directory access.

I need exported DMP file either on S3 or copy to another EC2 instance.

The article: LINK talks about copying data dump file between two RDS instances but not to S3 or EC2.


Solution

  • Third option. I am using it.

    1. Take a look at alexandria-plsql-utils project, and especially look at: amazon_aws_auth_pkg, amazon_aws_s3_pkg and ftp_util_pkg packages.

    2. Install required packages and dependencies.

    3. Do your dump, then with such example code below you can copy file from Amazon RDS Oracle into S3 bucket.

      declare
         b_blob blob;
      begin
         b_blob := file_util_pkg.get_blob_from_file ('DATA_PUMP_DIR', 'my_dump.dmp');
         amazon_aws_auth_pkg.init ('aws_key_id','aws_secret', p_gmt_offset => 0);
         amazon_aws_s3_pkg.new_object('my-bucket-name', 'my_dump.dmp', b_blob, 'application/octet-stream');
       end;
      

      `