报错场景
在cmd中输入
-- 尝试在cmd中登录oracle的用户,但是报错
sqlplus scott/tiger
ERROR:
ORA-12560: TNS: 协议适配器错误
解决方法
-- 发现是没有正确登录sqlplus,连接数据库的时候需要指定数据库的实例名
-- 我们看一下服务中的oralceserverxxx中的xxx是什么,比如是orcl,那么cmd连接oracle数据库命令可以下面这样写
sqlplus scott/tiger@orcl 回车
==>
C:\Users\Administrator>sqlplus scott/tiger@orcl
SQL*Plus: Release 11.2.0.1.0 Production on 星期一 4月 12 20:47:57 2021
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>