Search code examples
oracleoracle11goracle10gdblink

Connect to an oracle instance from another oracle instance on different servers


How to create a DB link between two Oracle instances on different servers with different IPs. let say A (10g with e.g. 192.168.1.1) and B (11g with e.g. 192.168.1.2) are two instances. I want to access the data in instance A from the instance B.


Solution

  • People usually edit TNSNAMES.ORA and include database B alias in there, and then

    create database link dblink
      connect to username_on_B
      identified by password_on_B
      using 'database_B_tnsnames_ora_alias';
    

    Or, without TNSNAMES.ORA, something like this:

    create database link dblink
     connect to username_on_B
     identified by password_on_B
     using '192.168.1.2:1521/dbB_service_name';
                        ----
                        port