Ora--12154:tns:could not resolve the connect identifier specified error handling

Source: Internet
Author: User

Ora--12154:tns:could not resolve the connect identifier specified error handling

Today encountered a situation, there is a machine with Plsql connection database How also not even, has been reported this error: Ora--12154:tns:could not resolve the connect identifier specified

Viewing the situation: there is no problem with the database, other colleagues can connect, the native net Manager configures the connection, and the test passes; only plsql log on, not even the program connection. Note: This machine just reload the system, the new environment.

Then i went online and searched a circle, according to the phenomenon, probably judge is the client's problem, so let colleagues see whether the client installation has a problem, he also feel like a bit wrong, the installation directory does not have much, so the proposal to reinstall the client, the second reload or not, because the uninstall is not thorough. This time clean up, and then reload again, tell once all OK.

The following will be found in a number of good materials are summed up:

1. Check that the server-side listening service is turned on, and if it is not turned on, start its listening

Client: tnsping <tns_name>
Server Linux:

#>lsnrctl Status View listening status

#>lsnrctl Start Start listening

2. Connect with SQL Plus to try, if the SQL plus connection succeeds, it means your tnsnames.ora content is wrong

My problem is that there is a space in front of the alias dev_db, this can be seen through the text editor (edit Plus,ue, etc.) to see whether there are spaces, as long as there are spaces that is certainly not, and if the content is in the middle of the file, it will cause all the corresponding connection aliases in the file is unsuccessful , if only its own connection alias is not successful on the last side, the other connection alias can still be connected successfully. (Note: My Tnsnames.ora is configured with multiple database instance connections, all of which have multiple connection aliases.) )

Such as:

Space dev_db =
(DESCRIPTION =
(Address_list =
(address = (PROTOCOL = TCP) (HOST = 172.168.10.5) (PORT = 1521))
)
(Connect_data =
(SID = ora10)
)
)

3. If you ensure that your Tnsnames.ora content is not wrong, then please delete all the files in the%oracle_home%\product\10.2.0\db_1\network\admin directory, and then reconnect, generally can be resolved.

Description: The file in that directory is generated dynamically when you establish the connection, don't be afraid to delete the problem

4. Enter the main interface of the Plsql developer, select Cancel in the login interface to enter the main interface, then select the menu Tools (Tools)-preferences (preferences), in the Settings window, select Oracle-connection (Connection), In the corresponding Settings window, locate the Oracle home directory, select the version of your locally installed client, save the settings, and then restart Plsql Developer, and you can log on normally.

After installing the solution for Oracle Developer Tools, the solution to the error "ORA-12154:TNS: Unable to resolve the specified connection identifier" appears as follows:

1. Check the registration form, hkey_localmachine\software\oracle The following oracle_home, if not, modify to correct;

2. Uninstall the ODP for. NET (or uninstall ODT for. NET, ODT contains the ODP, ODT is a vs.net integrated plug-in for connecting and browsing the Oracle database, and provides drag and drop operations on the Oracle database, similar to vs.net for SQL Server's resource manager);

3. If odt for. NET directory still exists, delete or rename this directory;

Then reboot the system, reconnect the ASP.net program, and if you have the same error, I suggest we reinstall Oracle.

Analysis Reason: The system originally installed is the Oracle 10G 10.1.0, after unloading has not restarted has installed 10.2.0, the result first the listener does not come, unexpectedly still pointed to 10.1.0 position, the listener certainly cannot start.

Processing process:
1, find the registry, the listener point to the new location, restart the service, OK;
2, Pl/sql developer or not connected, other ways are normal. Load the ODP for. Net load that was originally installed on another logical disk to the same location as the Oracle 10.2.0. Reboot the system, developer or error, but some times the wrong message is empty.
3, because developer settings have changed, into the menu tools "PREFERENCES ..." setting, in Oracle connection, the Oracle home and OCI libiary are set to NULL, which is automatic detection. The connection is normal and the problem is solved.

Second, the application of the error:

A difficult cause to think of causing ORA-12154
When using oracleclient.oracleconnection (I am not connected to Oracle 11g, other versions are unknown), if your execution directory is too long or has parentheses, etc. (without examining some of the symbols), then even if your service name is right, can also cause ORA-12154 problem "TNS: Unable to process service name", when this problem occurs, please also consider this reason

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.