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/
,如需转载,请注明出处,否则将追究法律责任。