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

  今天使用oracle用户登录sqlplus出现“ORA-12162: TNS:net service name is incorrectly specified”。
    如下:
[oracle@oracle ~]$ sqlplus
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Feb 29 19:19:26 2012
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
Enter user-name: sys
Enter password:
ERROR:
ORA-12162: TNS:net service name is incorrectly specified
 
    网上查询是没有设置ORACLE_SID环境变量原因。
    1、查看是否设置环境变量,用“echo  $ORACLE_SID”查询,如下:
[oracle@oracle ~]$ echo $ORACLE_SID
 
[oracle@oracle ~]$
    2、设置环境变量,用"vi .bash_profile"编辑命令,在其后加 "export  ORACLE_SID=oracle13g"。
    3、使用“source .bash_profile”命令,使环境变量生效。
    4、再使用oracle用户登录sqlplus,成功。如下:
[oracle@oracle ~]$ sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Feb 29 19:41:43 2012
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
SQL> conn /as sysdba
Connected to an idle instance.
 
 下面是从网上转载过来的,见 http://space.itpub.net/519536/viewspace-672034
 
使用命令oerr ora 12162查询,如下:
[oracle@oracle ~]$ 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.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值