How to transfer Oracle dump file to AWS RDS instance?

ε祈祈猫儿з 提交于 2019-12-02 11:39:15

问题


I have an existing .dmp file on EC2 instance which has access to RDS instance running Oracle 11g on AWS.

I have read Importing Data in AWS RDS, it seems that AWS does not support this kind of direct transfer.

It does require to have a Source Oracle DB from where you have to create/export a .dmp file which you can then transfer to destination RDS instance by establishing a db link.

My question is, is there a way I can transfer/import my existing .dmp file to the DATA_DUMP_DIR on RDS Instance?

Any suggestions?


回答1:


File access for the RDS instance is forbidden. Access to the DATA_PUMP_DIR directory only through the db_link and use DBMS_FILE_TRANSFER package.

  • Option 1

You can do the export of data using the old exp utility on the EC2 instance, this utility also creates export files .dmp, but for a different format. The format is not compatible with impdp expdp. The exp imp utility can connect over the SQL*NET network to the target database as client-server. This utility is obsolete and has less performance. The dmp file is not created on the server, as when running the utility expdp. The dmp file is written on the side where the utility exp is run (server or client)

$ORACLE_HOME/bin/exp parfile=parfile_exp_full FILE=export.dmp LOG=export.log

And then do the data import using the imp to RDS instance.

$ORACLE_HOME/bin/imp parfile=parfile_imp_full FILE=export.dmp LOG=import.log
  • Option 2

You can export the data to an CSV file using the utility $ORACLE_HOME/bin/sqlplus -s user/pass@ec2 @csv2.sql.

set heading off
set termout OFF
SET FEEDBACK OFF
SET TAB OFF
set pause off
set verify off
SET UNDERLINE OFF
set trimspool on
set echo off
set linesize 1000
set pagesize 0
set wrap off
spool test2.csv
select code||','||name||','||code_rail from alexs.all_station;
spool off
exit;

And then make the data import to RDS instance using the utility sqlldr.




回答2:


Eventually, I had to spin up another AWS Instance, Install Oracle XE on it, then place my dump file in the DATA_PUMP_DIR & then follow the AWS RDS Data Import guide.

It's pretty annoying that there is no other way to do this. And having no SSH access to the RDS instace just adds up to that! Also, the AWS Doc is not clear about the particulars.



来源:https://stackoverflow.com/questions/48378147/how-to-transfer-oracle-dump-file-to-aws-rds-instance

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!