ORA-12162: TNS:net service name 解决方案

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


现象:


目前连接数据库时候出现问题了:

[oracle@as3]$ sqlplus “/ as sysdba”

ERROR:

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



Enter user-name: oral

Enter password:

ERROR:

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



Enter user-name: oral

Enter password:

ERROR:

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



可能问题:

1:~.bash_profile文件中估计没有正确设置ORACLE_SID环境变量

2:检查sqlnet.ora中sqlnet.authentication_services设置

3:用 orapwd 重建密码文件


解决问题:


上面的问题经过检查是由于ORACLE_SID设置引起的,主要是因为在oracle环境变量中,虽然设置了ORACLE_SID,但是没有export引起的。最后在~.bash_profile中设置

export ORACLE_SID,问题解决!



下面是metalink.的解释:



The information in this document.nbspapplies to:

Oracle Server - Enterprise Edition - Version: 10.1.0.3 to 10.1.0.3

This problem can occur on any platform.

Affects most UNIX platforms (not seen on Microsoft Windows due to difference in BEQ communication specifics)

Errors

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



Symptoms

When trying to connect locally (BEQ) to the database, getting "ORA-12162 error tns:net service name

is incorrectly spelled"



This is unusual because a TNS:Net service name is not being specified, nor is the environement variable TWO_TASK set.



Cause

The user environment variable $ORACLE_SID is not set.

When this is not set, then SQL*Plus use, without a connect string, may result in an ORA-12162 error.

Solution

Add the ORACLE_SID to the .profile for the Oracle user.

This will give the BEQ adapter a route to connect to the instance.



References

原文地址:http://www.ixdba.net/article/ae/256.html
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值