4

I'm trying to connect remotely to Oracle 12c database with SQL Developer. In order to connect remotely from another computer, on the computer running Oracle I opened a port in the Windows 7 Firewall. That part worked, but now the listener isn't letting me in due to this error ORA-12505. It is saying it doesn't recognize the SID I provided when I try to connect with SQL Developer in the remote computer. I even tried setting service name to "editor", but still nothing.

Following are the setting from SQL Developer on the remote computer:

enter image description here

On the server side, this is listener.ora:

SID_LIST_LISTENER =
(SID_LIST =
  (SID_DESC =
    (SID_NAME = CLRExtProc)
    (ORACLE_HOME = C:\app\Owner\product\12.1.0\dbhome_1)
    (PROGRAM = extproc)
    (ENVS = "EXTPROC_DLLS=ONLY:C:\app\Owner\product\12.1.0\dbhome_1\bin\oraclr12.dll")
  )
)

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

 REMOTE_LISTENER =
   (DESCRIPTION_LIST =
     (DESCRIPTION =
       (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.2.19)(PORT = 1531))
       (SERVICE_NAME = editor)
     )
   )

And tnsnames.ora:

EDITOR =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.2.19)(PORT = 1531))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = editor)
    )
  )

  LISTENER_EDITOR =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
      (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = editor)
    )
  )


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

You'll notice that the default listener is set to localhost on port 1521. As long as that stays like that, I can connect on the server with SQL Developer. So in order to connect remotely, I setup a second listener set for port 1531 and entered the IP address of the server. The firewall has also been setup to allow a connection through port 1531. As you can see, I did edit the tnsnames.ora file a bit to allow for a connection to the Editor database, but my edit didn't seem to fix anything. I still can't connect with SQL Developer on the client side. On the server, I tried using the Oracle Net Configuration Assistant to test the Editor entry and wound up with error message:

ORA-12514 Listener does not currently know of service requested in connect descriptor.

UPDATE Sept. 9 2014:

I was asked to run lsnrctl status from the command prompt. Following is the output from that command:

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521))(SERVICE_NAM
E=editor))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for 64-bit Windows: Version 12.1.0.1.0 - Produ
ction
Start Date                09-SEP-2014 14:33:06
Uptime                    0 days 4 hr. 14 min. 38 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   C:\app\Owner\product\12.1.0\dbhome_1\network\admin\lis
tener.ora
Listener Log File         C:\app\Owner\diag\tnslsnr\Shiers-PC\listener\alert\log
.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1521ipc))(SERVIC
E_NAME=editor))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521))(SERVICE_NAME=
editor))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=Shiers-PC)(PORT=5500))(Security=(my
_wallet_directory=C:\APP\OWNER\admin\editor\xdb_wallet))(Presentation=HTTP)(Sess
ion=RAW))
Services Summary...
Service "CLRExtProc" has 1 instance(s).
  Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "editor" has 1 instance(s).
  Instance "editor", status READY, has 1 handler(s) for this service...
Service "editorXDB" has 1 instance(s).
  Instance "editor", status READY, has 1 handler(s) for this service...
Service "pdborcl" has 1 instance(s).
  Instance "editor", status READY, has 1 handler(s) for this service...
The command completed successfully

OK...so what am I supposed to do with this???

