oracle用户认证方式,Oracle用户密码认证方式

none:不使用密码文件认证。如果选择了这个值,就相当于屏蔽了密码文件的内容了。

exclusive:要密码文件认证,自己独占使用(默认值)

shared:要密码文件认证,不同实例dba用户可以共享密码文件

2.位于$ORACLE_HOME/network/admin/sqlnet.ora

SQLNET.AUTHENTICATION_SERVICES=none|all|nts

none:关闭操作系统认证,只能密码认证

all:用于linux/unix平台,关闭本机密码文件认证,采用操作系统认证

nts:用于windows平台

测试远程登录的时候密码文件丢失情况

$ rm -rf $ORACLE_HOME/dbs/orapw$ORACLE_SID

$ sqlplus sys/mypna123@userdata as sysdba

SQL*Plus: Release 10.2.0.4. - Production on Tue Sep ::

Copyright (c) , , Oracle. All Rights Reserved.

ERROR:

ORA-: insufficient privileges

Enter user-name:

$ orapwd file=orapw$ORACLE_SID password=mypna123 entries=

$ sqlplus sys/mypna123@userdata as sysdba

SQL*Plus: Release 10.2.0.4. - Production on Tue Sep ::

Copyright (c) , , Oracle. All Rights Reserved.

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.4. - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

SYS@userdata>

可以看到默认配置下,丢失密码文件后,不可以远程登录数据库,只可以本地系统认证后登录数据库

测试remote_login_passwordfile为exclusive,AUTHENTICATION_SERVICES为none的情况

SYS@userdata>show parameter remote_login_passwordfile;

NAME TYPE VALUE

------------------------------------ --------------------------------- ------------------------------

remote_login_passwordfile string EXCLUSIVE

$ echo "SQLNET.AUTHENTICATION_SERVICES=NONE" >> $ORACLE_HOME/network/admin/sqlnet.ora

$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.4. - Production on Tue Sep ::

Copyright (c) , , Oracle. All Rights Reserved.

ERROR:

ORA-: insufficient privileges

Enter user-name:

$ sqlplus sys/mypna123@userdata as sysdba

SQL*Plus: Release 10.2.0.4. - Production on Tue Sep ::

Copyright (c) , , Oracle. All Rights Reserved.

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.4. - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

SYS@userdata>

可以看到在remote_login_passwordfile为exclusive,AUTHENTICATION_SERVICES为none的情况下,数据库只能使用密码文件认证方式

测试remote_login_passwordfile为exclusive,AUTHENTICATION_SERVICES为all的情况

SYS@userdata>show parameter remote_login_passwordfile;

NAME TYPE VALUE

------------------------------------ --------------------------------- ------------------------------

remote_login_passwordfile string EXCLUSIVE

$ cat $ORACLE_HOME/network/admin/sqlnet.ora

SQLNET.AUTHENTICATION_SERVICES=ALL

$ sqlplus sys/mypna123@userdata as sysdba

SQL*Plus: Release 10.2.0.4. - Production on Tue Sep ::

Copyright (c) , , Oracle. All Rights Reserved.

ERROR:

ORA-: Authentication service failed to initialize

Enter user-name:

$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.4. - Production on Tue Sep ::

Copyright (c) , , Oracle. All Rights Reserved.

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.4. - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

SYS@userdata>

可以看到在remote_login_passwordfile为exclusive,AUTHENTICATION_SERVICES为all的情况下本机登录只支持系统认证,不支持密码文件认证.普通用户和sys用户均不可以本地登录.但是远程登录是不受限制的.

看有哪些用户是拥有sysdba权限

SYS@userdata>grant sysdba to scott;

Grant succeeded.

SYS@userdata>select * from v$pwfile_users;

USERNAME SYSDBA SYSOPER

---------------------------------------- --------------- ---------------

SYS TRUE TRUE

SCOTT TRUE FALSE

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值