Tuesday, May 22, 2018

Oracle AWS RDS Import/Export with datapump

Oracle AWS RDS Import/Export with datapump

Introduction

The AWS documentation about using Oracle data pump is very un-clear and very difficult for non-DBA to understand. This article provides you an easy to follow example on how to use data pump with AWS RDS Oracle:
  • We have a need to export AWS RDS oracle database data from one VPC to another VPC.
  • There is no direct network connectivites between these two VPC. 
  • We access these VPCs from a 3rd network via SSH.
  • AWS RDS Oracle database support datadump as a mean to export/import data.
  • To accomplish the task, we set the following: 

Taskes on the source VPC

Setup an Oracle instance on EC2 instance in source VPC

Take a look on the "oracle-12C-installation" article that I wrote.

Setup Directory Object on Source EC2 Oracle Instance

  • SSH to the EC2 instance with Oracle installed.
  • Create a directory
mkdir /home/oracle/dumps
  • login to Oracle as sys user to the database and create a directory object
$ sqlplus / as sysdba
reate directory mydumps as '/home/oracle/dumps';
Directory created.
The above example create a data dump directory call "mydumps" in Oracle and point to the local direct "/home/oracle/home"
  • You can use the user system to perform backup
  • If you want to use different user, such as backup_user to perform the backup, create and grant permission to this user
SQL > grant read,write on directory dumps to backup_user;
SQL > grant datapump_exp_full_database backup_user;

1 comment: