首页 > 代码库 > ORA-12162: TNS:net service name is incorrectly specified
ORA-12162: TNS:net service name is incorrectly specified
[oracle@up ~]$ sql / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Sat Feb 11 15:29:31 2017
Copyright (c) 1982, 2009, Oracle. All rights reserved.
ERROR:
ORA-12162: TNS:net service name is incorrectly specified
报错显示指定的网络名称不正确
查看.bash_profile文件
export PATH
export ORACLE_BASE=/u01/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0
export ORACLR_SID=ora11g
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
发现ORACLE_SID变量,名称书写错误,更正变量名称,重新登录
[oracle@up ~]$ sql / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Sat Feb 11 15:37:02 2017
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>
登录成功
ORA-12162: TNS:net service name is incorrectly specified