ITPub博客

首页 > 数据库 > Oracle > ORA-12162: TNS:net service name is incorrectly specified

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

原创 Oracle 作者:shytodear 时间:2015-05-14 16:01:48 0 删除 编辑


1、着急as sysdba登数据库,报错:
[oracle@enmoedu1 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Thu May 14 15:45:15 2015

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

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


2、用tns登陆是正常的
[oracle@enmoedu1 ~]$ sqlplus system/oracle@text1

SQL*Plus: Release 11.2.0.3.0 Production on Thu May 14 15:47:06 2015

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

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> 

3、最后发现竟是ORACLE_SID没有设置
[oracle@enmoedu1 ~]$ export ORACLE_SID=text1
[oracle@enmoedu1 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Thu May 14 15:48:29 2015

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

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> 

4、警醒
1)有时错误提示不明显,不要被误导。
2)要有良好的习惯:登库前一定要看下ORACLE_SID的值!

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/27126919/viewspace-1654781/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2013-11-05

  • 博文量
    66
  • 访问量
    238106