Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

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)
)
)
share|improve this question
add comment

1 Answer

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.

share|improve this answer
    
What would be the hostname I would connect with on my other computer? –  Zack Jan 22 '13 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. –  Atilla Ozgur Jan 22 '13 at 16:49
    
What would my TNS file look like with the changes you suggested? –  Zack Jan 22 '13 at 16:51
    
CTRL-Replace localhost YOUR_MACHINENAME_IP. You may not need it. –  Atilla Ozgur Jan 22 '13 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 '13 at 16:55
show 3 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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