Oracle sysdba与sysoper的认证方式



1.ORACLE有两种方式可以认证sysdba/sysoper用户:

1).操作系统级认证:即登录到oracle数据库主机,使用如下用户登录后,可以直接使用sqlplus / as sysdba登录:在linux/unix下隶属于dba权限组(linux/unix)的用户,在windows下隶属于ORA_DBA组的用户;

   2).远程认证:口令文件认证,即在任何主机都可以使用sqlplus sys/xxx@sid登录。

 

2.两种方式有各自的开关:

1).操作系统级认证的开关:sqlnet.oraAUTHENTICATION_SERVICES,当SQLNET.AUTHENTICATION_SERVICES=NTSNTS代表NTSecurity时,即采用OS认证;如果为NONE则关闭操作系统级认证,必须采用usr/pwd as sysdba/sysoper 登陆。

2).口令文件认证的开关:spfile/pfileremote_login_passwordfile参数:

remote_login_passwordfile = EXCLUSIVE,则一个实例专用;

remote_login_passwordfile = SHARE则可以多个实例共享(用于OPS/RAC环境);

remote_login_passwordfile = NONE则不启用口令文件,此时任何sysdba/sysoper都无法连接进来。

remote_login_passwordfile = shared:More than one database canuse a password file. However, the only user recognized by the password file isSYS.

 

OS级认证是优先于口令文件认证的。这两个认证方式可以同时打开、同时关闭或者只开一个,图示如下:

3.口令文件:

1).口令文件的生成与重建

orapwd file=filename password=password entries=max_users

filename: Name of the password file(mandatory)

password: The password forSYSOPERand SYSDBA (mandatory)

entries: The maximum number ofdistinct users allowed to connect as SYSDBAor

SYSOPER. If you exceed this number,you must create a new password file. It is safer to have a larger number. Thereare no spaces around the equal-to (=) character.

 

windows下密码文件默认的位置是ora92/database目录,默认的文件名是pwdSID.oralinuxoracle默认的位置是$ORACLE_HOME/dbs目录,默认的文件名是orapwSID,对于别的文件名是不认的。

 

2).密码文件用户的维护与查询

执行grant sysdba/sysoper to 用户 ,oracle会自动在口令文件中增加一个条目,并且把密码copy过来。

select * fromv$pwfile_users可以查看口令文件

例如:

SQL> grant sysdbato scott;

Grant succeeded

 

SQL> select * fromv$pwfile_users;

USERNAME                      SYSDBA SYSOPER SYSASM

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

SYS                           TRUE  TRUE   FALSE

SCOTT                         TRUE  FALSE  FALSE

 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值