Skip to content

Instantly share code, notes, and snippets.

@VitoVan
Last active April 17, 2023 12:22
Show Gist options
  • Save VitoVan/2d02ea6901e2122089c8c7f85af5b245 to your computer and use it in GitHub Desktop.
Save VitoVan/2d02ea6901e2122089c8c7f85af5b245 to your computer and use it in GitHub Desktop.
How to solve TNS-01153 / ORA-12541 / ORA-12514 on Windows

TNS-01153 : Failed to Process the String ...

ORA-12541: TNS: no listener ...

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


If you are cursed like me, have to do use Oracle database and Windows, suddenly those shits came out of nowhere and wasted you hours, the following instruction might save you some time:

0. You need to make sure your network adapter is enabled

It is not necessary to be connected to the internet, but it must be enabled.

like this:

imagen

1. Use Oracle Net Manager, delete all the fucking Listeners, and re-add it

Please make sure, you added both IP and HOSTNAME:

imagen

imagen

2. Use Oracle Net Manager, make sure the Service Naming shits got IP Address as HOSTNAME

imagen

3. Open CMD with Administrator, stop and start lnsrctl

imagen

imagen

You may get: The listener supports no services

4. Open Services, restart OracleService

imagen

5. Wait for 1 fucking minute

6. Check the status of the listener

If you see something like this:

imagen

Then congrats! You are all set.

If not, please carry on.

7. Edit tnsnames.ora

NO! I never touched that shit, why should I edit it? My server just worked a moment ago, I changed nothing, now I have to change something!?

Yes, you are.

On my system it is located at:

C:\app\vito\product\21c\homes\OraDB21Home1\network\admin\tnsnames.ora

Find your own folder by observing the output of lsnrctl status

Let's see what the fuck it is inside this file:

imagen

See?

The IP address is hard coded! Change that shit to 127.0.0.1 (or anything else if you know what you are doing)

imagen

save the file

8. Repeat step 3 to 6

If you are still fucked up by Oracle and Windows till now, please leave comments below, I may not be able to help you, but it definitely comfort someone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment