【故障处理】ORA-12162 错误的处理
admin
2023-05-08 23:02:00
0

【故障处理】ORA-12162: TNS:net service name is incorrectly specified

 

一.1  场景

今天拿到一个新的环境,可是执行sqlplus / as sysdba的时候不能登录,报ORA-12162: TNS:net service name is incorrectly specified的错误,之前没有碰到过,就随时记录下,备查。

 

一.2  实验还原

Last unsuccessful login: Thu Mar 19 16:59:06 BEIST 2015 on /dev/pts/0 from 200.31.177.54

Last login: Thu Jul 16 22:44:20 BEIST 2015 on ftp from ::ffff:200.31.156.201

*******************************************************************************

*                                                                             *

*                                                                             *

Welcome to AIX Version 5.3!                                                *

*                                                                             *

*                                                                             *

*  Please see the README file in /usr/lpp/bos for information pertinent to    *

*  this release of the AIX Operating System.                                  *

*                                                                             *

*                                                                             *

*******************************************************************************

oracle@SJCk4:/home/oracle>

oracle@SJCk4:/home/oracle>

oracle@SJCk4:/home/oracle>ps -ef|grep ora_pmon_

  oracle  348182       1   0   Apr 25      -  7:42 ora_pmon_DATAWDB

  oracle  630842       1   0   Apr 25      - 20:02 ora_pmon_COGDB

  oracle  843948       1   0   Apr 25      -  6:45 ora_pmon_ETLDB

  oracle 5005418 4427974   0 09:44:03  pts/0  0:00 grep ora_pmon_

oracle@SJCk4:/home/oracle>ORACLE_SID=DATAWDB

oracle@SJCk4:/home/oracle>echo $ORACLE_SID

DATAWDB

 

oracle@SJCk4:/home/oracle>

oracle@SJCk4:/home/oracle>sqlplus / as sysdba

 

SQL*Plus: Release 10.2.0.1.0 - Production on Fri Jul 17 09:56:44 2015

 

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

 

ERROR:

ORA-12162: TNS:net service name is incorrectly specified

 

 

Enter user-name:

ERROR:

ORA-12162: TNS:net service name is incorrectly specified

 

 

Enter user-name:

ERROR:

ORA-12162: TNS:net service name is incorrectly specified

 

 

SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus

oracle@SJCk4:/home/oracle>echo $ORACLE_HOME

/app/oracle/product/10.2.0/db_1

oracle@SJCk4:/home/oracle>echo $ORACLE_SID

DATAWDB

oracle@SJCk4:/home/oracle>

oracle@SJCk4:/home/oracle>

oracle@SJCk4:/home/oracle>

oracle@SJCk4:/home/oracle>

oracle@SJCk4:/home/oracle>export ORACLE_SID=DATAWDB

oracle@SJCk4:/home/oracle>sqlplus / as sysdba

 

SQL*Plus: Release 10.2.0.1.0 - Production on Fri Jul 17 09:59:27 2015

 

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

 

 

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production

With the Partitioning, OLAP and Data Mining options

 

SQL>

SQL>

 

 

 

 

一.3  总结

[oracle@rhel6_lhr ~]$ oerr ora 12162

12162, 00000, "TNS:net service name is incorrectly specified"

// *Cause:  The connect descriptor corresponding to the net service name in

// TNSNAMES.ORA or in the directory server (Oracle Internet Directory) is

// incorrectly specified.

// *Action: If using local naming make sure there are no syntax errors in

// the corresponding connect descriptor in the TNSNAMES.ORA file. If using

// directory naming check the information provided through the administration

// used for directory naming.

[oracle@rhel6_lhr ~]$

 

可以确定的是ORA-12162是由于ORACLE_SID未设置或者设置不正确导致的,推荐使用export ORACLE_SID=XXX来设置,当不能设置的时候再用ORACLE_SID=XXX来直接设置。

 

 

另外的一篇blog参考:http://blog.itpub.net/26736162/viewspace-1735917/

 

 

 

一.4  About Me

 

...........................................................................................................................................................................................

本文作者:小麦苗,只专注于数据库的技术,更注重技术的运用

ITPUB BLOG:http://blog.itpub.net/26736162

本文地址:http://blog.itpub.net/26736162/viewspace-1736192/

本文pdf版:http://yunpan.cn/QCwUAI9bn7g7w  提取码:af2d

QQ:642808185 若加QQ请注明你所正在读的文章标题

创作时间地点:2015-07-17 10:00~ 2015-07-17 19:00 于×××交易中心

<版权所有,文章允许转载,但须以链接方式注明源地址,否则追究法律责任!>

...........................................................................................................................................................................................

 

 

相关内容

热门资讯

河南一地入选!国家级试点城市名... 【大河财立方消息】5月14日消息,工业和信息化部、财政部公示第三批制造业新型技术改造城市试点拟入选名...
周日有大到暴雨!郑州将有连续性... 受切变线和低空急流共同影响,16日至18日我市将有一次明显降水过程。15日夜里有阵雨,16日下午到夜...
降的是费率 增的是底气 河南失... 中国铁路郑州局集团有限公司开展业务技能实操训练。受访者供图一笔失业保险稳岗返还资金,到了企业手里,可...
宇树科技发布全球首款载人变形机... 宇树科技CEO王兴兴与载人变形机甲GD01击拳。宇树科技供图5月12日,宇树科技发布全球首款量产版载...
洗衣机地漏盖不闭合怎么修 如果您发现您的洗衣机地漏盖不闭合,这可能是由于以下原因之一: 1. 漏水管生锈或破裂:这可能是漏水...
坚定不移沿着习近平总书记指引的... 5月12日,安阳市林州市红旗渠青年洞景区研学热潮涌动,来自各地的学生沿渠岸栈道有序前行,近距离触摸“...
波轮洗衣机不盖盖儿是不是不工作 一定不会工作,因为洗衣机盖子上有自动刹车装置。如果洗衣机盖子没盖上,就无法工作。洗衣机不工作还有其他...
美亚科技被出具警示函!此前A股... 【大河财立方消息】5月13日,广东证监局披露行政监管措施决定书,对广东美亚旅游科技集团及相关责任人出...
凤凰直击:中美元首会晤,媒体争... 5月14日上午,中美元首举行会谈。凤凰卫视记者霍伟伟在人民大会堂发回现场报道。
如何修复洗衣机后盖盖不上 洗衣机后盖无法盖上是相当常见的问题。如果发现洗衣机后盖无法盖上,建议首先仔细检查后盖和机器是否与之前...