ORA-12514 TNS:listener does not currently know of service requested in connect descriptor
Asked Answered
S

32

335

We have an application running locally where we're experiencing the following error:

ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

I've tested the connection using TNSPing which resolved correctly and I tried SQLPlus to try connecting, which failed with the same error as above. I used this syntax for SQLPlus:

sqlplus username/password@addressname[or host name]

We have verified that:

  • the TNS Listener on the server is running.
  • Oracle itself on the server is running.

We don't know of any changes that were made to this environment. Anything else we can test?

Sodden answered 28/5, 2012 at 15:7 Comment(6)
what is TNSPing command (with params) that you used?Monolingual
when you say "running locally" you mean that the application is connecting to a database on the same host? Also, what are the contents of your sqlnet.ora file? what versions are reported for sqlplus and tnsping, and are you sure that they're in the same ORACLE_HOME?Misinterpret
try restarting the database. Since they supposed to inform the Listener about their existence on startup this might fix your problem.Raines
ALTER SYSTEM REGISTER is less drastic than restarting the database.Koeppel
After researching enough found the right solution here shekhargulati.com/2019/01/22/…Metre
It is possibly as simple as a typo in the host name or other connection properties (that is what happened to me). Of course, other comments and answers are valid and detail more complex situations.Galactopoietic
D
276

I had this issue and the fix was to make sure in tnsnames.ora the SERVICE_NAME is a valid service name in your database. To find out valid service names, you can use the following query in oracle:

select value from v$parameter where name='service_names'

Once I updated tnsnames.ora to:

TEST =
   (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = *<validhost>*)(PORT = *<validport>*))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = *<servicenamefromDB>*)
    )
)

then I ran:

sqlplus user@TEST

Success! The listener is basically telling you that whatever service_name you are using isn't a valid service according to the DB.

(*I was running sqlplus from Win7 client workstation to remote DB and blame the DBAs ;) *)

Dexter answered 16/4, 2013 at 23:36 Comment(12)
Thanks alot, you solved my problem ;) But where is the tnsnames.ora located?Boltzmann
On win7, %ORACLE_HOME%\NETWORK\ADMIN\tnsnames.oraDexter
How am I supposed to query the DB if I'm not able to even connect to it??Buckthorn
Can you ssh to the DB server directly and run sqlplus from there?Dexter
this might not be the case when multiple clients/servers are, or used to be, installed on the same machine. (tnsping outputs the location of the directory it uses) - in my case, listener.ora in that directory contained information pertaining to an old database instance that i had uninstalled - quick and dirty way was to copy the entire contents of listener.ora from my current installation of Oracle Express, to that other directory that listener seems to be checking (i think i changed it through a registry or something, and it has precedence over ORACLE_HOME (?))Polychromatic
ORA-00942: table or view does not existEarthiness
@isabellemartz #10787282Jopa
here worked for me after reviewing every single answerSontich
I am sorry to agree with hello_earth, the rightest answer is listener.ora, although the answer is still useful.Starflower
I found right solution here shekhargulati.com/2019/01/22/…Metre
The Oracle db-query is enormously helpful. I got a list and one of the items in the list returned worked, the other did not. Therefore, some trial and error is required.Galactopoietic
Thanks a lot. It work now even after 11 years. Wow. I used it for Oracle XE (21) on Windows 11. Those who want to try out this command(to know the service as most of the DB clients default it to ORCL - it's XE in my case). Open command prompt and run this command "C:\Windows\System32>sqlplus / AS sysdba" and then this command select value from v$parameter where name='service_names' . It should give you the service name.Jeffries
E
72

I know this is an old question, but still unanswered. It took me a day of research, but I found the simplest solution, at least in my case (Oracle 11.2 on Windows 2008 R2) and wanted to share.

The error, if looked at directly, indicates that the listener does not recognize the service name. But where does it keep service names? In %ORACLE_HOME%\NETWORK\ADMIN\listener.ora

The "SID_LIST" is just that, a list of SIDs and service names paired up in a format you can copy or lookup.

I added the problem Service Name, then in Windows "Services" control panel, I did a "Restart" on the Oracle listener service. Now all is well.


For example, your listener.ora file might initially look like:

# listener.ora Network Configuration File: C:\app\oracle_user\product\12.1.0\dbhome_1\network\admin\listener.ora
# Generated by Oracle configuration tools.

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

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

... And to make it recognize a service name of orcl, you might change it to:

# listener.ora Network Configuration File: C:\app\oracle_user\product\12.1.0\dbhome_1\network\admin\listener.ora
# Generated by Oracle configuration tools.

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

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )
Ewell answered 25/3, 2014 at 12:13 Comment(3)
Need to update this answer with the syntax of how listener.ora stores the names. I don't even have a listener.ora file. I'm also on a client workstation running SQL Developer and trying to just create a Database Link when I get the error. I don't have an Oracle Listener service to restart.Gathard
vapcguy, you need to be on the database server. it sounds like you are on the clientEwell
After following Sepideh's instructions involving the Net Manager, I noticed that my listeners.ora file had been updated to contain a new SID_LIST entry. I have edited this answer to include a before-and-after example of the syntax, for the benefit of readers that can't use the Net Manager, for whatever reason.Vagarious
B
30

