无法使用sqlplus连接到数据库

Unable to connect to a database using sqlplus

我已经配置到我的 tnsnames.ora 我的连接字符串中。在我的sqlnet.ora我的内容如下:

NAMES.DIRECTORY_PATH= (LDAP, TNSNAMES, HOSTNAME)
NAMES.DEFAULT_DOMAIN = WORLD
TRACE_LEVEL_CLIENT = OFF
SQLNET.EXPIRE_TIME = 30

当我从 tnsnames.ora 对 SID 进行 tnsping 调用时,出现错误:

TNS-03505: Failed to resolve name

示例配置来自 tnsname.ora

TNS_NAME =
    (DESCRIPTION =
        (ADDRESS_LIST =
            (ADDRESS = (PROTOCOL = TCP)(HOST = HOST.NAME)(PORT = PORT_NUMBER))
        )
        (CONNECT_DATA =
            (SERVICE_NAME = SID)
        )
    )

我做错了什么?

为了连接到远程数据库,我使用了以下连接字符串而不使用 tnsnames.ora 进行映射:

sqlplus username/password@(DESCRIPTION =
    (ADDRESS = (PROTOCOL= TCP)(Host= hostname.network)(Port= remote_port))
    (CONNECT_DATA = (SID = remote_SID))
  )