Search code examples
oracle-databaseoracle-sqldeveloperip-addressremote-accessdblink

I want to connect through DBlink to my Oracle DB using my public IP address


I want a friend to access to my oracle DB through DBlink. Im new to Databases, so i could not make this work.

I suppose i have to create a listener with my public IP or so. So i used the NET configuration wizard to create a service name. I used the public IP but the wizard throws a timeout when trying to connect. I tried to create a Listener with my public IP in the listener.ora in por 1522 but it did not work eaither

What i have done:

  1. I checked the listener.ora, it has a LISTENER with my local ip (192.168.1.134) and the port is 1521
  2. I checked the tnsnames.ora, it has the same IP and port of the listener.
  3. I made the port forwarding in my router.
  4. I used the wizard to create a Listener with public IP.
  5. I used the wizard to create a service name with public IP address but it cannot connect

TNSNAMES.ORA:

# tnsnames.ora Network Configuration File: D:\Programas\Oracle\NETWORK\ADMIN\tnsnames.ora
# Generated by Oracle configuration tools.

ORACLR_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
    (CONNECT_DATA =
      (SID = CLRExtProc)
      (PRESENTATION = RO)
    )
  )

LISTENER_ORCL =
  (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.134)(PORT = 1521))


JORGE_ORA_DB =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 190.153.1.32)(PORT = 1522))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = orcl)
    )
  )

ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.134)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )

LISTENER.ORA:

# listener.ora Network Configuration File: D:\Programas\Oracle\NETWORK\ADMIN\listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = CLRExtProc)
      (ORACLE_HOME = D:\Programas\Oracle)
      (PROGRAM = extproc)
      (ENVS = "EXTPROC_DLLS=ONLY:D:\Programas\Oracle\bin\oraclr19.dll")
    )
  )

REMOTE =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = croquer.ddns.net)(PORT = 1522))
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.134)(PORT = 1521))
    )
  )

Solution

  • Thank you for your responses! The solution was quite simple. I created a new inbound and outbound rule in the firewall i both computers. Then it worked for me.

    The rules are port type rules for port 1521 (in my case).