【故障处理】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 于外汇交易中心

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

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

【故障处理】ORA-12162 错误的处理的更多相关文章

  1. 【故障处理】ORA-19809错误处理

    [故障处理]ORA-19809错误处理 一.1  BLOG文档结构图       一.2  前言部分 一.2.1  导读和注意事项 各位技术爱好者,看完本文后,你可以掌握如下的技能,也可以学到一些其它 ...

  2. 【故障处理】CRS-1153错误处理

    [故障处理]CRS-1153错误处理 1  CRS-1153: There was an error setting Oracle Clusterware to rolling patch mode. ...

  3. 【故障处理】IMP-00010错误 12C的dmp文件导入11G

    [故障处理]IMP-00010错误 12C的dmp文件导入11G 1  BLOG文档结构图 2  前言部分 2.1  导读和注意事项 各位技术爱好者,看完本文后,你可以掌握如下的技能,也可以学到一些其 ...

  4. ORA 00972 错误处理

    Oracle 11G SQL 写好的脚本执行后报错:ORA 00972 标识符过长 可能的原因一: select 语句中的字段别名太长,中文字符别名最长为10个汉字,简化别名名称,问题得到解决. 可能 ...

  5. navicat cannot load oci dll||oracle 改字符集为GBK后 navicat 连不上||Ora-28547 ora net错误

    此段适用于 解决 navicat cannot load oci dll 环境 Navicat Premium  和 oracle 原因,navicat 32 和64 都只支持 32位的oci.dll ...

  6. 关于oracle 11g导出数据时 报 ORA 1455错误的处理

    因为导出的该用户的表可能存在空数据表,那么可能就会出现此其异常. 首先:  查看:     SQL>show parameter deferred_segment_creation;  假设为T ...

  7. plsql 连接oralce数据库,报ora 12557 tns 协议适配器不可加载错误

    使用plsql 连接oracle 数据库报ora 12557 错误: 解决方案: 1:首先确保服务中的service以及监听器都开启 2:F:\app\Administrator\product\11 ...

  8. 【故障处理】ORA-12162: TNS:net service name is incorrectly specified (转)

    本文将给大家阐述一个因未设置系统环境变量ORACLE_SID导致ORA-12162错误的案例.希望大家有所思考. 1.获得有关ORA-12162报错信息的通用表述信息 [oracle@asdlabdb ...

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

    本文将给大家阐述一个因未设置系统环境变量ORACLE_SID导致ORA-12162错误的案例.希望大家有所思考. 1.获得有关ORA-12162报错信息的通用表述信息[oracle@asdlabdb0 ...

随机推荐

  1. centos 6.8操作系统安装arcgis server 10.4-后续篇

    ./Setup //执行安装 (运行安装脚本后会进行安装环境检测,会检查检查软件包和主机名,检测通过才可以开始安装.)如果检查不通过,会提示和报错,并中断安装过程.(1) 解决 hostname 问题 ...

  2. Lamda OrderBy 排序问题

    var itemModel = itemList.OrderBy(s=> decimal.Parse(s.Price)).ToList(); 前端传递的list数据金额或者其他非数字类型的字段最 ...

  3. ubuntu解决网络连接的优先级

    ubuntu下无线连接网络,有线连接板卡,解决网络连接的优先级 1. 查看网关  ip route show dev wlp2s0 proto kernel scope link src dev wl ...

  4. Executors创建四种线程池

    newCachedThreadPool创建一个可缓存线程池,如果线程池长度超过处理需要,可灵活回收空闲线程,若无可回收,则新建线程.newFixedThreadPool 创建一个定长线程池,可控制线程 ...

  5. tomcat安全基线

    为了符合tomcat安全基线,需要做一下加固: 1.管理用户的密码加密:<摘要算法加密tomcat登录密码> 管理用户在conf/tomcat-users.xml中配置,密码一般是明文形式 ...

  6. Apache限制IP并发数和流量控制

    使用mod_limitipconn模块限制IP并发连接数安装: wget http://dominia.org/djao/limit/mod_limitipconn-0.24.tar.bz2 tar ...

  7. 海康—SADP激活(设备网络搜索)

    海康sadp搜索工具(SADPTool)用于从网络上搜索同一网段内的所有在线设备.可以修改设备的缺省密码,修改网络IP地址及端口号 ,子网掩码及网关地址,IPV6地址网关地址,HTTP端口号和设备序列 ...

  8. c#之break和continue的区别

    break:跳出循环,执行循环外的语句: continue:跳出此次循环,进入下一次循环:

  9. 晶体管放大电路与Multisim仿真学习笔记

    前言 开始写点博客记录学习的点滴,第一篇就写基本的共射极放大电路吧. 很多教材都是偏重理论,而铃木雅臣著作的<晶体管电路设计>是一本很实用的书籍,个人十分推荐! 下面开始我的模电重温之旅吧 ...

  10. ActiveMQ 安装方法

    1. 打开浏览器,访问网址 http://activemq.apache.org/components/classic/download/ ,下载最新的版本,当前最新版本为5.15.9,根据Activ ...