时间:2021-07-01 10:21:17 帮助过:9人阅读
可以看到监听器没有问题。
2、通过tnsping查看是否能够连通。
在服务器上做
1 $ tnsping orcl 2 3 TNS Ping Utility for Linux: Version 11.2.0.1.0 - Production on 13-9月 -2017 18:09:28 4 5 Copyright (c) 1997, 2009, Oracle. All rights reserved. 6 7 已使用的参数文件: 8 /oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/sqlnet.ora 9 10 TNS-03505: 无法解析名称View Code
这是因为服务器上没有tnsname.ora这个配置文件,无法解析名称。
在客户端上做
1 tnsping oaproddb 2 3 TNS Ping Utility for 32-bit Windows: Version 11.2.0.4.0 - Production on 13-9月 -2017 18:11:05 4 5 Copyright (c) 1997, 2013, Oracle. All rights reserved. 6 7 已使用的参数文件: 8 D:\app\JIAKAI\product\11.2.0\client_1\network\admin\sqlnet.ora 9 10 11 已使用 TNSNAMES 适配器来解析别名 12 尝试连接 (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = **.**.**.**)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl))) 13 OK (20 毫秒) 14 15 C:\Users\JIAKAI>View Code
没有问题。
3、查看数据库参数文件
登录到服务器,然后以sys用户登录到数据库
1 $ sqlplus / as sysdba 2 3 SQL*Plus: Release 11.2.0.1.0 Production on 星期三 9月 13 18:16:12 2017 4 5 Copyright (c) 1982, 2009, Oracle. All rights reserved. 6 7 8 连接到: 9 Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production 10 With the Partitioning, OLAP, Data Mining and Real Application Testing options 11 12 SQL> show user 13 USER 为 "SYS" 14 SQL>View Code
4、查看spfile是否存在
1 SQL> show parameter spfile 2 3 NAME TYPE VALUE 4 ------------------------------------ ----------- ------------------------------ 5 spfile string /oracle/app/oracle/product/11.2.0/dbhome_1/dbs/spfileorcl.oraView Code
没有问题。
5、然后查看remote_login_pass参数
1 SQL> show parameter remote_login_pass 2 3 NAME TYPE VALUE 4 ------------------------------------ ----------- ------------------------------ 5 remote_login_passwordfile string EXCLUSIVEView Code
也没有问题。
一直也没有怀疑过sys密码不正确,因为通过以下语句可以登录
1 $ sqlplus sys/1234 as sysdba 2 3 SQL*Plus: Release 11.2.0.1.0 Production on 星期三 9月 13 17:44:46 2017 4 5 Copyright (c) 1982, 2009, Oracle. All rights reserved. 6 7 8 连接到: 9 Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production 10 With the Partitioning, OLAP, Data Mining and Real Application Testing optionsView Code
但还是试着抱一抱的态度,我更改了sys密码。然后居然登录成功了。(心里一万只草泥马奔过)
那么问题来了,为什么sqlplus sys/1234 as sysdba能够登录呢?我之后又试了其他的sqlplus ***/*** as sysdba都可以登录。(WTF)
这是因为,sqlplus ***/*** as sysdba是本地登录,也就是操作系统登录验证,oracle会忽略“/”两遍的用户名和密码。所以以这种方式登录上去就是sys用户。
所以这次的问题就是sys密码没有写对,所以pl/sql登录不上去。
参考:
http://blog.csdn.net/zdwzzu2006/article/details/6096322
http://www.cnblogs.com/kerrycode/archive/2013/03/27/2984152.html
http://blog.csdn.net/ma1kong/article/details/38636965
为什么以sys无法远程登录数据库
标签:.net 跟踪 ice col 命令 listener 遇到 arch none