Home > Net >  How should I set up my sqlnet.ora and tnsnames.ora files?
How should I set up my sqlnet.ora and tnsnames.ora files?

Time:12-01

I facing login issue with sqlplus login. when I m logging in using hostname, port and service name, its working fine.

sqlplus <userid>/<password>@<hostname>:<port>/<servicename>

No issues with above command. Its working as expected.

When I m trying to login with connect string,

sqplus <userid>/<password>@<connectstring>

I m getting

ORA-12154: TNS:could not resolve the connect identifier specified

I know my sqlnet.ora and tnsnames.ora are not correct, but not able to figure out where the issue is.

sqlnet.ora

SQLNET.AUTHENTICATION_SERVICES = (NTS)
NAMES.DEFAULT_DOMAIN = world

Just above two line are there in the file.

tnsnames.ora

MYTNSENTRY=
  (DESCRIPTION =
....

hostname, port and service name defined in tnsnames.ora, just one entry is there. I m executing sqlplus commands on windows platform.

Any pointers regarding this is much appreciated.

CodePudding user response:

You have in your sqlnet.ora this line:

NAMES.DEFAULT_DOMAIN = world

That means '.world' is going to be appended to your connect string before looking it up in tnsnames. Either remove that line from sqlnet.ora, or append '.world' to the entry name in tnsnames.ora

mytnsentry.world =
   (description...)

CodePudding user response:

Agree with what @EdStevens said, and also remove the SQLNET.AUTHENTICATION_SERVICES line from sqlnet.ora. That setting is intended to help authenticate users with Windows native security (like OS authentication), but if you're not using that then it can often create problems.

  • Related