In my circumstances the error was due to the fact the listener did not have the db's service registered. I solved this by registering the services. Example:

My descriptor in tnsnames.ora:

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

So, I proceed to register the service in the listener.ora manually:

SID_LIST_LISTENER =
    (SID_DESC =
      (GLOBAL_DBNAME = LOCALDB)
      (ORACLE_HOME = C:\Oracle\product\11.2.0\dbhome_1)
      (SID_NAME = LOCALDB)
    )

Finally, restart the listener by command:

> lsnrctl stop
> lsnrctl start

Done!

Bencion answered 31/5, 2017 at 23:39 Comment(1)
I made it here, but there was a final block that stated error ORA-01219 (pluggable database not open) that kept me from opening the tables. They opened when logging into the EE database with the sys/pwd@ipaddress:port. Untikl then SQL Developer would not allow the tables to open until that account ran "startup;" for that instance.Kopans
C
14

I had this issue at Windows server 2008 R2 and Oracle 11g

go to Net Manager > Listener > select database services form the combox > "Global Database Name" must be same as "SID" and "Oracle Home Directory" must be correct.

If you don't have any entry for database services, create one and set correct global database , sid and oracle home.

Cleromancy answered 21/12, 2013 at 14:27 Comment(1)
This was wrong on my system: "Global Database Name" must be same as "SID" - this isn't intuitive at all, if these values have to be identical, why are these two separate parameters?? -.-Footsore
S
14

This really should be a comment to Brad Rippe's answer, but alas, not enough rep. That answer got me 90% of the way there. In my case, the installation and configuration of the databases put entries in the tnsnames.ora file for the databases I was running. First, I was able to connect to the database by setting the environment variables (Windows):

set ORACLE_SID=mydatabase
set ORACLE_HOME=C:\Oracle\product\11.2.0\dbhome_1

and then connecting using

sqlplus / as sysdba

Next, running the command from Brad Rippe's answer:

select value from v$parameter where name='service_names';

showed that the names didn't match exactly. The entries as created using Oracle's Database Configuration Assistant were originally:

MYDATABASE =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = mylaptop.mydomain.com)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = mydatabase.mydomain.com)
    )
  ) 

The service name from the query was just mydatabase rather than mydatabase.mydomain.com. I edited the tnsnames.ora file to just the base name without the domain portion so they looked like this:

MYDATABASE =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = mylaptop.mydomain.com)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = mydatabase)
    )
  ) 

I restarted the TNS Listener service (I often use lsnrctl stop and lsnrctl start from an administrator command window [or Windows Powershell] instead of the Services control panel, but both work.) After that, I was able to connect.

Selfregard answered 19/12, 2016 at 14:38 Comment(1)
Just looking up SERVICE_NAME from tnsnames.ora and using the value found there in my connection did it for me. I did not have any SID_LIST_LISTENER in listener.ora, so seems not necessary.Cohligan
G
13

