0

So I am fairly new at this, so if you could keep that in mind in your answers, it would be much appreciated. I installed Oracle SQL Database on my Windows PC. It came in two zip files. I installed it and the online portion of it works fine. I can login with Username: sys and Password: **. What I am trying to do is connect to this newly created database on another computer through SQL Developer. I have read that in order to do this, you need to change the hostname of the Database from "localhost" to an IP Address. How do I do that and is there anything else I need to do to make this work?

I also found this LINK. Is this something I should do? I do not have a Domain though.

listener.ora

# listener.ora Network Configuration File:  
C:\app\hyderz\product\11.2.0\dbhome_2\network\admin\listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
(SID_LIST =
 (SID_DESC =
   (SID_NAME = CLRExtProc)
   (ORACLE_HOME = C:\app\hyderz\product\11.2.0\dbhome_2)
   (PROGRAM = extproc)
   (ENVS = "EXTPROC_DLLS=ONLY:C:\app\hyderz\product\11.2.0\dbhome_2\bin\oraclr11.dll")
 )
)

LISTENER =
(DESCRIPTION_LIST =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1522))
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1522))
  )
)

ADR_BASE_LISTENER = C:\app\hyderz

tnsnames.ora

# tnsnames.ora Network Configuration File: 
C:\app\hyderz\product\11.2.0\dbhome_2\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.

LISTENER_ORCL =
  (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1522))


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

ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1522))
(CONNECT_DATA =
  (SERVER = DEDICATED)
  (SERVICE_NAME = orcl)
)
)

1 Answer 1

1

Try to connect with

 sqlplus SYS/PASSWORD@ORCL 

If you can connect with this from command line you can connect with Sql Developer.

You have two options

  1. Connection Type : Basic

    • SID = orcl
    • Username = SYS
    • Password = password
    • Hostname = YOUR_MACHINENAME_OR_IP

See Image

  1. Connection Type : TNS

    • Choose SID from dropdownlist. It should read your TNS File and auto complete your dropdown list.
    • Username = SYS
    • Password = password

Sql Developer Connection

The catch here. Oracle Connection string for OCI expect same argument in your tnsnames.ora file. If you use basic connection you should be able to connect from everywhere without modification. But if you need to connect with other connection types, you may need to enter your IP address in your tnsnames.ora file.

8
  • What would be the hostname I would connect with on my other computer?
    – Zack
    Jan 22, 2013 at 16:45
  • Hostname should be your IP address or hostname of your oracle database. try to ping your machine to find your IP address and hostname. Added more explanation to question. Jan 22, 2013 at 16:49
  • What would my TNS file look like with the changes you suggested?
    – Zack
    Jan 22, 2013 at 16:51
  • CTRL-Replace localhost YOUR_MACHINENAME_IP. You may not need it. Jan 22, 2013 at 16:53
  • Replace localhost with my ip? I did that and I could not connect to the web database anymore. Did you see the link I provided? Should I do something with that?
    – Zack
    Jan 22, 2013 at 16:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.