Ora-12162:tns:net Service name is incorrectly specified error resolution

Source: Internet
Author: User

This article will give you a case of ORA-12162 error caused by not setting the system environment variable ORACLE_SID.

I hope you have some thought.

1. Failure phenomenain this paper, the description of the fault is different from the general description of the problem, there is no problem in connection string connection recorded in the database server side using Tnsnames.ora. However, if a connection string is not specified, a ORA-12162 error will be reported.

1) Use the system user to try to log on to the systems, you will receive an error such as the following information
[Email protected] ~]$ sqlplus system/syssql*plus:release 10.2.0.3.0-production on Sat 22:54:02 2010Copyright (c ) 1982, 2006, Oracle.  All Rights reserved.error:ora-12162:tns:net service name is incorrectly specifiedenter user-name:
2) Login with SYSDBA to get the same error message
[Email protected] ~]$ sqlplus/as sysdbasql*plus:release 10.2.0.3.0-production on Sat 22:54:48 2010Copyright ( c) 1982, 2006, Oracle.  All Rights reserved.error:ora-12162:tns:net service name is incorrectly specifiedenter user-name:
3) But at this point, it is assumed that using the service name method to connect to the database is successful. This is also the problem of the phenomenon of the strange place.
[[email protected] ~]$ sqlplus system/[email protected]sql*plus:release 10.2.0.3.0-production on Sat 27 22:53:41 20 10Copyright (c) 1982, 2006, Oracle.  All rights reserved.connected to:oracle Database 10g Enterprise Edition Release 10.2.0.3.0-64bit productionwith the part Itioning, Oracle Label Security, OLAP and Data Mining scoring Engine options[email protected]>

Imagine that your goal is to get into the database for maintenance operations at high speed, but it's awkward to sign in at this point.

What's even more maddening is that. Assume that a connection string is used to log on to the database for a stop operation. The result will be more dire: The database will fail to start because it cannot log on properly.



2. Cause of failureThe reason behind the strange fault is that the foundation: ORACLE_SID not specified!


Confirm the current Oracle_home and ORACLE_SID environment variables for the system

[Email protected] ~]$ echo $ORACLE _home/oracle/app/oracle/product/10.2.0/db_1[[email protected] ~]$ echo $ORACLE _sid[ [Email protected] ~]$

Visible, the ORACLE_HOME environment variable is only set at this time. But Oracle_sid is empty at this point, which is the real reason for the problem.



3. Fault Handlinggive the Oracle_sid. Try logging in again.
[[email protected] ~]$ export Oracle_sid=ora10g[[email protected] ~]$ echo $ORACLE _sidora10g[[email protected] ~]$ Sqlplu S/as sysdbasql*plus:release 10.2.0.3.0-production on Sat 23:27:34 2010Copyright (c) 1982, 2006, Oracle.  All rights reserved.connected to:oracle Database 10g Enterprise Edition Release 10.2.0.3.0-64bit productionwith the part Itioning, Oracle Label Security, OLAP and Data Mining scoring Engine options[email protected]>


OK, the problem processing is complete at this time.


Ora-12162:tns:net Service name is incorrectly specified error resolution

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.