Alan
  • 822
  • 1
  • 16
  • 39
  • I ran lsnrctl and it only lists one instance. It says: Service "CLRExtProc" has 1 instance(s). That is all it lists. Is that what I'm supposed to use other than "editor"? For the hell of it, I typed that into the Service Name field and tried to test the connection. I got some other error: The network adaptor could not establish a connection. – Alan Sep 07 '14 at 00:58
  • Are you connecting using SQL Developer on the remote computer? Do you have the same tnsnames.ora as on the localhost? – Sathyajith Bhat Sep 07 '14 at 04:57
  • I am using SQL Developer on the remote computer. The image above is the dialog box I'm using to try to connect. I went looking for a file on the remote computer named tnsnames.ora and didn't find any. – Alan Sep 07 '14 at 13:58
  • Stop the Oracle service, stop the listener, start the listener, start the Oracle service ... and see what happens. This should make the Oracle DB auto-register in the listener. If it does not work, connect to your Oracle service via SQL*Plus as `/ as sysdba` and run `alter system register;`, exit SQL*Plus then try connecting to your Oracle service as requested. If it still does not work, add `service_name` subclause to your `listener.ora`, restart the listener, then see what happens. If it still does not work, then ... well, just say and we'll see what great idea we can come up with next. – peter.hrasko.sk Sep 09 '14 at 13:01
  • I suppose this question (answers from there) could help: http://stackoverflow.com/questions/18192521/ora-12505-tnslistener-does-not-currently-know-of-sid-given-in-connect-descript – rtbf Sep 09 '14 at 13:25
  • OK nop77svk, I've followed your instructions to the letter. At first tried to restart both services in the sequence you suggested. That alone didn't allow me to connect. I used SQL Plus as sysdba and ran alter system register; I tried once again to connect, but no go. I added the service_name subclause to the listener.ora, restarted the listener, still no go. So we're back to square one. – Alan Sep 09 '14 at 14:14
  • In principle I understand what is supposed to happen according to the suggestions pointed out in http://stackoverflow.com/questions/18192521/ora-12505-tnslistener-does-not-currently-know-of-sid-given-in-connect-descript and those suggestions seem to coincide with what we're doing here, but nothing seems to be working as it should. Still spinning my wheels here... – Alan Sep 09 '14 at 14:16
  • For the listener.ora file, I noticed that if I change the IP address back to it's original "localhost", I am able to connect to the database via SQL Developer from the server, but that change doesn't help much when it comes to trying to connect remotely. – Alan Sep 09 '14 at 15:36

3 Answers3

4

Don't use the SID, use the SERVICE - from what your example shows, 'editor'.

On 12c if you are connecting to a pluggable then you will ALWAYS need to use service. The SID will resolve to the Container Database (CDB).

Ton confirm that is right, run the 'lsnrctl status' command on your server, and check out what the actual services are being listened to by the listener.

thatjeffsmith
  • 20,522
  • 6
  • 37
  • 120
  • I'm aware that I needed to use SERVICE and not SID. I have been trying with "editor" as SERVICE for quite some time now. I ran the command you suggested: lsnrctl status. You can see the readout above in my original post as an update. It's interesting that I see port 5500 showing. That didn't come from the tnsnames.ora file. I don't know where that came from. So what does all that mean? Am I supposed to open a port in the firewall for 5500? Then try connecting again? – Alan Sep 09 '14 at 21:59
  • 1
    The service for your database is, pdborcl. So change the service name to that in your connection properties. Also, you don't need to edit the listener.ora file - the databases self register with the listener. Port 5500 looks like it's setup for secure connections over tcps... – thatjeffsmith Sep 10 '14 at 21:18
  • I did as you suggested and changed the service name to pdborcl. That didn't allow a connection. I still get error ORA-12514. – Alan Sep 10 '14 at 22:33
  • Just to be clear, I don't need anything else running on the client side other than SQL Developer to make this works do I? – Alan Sep 10 '14 at 23:40
  • Assuming you have a database somewhere to connect to, all you need is SQL Developer to connect. I wrote a little about diagnosing connection issues here http://www.thatjeffsmith.com/archive/2014/09/30-sql-developer-tips-in-30-days-day-5-connectivity-issues/ – thatjeffsmith Sep 11 '14 at 13:06
  • This issue has be solved on another forum. I may have forfeited the 50 points, but it was worth it. see: https://community.oracle.com/message/12628294#12628294 for the discussion concerning this issue. I hope others will find it constructive. – Alan Sep 11 '14 at 18:58
1

Forgive me if I don't understand the question properly. Are there 3 machines involved. Client, listener and database ? If you are just trying to advertise the database on port 1531 then modify the LISTENER section in the listener.ora file to include an additional port

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1531))
(SERVICE_NAME = editor)
)
)
DallasB
  • 11
  • 1
1

I am using SQL Developer on the remote computer. The image above is the dialog box I'm using to try to connect. I went looking for a file on the remote computer named tnsnames.ora and didn't find any. – Alan Sep 7 at 13:58

You need an Oracle Client on the remote client computer with the same tnsnames.ora file as you have on the server.

Scotty Boy
  • 336
  • 1
  • 4