How to impdp and expdp on AWS RDS

Introduction

On AWS RDS you do not have access to the server, so it can make life a bit more difficult, especially running simple DBA tasks such as impdp or expdp. This guide explains one of the methods you can use to perform these tasks without having access to the server.

This guide will explain how to expdp from one RDS instance and impdp into another RDS instance without the need to get access to the server using a database link

The following terms will be used

  • MySourceDB - The source RDS SID being exported
  • MySourceDBMasterPassword - The source RDS DBMASTER Password
  • MySourceHost - The source RDS Endpoint
  • MySourceDB - The source SID being exported
  • MyDestinationDBMasterID - The destination RDS DBMASTER account being imported into
  • MyDestinationDBMasterPassword - The destination RDS DBMASTER password
  • MyDestinationDBTnsEntry - The TNS Entry for the destination database

Remember that files created on RDS count towards your total storage allocation for the RDS Instance.

Prerequisite

A working Oracle client installed on a Linux machine either inside or outside of AWS. Typically, this can be an on-premise machine or a machine in EC2.

Step-By-Step

1. Ensure the default data_pump_dir directory on RDS

2. Create a public database link on the destination RDS Database

  • Log onto the Oracle Client machine
  • sqlplus dbmaster/<password>@MyDestinationDBTnsEntry
  • SQL> CREATE PUBLIC DATABASE LINK RDS_MySourceDB CONNECT TO MySourceDB IDENTIFIED BY "MySourceDBMasterPassword"
  • USING '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=MySourceHost)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=MySourceDB)))';

3 Execute impdp

  • Log onto the Oracle Client machine
  • impdp MyDestinationDBMasterID/MyDestinationDBMasterPassword@MyDestinationDBTnsEntry directory=DATA_PUMP_DIR LOGFILE=MyImpdp.log full=y network_link=RDS_MySourceDB

Related

How to Remove Files from AWS RDS

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License