Ora-12560: TNS:protocol adapter error
To resolve the ORA-12560 error quickly, confirm the correct functioning of Oracle service (services.msc
on Windows, ps -ef | grep pmon
on Unix/Linux), and ensure it's running. Modify your ORACLE_HOME and ORACLE_SID through:
Also, check and adjust your TNSNAMES.ORA and LISTENER.ORA in the network/admin
folder. If changes are made, restart the listener:
Make sure that your network details in the configurations are accurate and the client and server are connected satisfactorily by host and port.
When Oracle Services Go Rogue
Start Me Up: Ensure Oracle Services
Confirm that the related Oracle database service for your instance is running. In the Windows operating system, items tagged as OracleService<SID>
should be activated. Access the service via Command Prompt or Services.msc:
<!-- Hey! SID got its own OracleService. Movin' up in the world, hah! -->
Or use the services interface:
- Press
Win + R
, typeservices.msc
, and press Enter. - Find
OracleService<SID>
in the list. - Right-click and select Start if it isn't running.
Set the Stage: Environment Variables
ORACLE_SID variable should be an exact match to your active database SID. Utilize the command line to set this:
For Windows:
<!-- You can't spell "Sideris" without SID. Well, you technically can, but where's the fun in that? -->
In Unix/Linux:
Also, verify that the TNS_ADMIN environment variable points toward the directory where your tnsnames.ora
file is. For instance:
Check Your Oracle Files
Be sure to verify entries in tnsnames.ora and listener.ora for deviations. Incorrect names of services, ports, or host IP addresses will lead to the ORA-12560 error. The common localtion of tnsnames.ora
is:
Oracle Network Diagnostics
Pinging with Tnsping
Begin with the simplest of solutions: run a tnsping to your tnsalias
to ensure network communication is functional:
This will validate if your client can communicate with the listener over at the Oracle server.
Reboot to Reconnect
If there are any adjustments made to your tnsnames.ora
or similar network files, be sure to restart the listener:
In some scenarios, the database, despite running, might fail to respond. You may need to restart the database:
On Windows:
<!-- "Try restarting" — Tech support, since time immemorial -->
On Unix/Linux, this might depend on your startup scripts but typically involves connecting to SQL*Plus and executing similar commands.
The Mystery Oracle Service
If the Oracle service is missing, ORADIM utility can bail you out to create it:
<!-- Who needs a magic wand when you have ORADIM? -->
The Journey to Error Resolution
Verifying Database Accessibility
The crucial part is not only to check whether the Oracle service is active but also to validate that it restarts successfully after a reboot. Ensure that the autostart feature for the database service is enabled.
Post-Recovery Database Accessibility
After a system reboot or recovery from a failure, connect to the Oracle instance with SQL*Plus to check accessibility:
<!-- Username: admin, Password: admin. Works every time, right? -->
Deeper Dive Into Oracle and TNS
Get a grip on the Oracle network architecture. A deeper understanding of how the TNS listener interacts with the database service is crucial to avoid future mistakes. Refer to the Oracle Network Configuration Administrator's Guide for more information.
Advanced Troubleshooting Techniques
Sometimes, obscure issues such as incorrect file permissions, a corrupt Oracle software installation, or improper network infrastructure setup can trigger the ORA-12560 error. Keep an eye out for:
- Permissions to Oracle installation and network files.
- Any network equipment failure that might disrupt the Oracle service (firewalls, routers etc).
- Check Oracle's alert.log for any database-specific issues.
Was this article helpful?