Blog Archives

Creating Database Link from AWS RDS to OnPremises

Hi Folks,

It has been a very long time that I don’t write anything in here, but I just wanted to share with you something that you might find useful for doing Oracle migrations. I wanted to create a Database Link from my AWS Oracle RDS Instance to an Oracle sitting on an On-premises environment.

Of course the very first thing you need to have is internal network connectivity between the instances. Take a look on this part of the documentation for more specification. Assuming that you have the connectivity between then, this is the script you need to execute on your Oracle RDS Instance.

create database link <NameOfDBLink>
connect to UserName
identified by “UserNamePassword”
using ‘(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=TheHostAddressOrIp)(PORT=TCPPortHere))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=TheOracleServiceName)))’;

To test that your database link has been successfully created, you can do a simple test by executing the following query.

select sysdate from dual@NameOfDBLink;

Best,
Marcos Freccia