ORA-12560: TNS: 协议适配器错误
Windows 下访问 sys账号报 “ORA-12560: TNS: 协议适配器错误”
C:\Users\Administrator>sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on 星期一 9月 23 15:00:16 2019
Copyright (c) 1982, 2010, Oracle. All rights reserved.
ERROR:
ORA-12560: TNS: 协议适配器错误
请输入用户名:
上面即装的有数据库又装的有client:

检查了sqlnet.ora没有发现异常:
# sqlnet.ora Network Configuration File: D:\app\Administrator\product\11.2.0\dbhome_1\network\admin\sqlnet.ora
# Generated by Oracle configuration tools.
# 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)
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
再次检查dba组的信息:
C:\Users\Administrator>net localgroup
\\WIN-T0J87C7J9Q0 的别名
-------------------------------------------------------------------------------
*Administrators
*Backup Operators
*Certificate Service DCOM Access
*Cryptographic Operators
*Distributed COM Users
*Event Log Readers
*Guests
*IIS_IUSRS
*Network Configuration Operators
*ora_dba
*Performance Log Users
*Performance Monitor Users
*Power Users
*Print Operators
*Remote Desktop Users
*Replicator
*Users
命令成功完成。
C:\Users\Administrator>net localgroup ora_dba
别名 ora_dba
注释 Oracle DBA Group
成员
-------------------------------------------------------------------------------
Administrator
NT AUTHORITY\SYSTEM
命令成功完成。
C:\Users\Administrator>whoami
win-t0j87c7j9q0\administrator
C:\Users\Administrator>net localgroup ora_dba administrators /add
命令成功完成。
C:\Users\Administrator>net localgroup ora_dba
别名 ora_dba
注释 Oracle DBA Group
成员
-------------------------------------------------------------------------------
Administrator
Administrators
NT AUTHORITY\SYSTEM
命令成功完成。
没有发现ora_dba组有异常。最后怀疑是装了oracle client导致找错tns目录导致的。参考:(ORA-12560: TNS: 协议适配器错误(环境变量的设置问题\))[https://blog.csdn.net/kone0611/article/details/78762641]
更改PATH变更顺序后解决:
C:\Users\Administrator>set path
Path=D:\app\Administrator\product\11.2.0\client_1\bin;D:\app\Administrator\produ
ct\11.2.0\dbhome_1\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C
:\Windows\System32\WindowsPowerShell\v1.0\
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
C:\Users\Administrator>set PATH=D:\app\Administrator\product\11.2.0\dbhome_1\bin
;D:\app\Administrator\product\11.2.0\client_1\bin;C:\Windows\system32;C:\Windows
;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\
C:\Users\Administrator>sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on 星期一 9月 23 15:14:02 2019
Copyright (c) 1982, 2010, Oracle. All rights reserved.
连接到:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
posted on 2019-09-23 15:42 Digital_life 阅读(599) 评论(0) 收藏 举报
浙公网安备 33010602011771号