ITPub博客

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

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

原创 Oracle 作者:随风映雪 时间:2016-12-28 20:08:28 0 删除 编辑
ORA-12162: TNS:net service name is incorrectly specified

情景描述:
在虚拟机上dbca之后,如下,实例是启动的。
[rose1][oracle][/home/oracle]#ps -ef|grep pmon
oracle 13637 1 0 05:10 ? 00:00:00 ora_pmon_single
oracle 13751 12898 0 05:15 pts/3 00:00:00 grep pmon

于是,直接sqllus / as sysdba.
SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
[rose1][oracle][/home/oracle]#sqlplus "/ as sysdba"
SQL*Plus: Release 11.2.0.1.0 Production on Wed Dec 28 05:15:26 2016
Copyright (c) 1982, 2009, 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
SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus;

很奇怪,即便输入了 sysdba/oracle 还是错误。
仔细想了想才发现,ORACLE_SID忘了指定,于是
export ORACLE_SID=SINGLE 之后,就没问题了。

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

请登录后发表评论 登录
全部评论
擅长ORACLE,pg,mysql等数据库,希望能持续分享数据库相关的知识,以及一些平常工作中遇到的问题

注册时间:2016-10-23

  • 博文量
    22
  • 访问量
    38668