ORA-12154无法从sqlplus连接到数据库

时间:2014-02-02 06:15:07

标签: sql oracle11g sqlplus

ORA-12154无法从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)

我可以使用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)

我尝试在此链接中提及创建TNS_ADMIN环境变量 - TNSPING OK but sqlplus gives ORA-12154? 但是当我尝试连接到使用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

1 个答案:

答案 0 :(得分:0)

试试这个。

SQLNET.AUTHENTICATION_SERVICES =(NONE)