ORA-12154: TNS: 无法解析指定的连接标识符(原创)

tnsnames.ora配置

# tnsnames.ora Network Configuration File: D:\oracle\product\11.2.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.

ORACLR_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
    (CONNECT_DATA =
      (SID = CLRExtProc)
      (PRESENTATION = RO)
    )
  )

LISTENER_ORCL =
  (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))



ORCL =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = ORCL)
    )
  )
  
    42DB =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 101.231.249.226)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SID = orcl)
    )
  )

  结果

tnsping 42DB 连接不上,经发现是42DB 前有空格,去除后即可

  


你可能感兴趣的:(ORA-12154: TNS: 无法解析指定的连接标识符(原创))