For thoses Who are using spring-boot and jdbc for connection. You have to be careful while writing jdbcUrl in application.properties

With SID in Database connection - source.datasource.jdbcUrl = jdbc:oracle:thin:@[HOST][:PORT]:SID

With Service name in db connection globe.datasource.jdbcUrl = jdbc:oracle:thin:@//[HOST][:PORT]/SERVICE

This worked for me :)

Gadgetry answered 16/6, 2020 at 8:18 Comment(0)
P
10

Starting the OracleServiceXXX from the services.msc worked for me in Windows.

Planet answered 16/6, 2015 at 7:48 Comment(1)
In windows, if you are using Oracle Release 12.x, then make sure the service OracleServiceORCL is running. If this service is not started, then also you will receive the same error code.Incorrigible
H
6

For Dbeaver users: try selecting "SID" instead of "Service name" in connection settings.

Huarache answered 30/8, 2021 at 6:49 Comment(1)
For me, turned out that SID= instead of Service_Name= in the connect string did the job. Despite having some documentation which tells me to use Service_Name= to specify the SID...well, whatever. Thank you!Intermolecular
B
5

I had the same problem. For me, just writing

sqlplus myusername/mypassword@localhost

did the trick, doing so makes it connect to the default service name, I guess.

Boltzmann answered 9/9, 2014 at 4:1 Comment(2)
We had a similar issue with our connection string causing this error. We were connecting using Oracle's JDBC thin driver with the connection string: jdbc:oracle:thin:@//localhost:1521/orcl. The corrected connection string to eliminate this error was: jdbc:oracle:thin:@localhost:1521.Anglicism
it depends whether this would work - i think this way of connecting, judging on what others said, is bypassing the listener entirely, using the computer host name instead of SID - this way of connecting causes problems in third-party clients, - i think it also works only when the EZCONNECT is specified in sqlnet.ora: NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)Polychromatic
P
4

This error can occur when an application makes a new connection for every database interaction or the connections are not closed properly. One of the free tools to monitor and confirm this is Oracle Sql developer (although this is not the only tool you can use to monitor DB sessions).

you can download the tool from oracle site Sql Developer

