It's really unfamiliar with Oracle's various errors, documenting the final troubleshooting record of a long-troubled problem.
First, the symptom description:
Plsql Unable to connect to the database, prompting: "Ora-12154:tns: Unable to resolve the specified connection identifier"
Second, the process of troubleshooting
- Tnsnames.ora fill in no errors
- The monitoring service has started: Management tools -Services,oracleoradb10g_home1tnslistener Services.
- Server ORCL instance started: Management tool ---service,oracleserviceorcl
- Server can ping: network connection is good
- Instance can tnsping: can ping pass, then the client can resolve listener machine name, and Lister has been started, but does not mean that the database has been opened, and the process of tsnping and real client connection is not consistent.
- Oracle Client Oracle Net Manager test passes to show that you can actually connect
- The environment variable path value setting has been modified well.
- Sqlplus prompt ora-12154:sqlplus username/password @192.168.164.132:1521/orcl.
- Plsql-preference-oracle Home is manually set up correctly.
The process has been repeated n times can never connect, always error "ORA-12154".
Third, the solution
After repeated changes, and finally one day with the Sqlplus remote connection times a new error:
"Ora-12560:tns: Protocol Adapter Error"
Finally, the server side sets the ORCLE_SID=ORCL in the environment variable.
Online Baidu solution is as follows
Enter regedit in the run , enter the registry, and then go to HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\HOME0 to set the environment variable Oracle_sid is set to * * * *, which is the database SID.
or right-click on My Computer, properties -- Advanced system settings--Environment variables---System variables--New variable Name=oracle_sid, variable value =****,* * * * Isdatabase SID. or into sqlplus .Before, in command line down set oracle_sid=******** is the database SID.
But I entered the registry and found that my oracle_sid=orcl, no problem.
Continue to try the following settings for the environment variable, new variable: ORACLE_SID=ORCL, problem solved.
remains to be explored
So here's the question:
this server in the registry set the ORACLE_SID is not guaranteed to be fully connected, preferably set oracle_sid; and another server that was exactly the same as he was (the two are actually virtual machines, copied over, exactly the same), not set oracle_sid in the environment variable but can connect. Why is this?
Reference
ORA-12560:TNS: Protocol Adapter error
Ora-12154:tns: Unable to resolve the specified connection identifier
"Ora-12154:tns: Unable to parse the specified connection
SQL Plus connection remote ORALCE database
Troubleshooting record: Plsql cannot connect to Oracle ora-12154 ora-12560