0

ORA-12154 cannot connect to the database from sqlplus

tnsnames.ora

89# tnsnames.ora Network Configuration File: M:\app\oracleuser\product\12.1.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.

DOCASSIST =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = DOCASSIST)
    )
  )

listener.ora

# listener.ora Network Configuration File: M:\app\oracleuser\product\12.1.0\dbhome_1\network\admin\listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = CLRExtProc)
      (ORACLE_HOME = M:\app\oracleuser\product\12.1.0\dbhome_1)
      (PROGRAM = extproc)
      (ENVS = "EXTPROC_DLLS=ONLY:M:\app\oracleuser\product\12.1.0\dbhome_1\bin\oraclr12.dll")
    )
  )


DOCASSISTLISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    )
  )

sqlnet.ora

# This file is actually generated by netca. But if customers choose to 
# install "Software Only", this file wont exist and without the native 
# authentication, they will not be able to connect to the database on NT.

SQLNET.AUTHENTICATION_SERVICES = (NTS)

I am able to connect to the databse using tnsping

C:\Users\Manish>tnsping docassist

TNS Ping Utility for 64-bit Windows: Version 12.1.0.1.0 - Production on 01-FEB-2
014 22:09:31

Copyright (c) 1997, 2013, Oracle.  All rights reserved.

Used parameter files:
M:\app\oracleuser\product\12.1.0\dbhome_1\NETWORK\ADMIN\sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)
(HOST = localhost)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = DOCASSIST)))
OK (0 msec)

I tried creating a TNS_ADMIN environment variable as mention in this link here - TNSPING OK but sqlplus gives ORA-12154? but I am still getting the same error when I try to connect to using sqlplus

SQL*Plus: Release 12.1.0.1.0 Production on Sat Feb 1 22:08:57 2014

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Enter user-name: SYSTEM@DOCTORASSIST
Enter password:
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified
Community
  • 1
  • 1
user2180794
  • 1,425
  • 7
  • 27
  • 50
  • You should try with `docassist` not `DOCTORASSIST` isn't it? Connect using `SYSTEM@docassist as sysadmin` – Jacob Feb 02 '14 at 06:26
  • Enter user-name: SYSTEM@docassist Enter password: ERROR: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor – user2180794 Feb 02 '14 at 06:37
  • You did `tnsping` as `docassist` and why you are trying to connect as `SYSTEM@DOCTORASSIST`? And make sure your listener is up and running – Jacob Feb 02 '14 at 06:40
  • See this, might be helpful. http://stackoverflow.com/questions/10786782/ora-12514-tnslistener-does-not-currently-know-of-service-requested-in-connect-d – Jacob Feb 02 '14 at 06:41
  • i'm pretty new to this. I cannot access the Db from sqlplus .. or the sqldeveloper .. not sure how i can run this query. select value from v$parameter where name='service_names' – user2180794 Feb 02 '14 at 06:49
  • See the link I have posted, that will be helpful. – Jacob Feb 02 '14 at 06:50
  • Please answer this, I would like to know how did you try to connect to your database? Have you tried as `SYSTEM@DOCASSIST as sysadmin`? – Jacob Feb 02 '14 at 07:02
  • yes but i am getting invalid option error. so I tried as sysdba, then i was getting ORA-12514 – user2180794 Feb 02 '14 at 07:21
  • Then do as `SYSTEM@DOCASSIST`, no need to `as sysdba` – Jacob Feb 02 '14 at 07:27
  • that gives me ORA-12514 again. – user2180794 Feb 02 '14 at 08:26

1 Answers1

0

Try this.

SQLNET.AUTHENTICATION_SERVICES=(NONE)

lalilulelo_1986
  • 526
  • 3
  • 7
  • 18
  • try it where ? I cannot connect to the DB neither from sqlplus nor sql developer – user2180794 Feb 02 '14 at 21:03
  • Although this question is very old: The file SQLNET.ORA can be found in the TNS_ADMIN path (search registry for it). If this is not set default path is %ORACLE_HOME%\network\admin. – LSA Jun 19 '20 at 07:34