Unable to connect to a database using sqlplus

336 views Asked by At

I have configurated into my tnsnames.ora my connection string. In my sqlnet.ora my content is as follows:

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

When I make a tnsping call to a SID from tnsnames.ora I'm gettin the error:

TNS-03505: Failed to resolve name

Sample configuration from tnsname.ora

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

What am I doing wrong?

1

There are 1 answers

0
SocketM On BEST ANSWER

I have used the following connect string without using tnsnames.ora for mappings in order to connect to remote database:

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