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

ora-12162

 

ORA-12162: TNS:net service name is incorrectly specified (单实例与RAC下处理方式基本一致)

 

RAC环境下,本机两个节点登陆均包如下错误:

1sysdb登陆

[oracle@db1 ~]$ sqlplus /  as sysdba

 

SQL*Plus: Release 11.2.0.3.0 Production on Tue Sep 24 09:00:13 2013

 

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

 

ERROR:

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

 

 

 

 

 

[oracle@db2 ~]$ sqlplus / as sysdba

 

SQL*Plus: Release 11.2.0.3.0 Production on Tue Sep 24 09:04:49 2013

 

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

 

ERROR:

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

 

 

 

2system用户登陆

[oracle@db1 ~]$ sqlplus  system/system

 

SQL*Plus: Release 11.2.0.3.0 Production on Tue Sep 24 09:05:49 2013

 

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

 

ERROR:

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

 

 

 

 

[oracle@db2~]$ sqlplus  sys/system

 

SQL*Plus: Release 11.2.0.3.0 Production on Tue Sep 24 09:06:49 2013

 

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

 

ERROR:

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

 

 

 

 

(3)数据库服务名方式连接

 

oracle@db1 ~]$ sqlplus  sys@db   as sysdba

 

SQL*Plus: Release 11.2.0.3.0 Production on Tue Sep 24 09:07:49 2013

 

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

 

Enter password:

 

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,

Data Mining and Real Application Testing options

 

SQL> select  instance_name from v$instance;

 

INSTANCE_NAME

----------------

db1

 

 

 

oracle@db2 ~]$ sqlplus  sys@db  as sysdba

 

SQL*Plus: Release 11.2.0.3.0 Production on Tue Sep 24 09:09:49 2013

 

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

 

Enter password:

 

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,

Data Mining and Real Application Testing options

 

SQL> select  instance_name from v$instance;

 

INSTANCE_NAME

----------------

db2

 

 

 

 

 

 

 

 

 

查看错误通用表述信息

[oracle@db1 ~]$ 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@db1 ~]$

 

 

 

 

 

 

 

 

故障处理

故障原因:两个节点均未设置  ORACLE_SID未设置

 

进入oracle系统用户下,两个节点下分别设置

vi  .bash_profile  加入ORACLE_SID=db1  ; export  ORACLE_SID

vi  .bash_profile  加入ORACLE_SID=db2  ; export  ORACLE_SID

 

发现登陆正常:

 

[oracle@db1 ~]$ sqlplus / as  sysdba

 

SQL*Plus: Release 11.2.0.3.0 Production on Tue Sep 24 09:22:20 2013

 

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

 

 

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,

Data Mining and Real Application Testing options

 

SQL>

 

 

 

 

oracle@db1 ~]$ sqlplus / as  sysdba

 

SQL*Plus: Release 11.2.0.3.0 Production on Tue Sep 24 09:22:20 2013

 

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

 

 

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,

Data Mining and Real Application Testing options

 

SQL>

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值