views:

328

answers:

1

I installed Oracle 11gR2 and I am now trying to access the database from a remote system.

My listener.ora is still the default:

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    )
  )

ADR_BASE_LISTENER = /media/oracle/app/oracle

./lsnrctl services returns this:

oracle@ubuntu:/media/oracle/app/oracle/product/11.2.0/dbhome_1/bin$ ./lsnrctl services

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 05-MAY-2010 05:00:49

Copyright (c) 1991, 2009, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
Services Summary...
Service "gis.c2c" has 1 instance(s).
  Instance "gis", status READY, has 1 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:0 refused:0 state:ready
         LOCAL SERVER
Service "gisXDB.c2c" has 1 instance(s).
  Instance "gis", status READY, has 1 handler(s) for this service...
    Handler(s):
      "D000" established:0 refused:0 current:0 max:972 state:ready
         DISPATCHER <machine: ubuntu, pid: 2916>
         (ADDRESS=(PROTOCOL=tcp)(HOST=ubuntu.localdomain)(PORT=47616))
The command completed successfully

I am not able to get a remote connection using port 1521, but the above listed port 47616 works. I wouldn't mind using a different port than 1521, but the problem is that this port changes on every reboot.

What is going wrong?

Thanks!

A: 

This is not programming question, maybe it belongs to serverfault.

However, I would think of following:

Is localhost defined in /etc/hosts ? And, if you want to access the listener from network, you should not be listening on localhost, but on external address.

Is the port 1521 available? Verify by running netstat -tlnp .

Juraj
Thanks for your reply, and you are right, serverfault would probably be a better place for this.I missed to say that locally I can connect to port 1521.localhost is listed in /etc/hosts and netstat outputs:tcp 0 0 127.0.0.1:1521 0.0.0.0:* LISTEN - ... tcp6 0 0 :::11432 :::* LISTEN - ...
toobb
This confirms that it is listening only on local interface on port 1521, thus not visible from outside. You have to change in listener.ora "localhost" into external address. (And, trying to access "localhost" from outside network reveals that, IMHO, you need to learn basics of TCP/IP networking.)
Juraj
So in its default configuration Oracle can only accessed from localhost?I changed the part '(HOST = localhost)' to '(HOST = ubuntu.localdomain)' (or '(HOST = 172.16.101.32)') and run './lsnrctl reload', but nothing changed. What should the listener.ora look like?
toobb
(HOST = 172.16.101.32) should have worked. I'd try to create new listener.ora from scratch usign Network Assistant GUI. If you have X Window installed on server (or able to connect to remote desktop), run "netca" ,select "Listener configuration", delete the listener and create it anew.
Juraj
Ok, running './lsnrctl reload' is not enough, I had to restart Oracle. Then it worked with '(HOST = ubuntu.localdomain)'. Thanks for your help!
toobb