1.故障描述
使用sysdba身份登陆会得到错误信息
SQL*Plus: Release 11.2.0.1.0 Production on Wed Aug 7 13:57:54 2013
Copyright (c) 1982, 2009, Oracle. All rights reserved.
ERROR:
ORA-12162: TNS:net service name is incorrectly specified
Enter user-name:
2.故障原因
诡异的故障背后的原因竟然是那样的基础:ORACLE_SID没有指定!
确认系统当前的ORACLE_HOME和ORACLE_SID环境变量
[oracle@oracle-michael-desktop]$ echo $ORACLE_HOME
/oracle/app/oracle/product/11.2.0/dbhome_1
[oracle@oracle-michael-desktop]$ echo $ORACLE_SID
[oracle@oracle-michael-desktop]$
可见,此时只设置了ORACLE_HOME环境变量,但ORACLE_SID此时为空,这就是该问题的真实原因。
3.故障处理
给出ORACLE_SID,重新尝试登录。
[oracle@oracle-michael-desktop]$ export ORACLE_SID=orcl
[oracle@oracle-michael-desktop]$echo $ORACLE_SID
orcl
oracle@oracle-michael-desktop:/opt/oracle$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Wed Aug 7 14:02:44 2013
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
ps: 命令sqlplus / as sysdba /前后都有空格( ⊙ o ⊙ )啊!
原帖链接:http://space.itpub.net/519536/viewspace-672034