Troubleshooting record: Plsql cannot connect to Oracle ora-12154 ora-12560

Source: Internet
Author: User
Tags sqlplus

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
  1. Tnsnames.ora fill in no errors
  2. The monitoring service has started: Management tools -Services,oracleoradb10g_home1tnslistener Services.
  3. Server ORCL instance started: Management tool ---service,oracleserviceorcl
  4. Server can ping: network connection is good
  5. 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.
  6. Oracle Client Oracle Net Manager test passes to show that you can actually connect
  7. The environment variable path value setting has been modified well.
  8. Sqlplus prompt ora-12154:sqlplus username/password @192.168.164.132:1521/orcl.
  9. 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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.