在linux下面,习惯用 sqlplus "/as sysdba" 登录。
今天在其他机器上,遇到错误如下:
[oracle@db ~]$ sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.3.0 Production on Mon Jun 24 01:59:24 2013
Copyright (c) 1982, 2011, Oracle. All rights reserved.
ERROR:
ORA-01031: insufficient privileges
Enter user-name: ^C
[oracle@db ~]$
网上找了一下,不少介绍,但是有效的不多。
主要是$ORACLE_HOME/network/admin/sqlnet.ora,要么删掉这个文件,要么把其中的参数 “SQLNET.AUTHENTICATION_SERVICES” 改成 ALL。
单纯的注释掉这个参数,不起作用。
现在用的如下:
[oracle@db admin]$ cat sqlnet.ora
# Generated by Oracle configuration tools.
SQLNET.AUTHENTICATION_SERVICES= (ALL)
REMOTE_LOGIN_PASSWORDFILE=exclusive
SQLNET.INBOUND_CONNECT_TIMEOUT=0
NAMES.DIRECTORY_PATH= (TNSNAMES)
[oracle@db admin]$
参考了下面的URL:
http://hunt1574.blog.iyunv.com/1390776/857841
理解SQLNET.AUTHENTICATION_SERVICES参数
理解SQLNET.AUTHENTICATION_SERVICES参数
1、官方说明:SQLNET.AUTHENTICATION_SERVICESPurposeUse the parameter SQLNET.AUTHENTICATION_SERVICES to enable one or more authentication services. If authentication has been installed, it is recommended that this parameter be set to either none or to one of the authentication methods.DefaultNoneValuesAuthentication Methods Available with Oracle Net Services:· none for no authentication methods. A valid username and password can be used to access the database.· all for all authentication methods· nts for WindowsNT native authentication 2、测试: 可以通过对SQLNET.AUTHENTICATION_SERVICES值进行修改查看其影响。l WINDOWNS:A. 无sqlnet.ora文件:E:\oracle\product\10.2.0\db_1\NETWORK\ADMIN>dir sqlnet.ora驱动器E中的卷没有标签。卷的序列号是1CF8-89BBE:\oracle\product\10.2.0\db_1\NETWORK\ADMIN的目录找不到文件E:\oracle\product\10.2.0\db_1\NETWORK\ADMIN> E:\oracle\product\10.2.0\db_1\NETWORK\ADMIN>sqlplus"/ as sysdba"SQL*Plus: Release 10.2.0.1.0 - Production on星期二5月820:45:35 2012Copyright (c) 1982, 2005, Oracle. All rights reserved.ERROR:ORA-01031:权限不足请输入用户名:B. SQLNET.AUTHENTICATION_SERVICES=(NONE)E:\oracle\product\10.2.0\db_1\NETWORK\ADMIN>dir sqlnet.ora驱动器E中的卷没有标签。卷的序列号是1CF8-89BBE:\oracle\product\10.2.0\db_1\NETWORK\ADMIN的目录2012-05-08 20:48 266 sqlnet.ora1 个文件266 字节0 个目录1,969,827,840可用字节 E:\oracle\product\10.2.0\db_1\NETWORK\ADMIN>type 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 = (NONE)E:\oracle\product\10.2.0\db_1\NETWORK\ADMIN>sqlplus "/ as sysdba"SQL*Plus: Release 10.2.0.1.0 - Production on星期二5月820:48:53 2012Copyright (c) 1982, 2005, Oracle. All rights reserved.ERROR:ORA-01031:权限不足请输入用户名: C. SQLNET.AUTHENTICATION_SERVICES=(ALL)E:\oracle\product\10.2.0\db_1\NETWORK\ADMIN>type 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 = (ALL) E:\oracle\product\10.2.0\db_1\NETWORK\ADMIN>sqlplus "/ as sysdba"SQL*Plus: Release 10.2.0.1.0 - Production on星期二5月820:51:28 2012Copyright (c) 1982, 2005, Oracle. All rights reserved.ERROR:ORA-12641:验证服务无法初始化请输入用户名: D. SQLNET.AUTHENTICATION_SERVICES=(NTS)E:\oracle\product\10.2.0\db_1\NETWORK\ADMIN>type 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) E:\oracle\product\10.2.0\db_1\NETWORK\ADMIN>sqlplus "/ as sysdba"SQL*Plus: Release 10.2.0.1.0 - Production on星期二5月820:53:49 2012Copyright (c) 1982, 2005, Oracle. All rights reserved.连接到:Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - ProductionWith the Partitioning, OLAP and Data Mining optionsSQL> l LINUXA. 无sqlnet.ora文件:bash-3.00$ ls -l sqlnet.orasqlnet.ora:无此文件或目录 bash-3.00$ sqlplus "/ as sysdba"SQL*Plus: Release 10.2.0.1.0 - Production on Tue May 8 21:11:04 2012Copyright (c) 1982, 2005, Oracle. All rights reserved.Connected to:Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit ProductionWith the Partitioning, OLAP and Data Mining optionsSQL> B. SQLNET.AUTHENTICATION_SERVICES=(NONE)bash-3.00$cat sqlnet.oraSQLNET.AUTHENTICATION_SERVICES = (NONE) bash-3.00$ sqlplus "/ as sysdba"SQL*Plus: Release 10.2.0.1.0 - Production on Tue May 8 21:13:00 2012Copyright (c) 1982, 2005, Oracle. All rights reserved.ERROR:ORA-01031: insufficient privilegesEnter user-name: C. SQLNET.AUTHENTICATION_SERVICES=(ALL)bash-3.00$cat sqlnet.oraSQLNET.AUTHENTICATION_SERVICES = (ALL) bash-3.00$ sqlplus "/ as sysdba"SQL*Plus: Release 10.2.0.1.0 - Production on Tue May 8 21:13:59 2012Copyright (c) 1982, 2005, Oracle. All rights reserved.Connected to:Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit ProductionWith the Partitioning, OLAP and Data Mining optionsSQL> D. SQLNET.AUTHENTICATION_SERVICES=(NTS)bash-3.00$ cat sqlnet.oraSQLNET.AUTHENTICATION_SERVICES = (NTS) bash-3.00$ sqlplus "/ as sysdba"SQL*Plus: Release 10.2.0.1.0 - Production on Tue May 8 21:15:05 2012Copyright (c) 1982, 2005, Oracle. All rights reserved.ERROR:ORA-01031: insufficient privilegesEnter user-name: 3、总结:1) 在windows下,SQLNET.AUTHENTICATION_SERVICES必须设置为NTS才可用,此值仅适用于WINDOWS。2) 在LINUX下,SQLNET.AUTHENTICATION_SERVICES为ALL或不设置(sqlnet.ora文件不存在时)均可登录。 本文出自 “HUNT” 博客,请务必保留此出处http://hunt1574.blog.iyunv.com/1390776/857841
版权声明:本文为博主原创文章,未经博主允许不得转载。