here is a screenshot of how to monitor you sessions. (if you see many sessions piling up for your application user during when you see the ORA-12514 error then it's a good indication that you may have connection pool problem).

enter image description here

Part answered 1/4, 2013 at 0:21 Comment(0)
K
3

Check to see the database is up. Log onto the server, set the ORACLE_SID environment variable to your database SID, and run SQL*Plus as a local connection.

Koeppel answered 29/5, 2012 at 0:50 Comment(1)
This was exactly my problem. Our database is hosted on a VM which was down while I was attempting to use another program that used the DP. After seeing this thread I realized it was probably down.Glottochronology
C
3

I had also faced the same problem and spent 3 days to dig it out.

This happens because of your wrong TNS service entry.

First check whether you are able to connect to standby database from primary database using sql > sqlplus sys@orastand as sysdba (orastand is a standby database).

If you are not able to connect then it is a problem with the service. Correct the entry of service name in TNS file at primary end.

Check standby database the same way. Make the changes here too if required.

Make sure the log_archive_dest_2 parameter has the correct service name.

Combine answered 26/6, 2014 at 6:41 Comment(0)
S
3

I resolved this issue in my linux enviroment updating the IP of my machine in /etc/hosts file.

You can verify your network IP (inet end.) with:

$ifconfig

See if your IP matches with /etc/hosts file:

$cat /etc/hosts

Edit your /etc/hosts file, if nedded:

$sudo gedit /etc/hosts

Bye.

Science answered 3/9, 2014 at 15:27 Comment(2)
this is old, but it doesn't make much sense to add your IP to /etc/hosts. OP is missing SERVICE_NAME, other stuff is quite unrelatedAmara
I have not added my IP to /etc/host. I just corrected it. As you can see in this topic, there are many valid (with upvote) answers and varieties to solve this question. If that answer did not help you, why downvote? This answer may still help someone as it helped me.Science
B
3

what worked for me was really simple, I just needed to initiate the service manually in the "Windows Services" (services.msc in cmd trompt). my service name is: OracleServiceXXXXX.

Buckthorn answered 12/5, 2016 at 13:57 Comment(1)
In my case, though Startup Type is set to Automatic, it does not start when machine is boot. After manually start service "OracleServiceXE", it works for Oracle Database 11g Express to connect to DB and APEX(Oracle Application Express) webpage.Kone
H
2

For those that may be running Oracle in a VM (like me) I saw this issue because my VM was running out of memory, which seems to have prevented OracleDB from starting up/running correctly. Increasing my VM memory and restarting fixed the issue.

Hostile answered 14/4, 2016 at 18:14 Comment(0)
G
2

Lots of answers here, but here comes a working example with code that you can copy and paste and test immediately:

For me the error 12514 was solved after specifying the correct SERVICE_NAME. You find that on the server in the file tnsnames.ora which comes with 3 predefined service names (one of them is "XE").

  1. I installed the Oracle Express database OracleXE112 which already comes with some preinstalled demo tables.
  2. When you start the installer you are asked for a password. I entered "xxx" as password. (not used in production)
  3. My server runs on the machine 192.168.1.158
  4. On the server you must explicitely allow access for the process TNSLSNR.exe in the Windows Firewall. This process listens on port 1521.
  5. OPTION A: For C# (.NET2 or .NET4) you can download ODAC11, from which you have to add Oracle.DataAccess.dll to your project. Additionally this DLL depends on: OraOps11w.dll, oci.dll, oraociei11.dll (130MB!), msvcr80.dll. These DLLs must be in the same directory as the EXE or you must specify the DLL path in: HKEY_LOCAL_MACHINE\SOFTWARE\Oracle\ODP.NET\4.112.4.0\DllPath. On 64 bit machines write additionally to HKLM\SOFTWARE\Wow6432Node\Oracle\...
  6. OPTION B: If you have downloaded ODAC12 you need Oracle.DataAccess.dll, OraOps12w.dll, oci.dll, oraociei12.dll (160MB!), oraons.dll, msvcr100.dll. The Registry path is HKEY_LOCAL_MACHINE\SOFTWARE\Oracle\ODP.NET\4.121.2.0\DllPath
  7. OPTION C: If you don't want huge DLL's of more than 100 MB you should download ODP.NET_Managed12.x.x.x.xxxxx.zip in which you find Oracle.ManagedDataAccess.dll which is only 4 MB and is a pure managed DLL which works in 32 bit and 64 bit processes as well and depends on no other DLL and does not require any registry entries.
  8. The following C# code works for me without any configuration on the server side (just the default installation):
using Oracle.DataAccess.Client;
or
using Oracle.ManagedDataAccess.Client;

....

string oradb = "Data Source=(DESCRIPTION="
    + "(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.158)(PORT=1521)))"
    + "(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=XE)));"
    + "User Id=SYSTEM;Password=xxx;";

using (OracleConnection conn = new OracleConnection(oradb)) 
{
    conn.Open();
    using (OracleCommand cmd = new OracleCommand())
    {
        cmd.Connection  = conn;
        cmd.CommandText = "select TABLESPACE_NAME from DBA_DATA_FILES";

        using (OracleDataReader dr = cmd.ExecuteReader())
        {
            while (dr.Read())
            {
                listBox.Items.Add(dr["TABLESPACE_NAME"]);
            }
        }
    }
}

If the SERVICE_NAME=XE is wrong you get error 12514. The SERVICE_NAME is optional. You can also leave it away.

Goff answered 20/4, 2017 at 21:19 Comment(1)
Thanks a lot, from your solution I found the trick, in my case, it was the anti-virus that was blocking the program, hence was not able to obtain a connection to the Oracle db.Dis
B
1

In my case the database had ran out of disk space. Which caused it to not respond. Once I cleared up that issue everything worked again.

Barmaid answered 20/4, 2014 at 2:12 Comment(1)
How can I find this out?Malita
V
1

I got the same error because the remote SID specified was wrong:

 > sqlplus $DATASOURCE_USERNAME/$DATASOURCE_PASSWORD@$DB_SERVER_URL/$REMOTE_SID 

I queried the system database:

select * from global_name;

and found my remote SID ("XE").

Then I could connect without any problem.

Voltmeter answered 13/10, 2017 at 10:55 Comment(0)
E
1

In my case, round brackets around the SERVICE_NAME was missing in the tnsnames.ora file.

<DBNAME> =
  (DESCRIPTION =
    (ADDRESS_LIST =
     (ADDRESS = (PROTOCOL=TCP)(HOST = nupark-cnvr-ora )(PORT=1521))
    )
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = <DBNAME> ***CLOSING ROUND BRACKET WAS MISSING HERE***
    )
  )

