Reputation: 35
I'm trying to connect in my database using sqlplus, passing the service using semicolon , but isn't working , only with slash .
[root@38324e46bdc6 bin]# sqlplus ECM/ECM@//172.18.0.5:1521:ORACLEDB.localdomain
SQL*Plus: Release 12.1.0.2.0 Production on Fri Dec 21 16:18:50 2018
Copyright (c) 1982, 2014, Oracle. All rights reserved.
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified
But , this way :
[root@38324e46bdc6 bin]# sqlplus ECM/[email protected]:1521/ORACLEDB.localdomain
SQL*Plus: Release 12.1.0.2.0 Production on Fri Dec 21 16:10:21 2018
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Last Successful login time: Fri Dec 21 2018 16:09:44 +00:00
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
SQL>
This is my listener :
[oracle@3fa66b9377b9 /]$ lsnrctl status listener
LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 21-DEC-2018 17:31:21
Copyright (c) 1991, 2016, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=0.0.0.0)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date 18-DEC-2018 18:02:23
Uptime 2 days 23 hr. 28 min. 57 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/12.2.0/dbhome_1/admin/ORACLEDB/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/3fa66b9377b9/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=3fa66b9377b9)(PORT=5500))(Security=(my_wallet_directory=/u01/app/oracle/product/12.2.0/dbhome_1/admin/ORACLEDB/xdb_wallet))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "7d50b1bde0ed0114e053050012ac954b.localdomain" has 1 instance(s).
Instance "ORACLEDB", status READY, has 1 handler(s) for this service...
Service "ORACLEDB.localdomain" has 1 instance(s).
Instance "ORACLEDB", status READY, has 1 handler(s) for this service...
Service "ORACLEDBXDB.localdomain" has 1 instance(s).
Instance "ORACLEDB", status READY, has 1 handler(s) for this service...
Service "orclpdb1.localdomain" has 1 instance(s).
Instance "ORACLEDB", status READY, has 1 handler(s) for this service...
The command completed successfully
The problem is that I need to use semicolon and be able to connect this way :
sqlplus ECM/ECM@//172.18.0.5:1521:ORACLEDB.localdomain
Because the project parses a xml file later and concatenate like port:host:sid, and I can't change the metadata to use /sid . Someone can help me with that please ?
Upvotes: 0
Views: 688
Reputation: 35
Well, I found the problem . Basically , jdbc connector is using USER/PASSWORD@HOST:SID and sqlplus is PASSWORD/USER@HOST/SERVICE.
Thanks!
Upvotes: 1