windows平台 sqlplus / as sysdba登录出现ora-01017错误

这篇博客介绍了在Windows平台上,使用sqlplus以sysdba角色登录Oracle 11.2.0.4数据库时遇到ora-01017错误的解决过程。问题根源在于SQLNET.AUTHENTICATION_SERVICES参数设置为(NONE),禁用了操作系统认证。通过修改sqlnet.ora文件,将参数改为(NTS)以启用Windows认证,最终成功解决了登录问题。
摘要由CSDN通过智能技术生成

问题描述:
windows平台,数据库版本为Oracle 11.2.0.4,以sqlplus / as sysdba登录出现ora-01017

C:\Users\Administrator>sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on 星期四 1月 21 11:06:43 2021

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

ERROR:
ORA-01017: invalid username/password; logon denied


请输入用户名:
ERROR:
ORA-01017: 用户名/口令无效; 登录被拒绝


请输入用户名:
ERROR:
ORA-01017: 用户名/口令无效; 登录被拒绝

用另一种方式登录,也出现相同的报错

C:\Users\Administrator>sqlplus /nolog

SQL*Plus: Release 11.2.0.4.0 Production on 星期四 1月 21 11:06:49 2021

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

SQL> conn / as sysdba
ERROR:
ORA-01017: invalid username/password; logon denied


SQL> exit

当前操作系统用户是administrator,已经是管理员权限了,不存在权限不够的问题,那应该就是操作系统认证的环节出现了问题,查看sqlnet.ora文件:

 E:\oracle\product\11.2.0\dbhome_1\NETWORK\ADMIN\sqlnet.ora

# sqlnet.ora Network Configuration File: E:\oracle\product\11.2.0\dbhome_1\NETWORK\ADMIN\sqlnet.ora
# Generated by Oracle configuration tools.

SQLNET.AUTHENTICATION_SERVICES = (NONE)

# 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.

ADR_BASE = E:\oracle

果然,SQLNET.AUTHENTICATION_SERVICES = (NONE)关闭了操作系统认证。
SQLNET.AUTHENTICATION_SERVICES有3个参数:
SQLNET.AUTHENTICATION_SERVICES = (NONE) 关闭操作系统认证
SQLNET.AUTHENTICATION_SERVICES = (ALL) 开启LINUX和AIX操作系统认证
SQLNET.AUTHENTICATION_SERVICES = (NTS) 开启windows操作系统认证

修改SQLNET.AUTHENTICATION_SERVICES参数

# sqlnet.ora Network Configuration File: E:\oracle\product\11.2.0\dbhome_1\NETWORK\ADMIN\sqlnet.ora
# Generated by Oracle configuration tools.

#SQLNET.AUTHENTICATION_SERVICES = (NONE) 
#SQLNET.AUTHENTICATION_SERVICES = (ALL)
SQLNET.AUTHENTICATION_SERVICES = (NTS) 


# 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.

ADR_BASE = E:\oracle

连接数据库正常:

C:\Users\Administrator>sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on 星期四 1月 21 12:02:09 2021

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


连接到:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> set linesize 200
SQL> select name,open_mode,database_role from v$database;

NAME               OPEN_MODE                                DATABASE_ROLE
------------------ ---------------------------------------- --------------------------------
ORCL             READ WRITE                               PRIMARY

SQL>
  • 6
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值