Migrate On-Premise Oracle to RDS Oracle
A few weeks ago, I detailed migrating Oracle to MySQL using AWS Schema Conversion Tool and Data Migration Service, this post will walk through migrating smaller Oracle databases via DB Link and DataPump. In order to create a DB Link between your on-premise and cloud databases, you will need to have a publicly accessible RDS instance[security risk] or attach a Virtual Private Gateway to your VPC to communicate with your internal(on-premise) network[preferred and secure].
One of the advantages of using datapump for a smaller database is having a upgraded and patched database in AWS, and having those administration tasks being handled by Amazon moving forward since RDS is a fully managed service with no access to the OS.
I used AWS CLI via python using Boto3 - the Amazon Web Services (AWS) Software Development Kit (SDK) for Python. A sample of the scripts I used to complete the migration can be found on my GitHub repo.
The high level steps are:
- Install AWS CLI using pip
- Install Boto3 python interface to AWS CLI
- Configure users and their permissions via IAM
- Be sure to create access keys - the equivalent of "programmatic access"when using the AWS Console to configure the user.
- Use the AWS access & secret key to configure AWS on your terminal
- Create TNS entry on source Oracle DB using your RDS Instance Endpoint
- Test that the connection works by running
tnsping [ALIAS]
- Create DB Link between Source and Target databases
- Take DataPump Export of Full database or specific schemas on source database
- Move Datapump file using DB Link (Ideal for small databases/schemas)
- Create the necessary tablespace(s) on Target database
- Import the Datapump files on RDS
- Confirm the import was successful and validate the data.
- Clean up the RDS Datapump directory and delete any files you no longer need.
There you have it, you've successfully migrated your on-premise Oracle Database/Schema to Oracle RDS in AWS!