远程连接oracle数据库的时候,出现如下错误:
C:\Users\Administrator>sqlplus system/orcl@MISS SQL*Plus: Release 11.2.0.1.0 Production on 星期一 5月 20 15:22:24 2013 Copyright (c) 1982, 2010, Oracle. All rights reserved. ERROR: ORA-12154: TNS: 无法解析指定的连接标识符 请输入用户名:
1、检查客户端的tnsnames.ora文件,看里面的HOST,PORT,SERVICE_NAME是否正确,如果不正确会产生此错误
2、检查客户端的tnsnames.ora文件,看是否多出空格,例如连接的名称,如果多出空格的话,可能也会导致连接错误
正确的例子如下:
MISS = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.128)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = shared) ) )
MISS = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.128)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = shared) ) )