如何使用DATA_PUMP导出到S3存储桶? [英] How to export using DATA_PUMP to S3 bucket?

查看:176
本文介绍了如何使用DATA_PUMP导出到S3存储桶?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有RDS(Oracle)实例,我需要将特定的Schema导出到转储文件中.导出工作并将转储文件复制到DATA_PUMP_DIR.问题是RDS没有文件目录访问权限.

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.

我需要在S3上导出DMP文件,或者将其复制到另一个EC2实例.

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

文章: LINK 会谈关于在两个RDS实例之间复制数据转储文件,但不能复制到S3或EC2.

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

推荐答案

第三种选项.我正在使用它.

  1. 看看 alexandria-plsql-utils 项目,然后尤其要注意:amazon_aws_auth_pkgamazon_aws_s3_pkgftp_util_pkg软件包.

  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.

安装必需的软件包和依赖项.

Install required packages and dependencies.

进行转储,然后使用下面的示例代码,您可以将文件从Amazon RDS Oracle复制到S3存储桶.

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;

`

这篇关于如何使用DATA_PUMP导出到S3存储桶?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