LISTENER_<DBNAME> =

  (ADDRESS = (PROTOCOL = TCP)(HOST = nupark-cnvr-ora)(PORT = 1521))
Eminent answered 10/3, 2020 at 17:59 Comment(0)
T
1

I had just to replace my connection string

from:

jdbc:oracle:thin:@localhost:1521:xe

To:

jdbc:oracle:thin:@localhost:1521:orcl
Thea answered 27/10, 2022 at 2:49 Comment(0)
C
0

For me this was caused by using a dynamic ipadress using installation. I reinstalled Oracle using a static ipadress and then everything was fine

Cosy answered 3/12, 2016 at 7:45 Comment(0)
R
0

I have implemented below workaround to resolve this issue.

  1. I have set the ORACLE_HOME using command prompt (right click cmd.exe and Run as System administrator).

  2. Used below command

    set oracle_home="path to the oracle home"

  3. Go to All programs --> Oracle -ora home1 --> Configuration migration tools --> Net Manager --> Listener

  4. Select Database Services from dropdown. Both Global database name and SID are set to the same (ORCL in my case). Set Oracle Home Directory.

Oracle Net Manager window example from oracle documentation: Oracle Net Manager example

  1. Click on File and save network configuration.
Rudd answered 29/11, 2017 at 12:34 Comment(0)
E
0

Restarting the VM worked for me

Eipper answered 20/3, 2019 at 3:35 Comment(0)
W
0

My issue was resolved by replacing the'SID' in URL with 'service name' and correct host.

Weese answered 23/8, 2019 at 13:47 Comment(0)
B
0

tnslsnr is up but database is down.

For oracle novice it is not obvious that database may be down while connections are accepted.

I had to start up database manually like that

su - oracle
export ORACLE_SID=XE
sqlplus sys as sysdba

And then in sql console

startup

In my case i failed to startup but got another error message and found the source of a problem - i had to change host name and then database auto startup was functional again.

Burkley answered 11/11, 2019 at 9:38 Comment(0)
H
0

The problem was that my connection string url contained database name instead of SID. Replacing database name with oracle database connection SID solved this problem.

To know your oracle SID's you can browse tnsnames.ora file.

XE was the actual SID, so this is how my tomcat connection string looks like now:

    <Resource
       name="jdbc/my_db_conn"
       auth="Container"
       type="javax.sql.DataSource"
       driverClassName="oracle.jdbc.driver.OracleDriver"
       url="jdbc:oracle:thin:@//127.0.0.1:1521/XE"
       username="test_user"
       password="test" />

My server version was "Oracle 11.2 Express", but solution should work on other versions too.

Hen answered 5/12, 2019 at 12:7 Comment(0)
M
0

I had a case that I used DBMS where I had to fulfill a db connection form.

I put SID into the Database field and in the dropdown, next to the field, I had had 'Service Name' value instead of 'SID' value.
(normally I don't use Oracle database so I've not been aware of the difference)

That was the reason I got the error message.

Misbelief answered 28/7, 2020 at 16:2 Comment(0)
R
0

The problem can be in the incorrect URL.

For example, I'm using Oracle database (inside VM) with Spring framework and having this issue.

I had in my application.properties file:

spring.datasource.url=jdbc:oracle:thin:@//localhost:1521/orcl12c

But the db version was defferent:

spring.datasource.url=jdbc:oracle:thin:@//localhost:1521/orclcdb

