Error -
ORA-12154: TNS:could not resolve the connect identifier specified1、执行sqlplus sys/oracle@orcl
2、结果:
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified
3、listener.ora
LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1)) (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.178)
(PORT = 1521)) ) )
4、sqlnet.ora
SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH=(TNSNAMES,HOSTNAME)
5、tnsnames.ora
orcl =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.178)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
------解决方案--------------------执行下:tnsping orcl,看看什么结果
------解决方案--------------------检查输入的服务名与配置的服务名是否一致
另外注意生成的本地服务名文件(Windows下如D:oracleora92networkadmin tnsnames.ora,Linux/Unix下/network/admin/tnsnames.ora)里每项服务的首 行服务名称前不能有空格。