0

Here is my listener configuration:

LSNRCTL for Linux: Version 18.0.0.0.0 - Production on 20-NOV-2020 20:01:25

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=NoteBook)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 18.0.0.0.0 - Production
Start Date                20-NOV-2020 20:00:55
Uptime                    0 days 0 hr. 0 min. 29 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Default Service           XE
Listener Parameter File   /opt/oracle/product/18c/dbhomeXE/network/admin/listener.ora
Listener Log File         /opt/oracle/diag/tnslsnr/NoteBook/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=NoteBook)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=127.0.0.1)(PORT=5500))(Security=(my_wallet_directory=/opt/oracle/product/18c/dbhomeXE/admin/XE/xdb_wallet))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "XE" has 1 instance(s).
  Instance "XE", status READY, has 1 handler(s) for this service...
Service "XEXDB" has 1 instance(s).
  Instance "XE", status READY, has 1 handler(s) for this service...
Service "b470a0c2708d9acee0530401a8c035ac" has 1 instance(s).
  Instance "XE", status READY, has 1 handler(s) for this service...
Service "xepdb1" has 1 instance(s).
  Instance "XE", status READY, has 1 handler(s) for this service...
The command completed successfully

I can connect to xepdb1 through tcp using sqlplus user/password@NoteBook/xepdb1, however, if I use use ipc (sqlplus user/password@xepdb1) to connect, it fails with an error ORA-12154: TNS:could not resolve the connect identifier specified.

How can I connect to a pluggable database using ipc?

2 Answers 2

0

If you connect by

sqlplus user/password@NoteBook:1521/xepdb1

then you use EZconnect, this is a TCP connect where "NoteBook" is the server, "1521" is the port and "xepdb1" is the service. "1521" is the default for port so you can omit it. But the protocol is TCP. If you want to use the IPC connection defined in the listener than you have to use a tnsnames.ora file. This is not possible with EZconnect.

In this tnsnames.ora file you have to have an entry similar to

xepdb1=(DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC))(CONNECT_DATA=(SERVICE_NAME=xepdb1)))

Now you can connect as

sqlplus user/password@xepdb1

In Linux you can skip the tnsname.ora file and yuse the following

sqlplus user/password@'(DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC))(CONNECT_DATA=(SERVICE_NAME=xepdb1)))' 

So you have to quote the string. In Windows there is a similar way to do it.

The name of the key you use in the listner file for the IPC connection can be chosen arbitrary, but of course you have to use the same key in your connection.

2
  • Thanks, the second method works, however, the first one did not. It still shows the same error
    – William
    Commented Nov 21, 2020 at 2:43
  • if you get ORA-12154: TNS:could not resolve the connect identifier specified this is a problem unrelated to IPC. You should open a new question if you want to solve this.
    – miracle173
    Commented Nov 21, 2020 at 6:26
1

"if I use use ipc (sqlplus user/password@xepdb1) "

That's not IPC, that's tcp. It tries to find the entry for 'xepdb1' in the client's tnsnames.ora file. Then it tries to construct a tcp packet from the information found there, and send that packet to the specified host and port, where - hopefully - there is a listener. Your error means that it could not find the specified entry in the client's tnsnames.ora.

6
  • Thanks, so how to connect to a pluggable database using IPC?
    – William
    Commented Nov 20, 2020 at 13:17
  • I'm not sure you can. Why do you need to? What's wrong with a standard tcp connection?
    – EdStevens
    Commented Nov 20, 2020 at 13:19
  • 1
    if we can’t, what’s the ipc in the listener file for?
    – William
    Commented Nov 20, 2020 at 13:32
  • That's for 'extproc'. I don't know a lot about it, never used it. I do know the listenr is configured for that by default, and has been since at least oracle 7.3 (when I began working with oracle) and has nothing to do with PDB. I could google 'oracle extproc' but so can you.
    – EdStevens
    Commented Nov 20, 2020 at 15:03
  • @EdStevens - extproc is how the database communicates with code written in a 3GL language. Some Data Cartridges/Domain Indexes have code written in C/C++/FORTRAN. You'll see its requirements in those scenarios. The IPC is how the database calls that 3GL code. Commented Nov 20, 2020 at 15:17

Your Answer

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

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