The correct URL can be found in the tnsnames.ora file (this file would be available where the Oracle server, so if you using VM, you should look for this file inside your host VM). For example for Oracle in the VirtualBox the command to see this file is:

nano /u01/app/oracle/product/version/db_1/network/admin/tnsnames.ora
Resound answered 17/4, 2021 at 21:59 Comment(0)
R
0

In my case for Linux environment, the oracle file at ORACLE_HOME/bin was highlighted in "Red" color with different permissions as below:
enter image description here

I changed the permissions of this file as below:

1) Stop Oracle -> sudo systemctl stop oracle.service
2) Change the permission of oracle file at ORACLE_HOME/bin directory as "sudo chmod 777 oracle"
3) Start Oracle -> sudo systemctl start oracle.service

Then after this change, I checked the status of listener using lsnrctl status.Here, I can see the db instances loaded successfully.

However, I can connect using sqldeveloper only, with sqlplus command line I'm getting ORA-12547: TNS Lost Contact error. So, this can a quick workaround to use sqldeveloper.

Note: Take a backup of oracle file before changing the permissions.

Rudelson answered 11/8, 2021 at 13:49 Comment(0)
H
0

This is a tricky Oracle error, as it can have lots of possible causes. It seems to mean that something in this chain of events is failing:

  • Look up the service name in tnsnames.ora
  • Connect to the host in the tnsnames entry
  • Reach the listener on that host
  • Tell the listener that you want to connect to the service specified in the tnsnames entry

Anything that throws that off can cause this error, from a missing bracket in tnsnames.ora, to a connecting to the wrong database host.

If tnsping works, that rules some things out, as it means that we can look up the entry in tnsnames, connect to the host, and contact the listener ... so we know, for instance, that the host at least exists, and there is an Oracle listener running there; but the listener is saying the service name is not known. That still leaves a lot of possibilities like:

  • service name in tnsnames.ora is just wrong
  • database instance is not running and/or not registered with the listener
  • we're connecting to the wrong Oracle host
  • we're connecting to the wrong listener (wrong port) on the correct Oracle host
  • firewall/networking issue (apparently it's possible that a firewall could allow tnsping packets through but block other client applications from connecting)

I've seen an ORA-12514 with tiny typos in tnsnames.ora ... like incorrect indenting. But I suspect tnsping wouldn't succeed if that is the issue.

When I encountered this most recently, it was due to the 3rd bullet-point above; we were connecting to an Oracle database host -- just not the right host; we had to ensure that the hostname in the tnsnames entry was for the Oracle database server that was hosting this particular database service.

Connecting to the Oracle host and running lsnrctl status can help check that the service is known to this listener. Remember that lsnrctl by default checks the default listener name. You may need to check listener.ora to see if there are other names listeners in this database instance.

Harmsworth answered 7/4, 2023 at 18:27 Comment(0)
G
0

I got the same error in spring boot at first i gave the url as spring.datasource.url=jdbc:oracle:thin:@localhost:1521:TEST_DB

but give the url as

spring.datasource.url=jdbc:oracle:thin:@localhost:1521/ORCL

this solved my problem

Gladsome answered 24/7, 2023 at 12:11 Comment(1)
There are 30 existing answers to this question, including a top-voted, accepted answer with nearly three hundred votes. Are you certain your solution hasn't already been given? If not, why do you believe your approach improves upon the existing proposals, which have been validated by the community? Offering an explanation is always useful on Stack Overflow, but it's especially important where the question has been resolved to the satisfaction of both the OP and the community. Help readers out by explaining what your answer does different and when it might be preferred.Yuyuan
P
0

Sorry, but none of the aswners worked for me. After many tries I discovered the problem was FULL DISK, that's right.

try this:

df -h

then if you see anything 100%, try to clean to release space, in my case, the "listener.log" file was with 2.1G. Then I did:

sudo sh -c "echo -n > /var/log/dbs/oracle/diag/tnslsnr/<your_db>/listener/trace/listener.log"
Peaslee answered 10/4, 2024 at 15:18 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.