oracle case sensitive,SEC_CASE_SENSITIVE_LOGON--密码大小写参数--动态

今天在做了一个change,就是修改一个Oracle 数据库上的这个参数,

SQL> show parameter sec_case_sensitive_logon;

NAME                                 TYPE        VALUE

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

sec_case_sensitive_logon             boolean     TRUE

SQL> alter system set sec_case_sensitive_logon=FALSE; //默认scope=both,故重启DB之后仍然有效

System altered.

SQL> show parameter sec_case_sensitive_logon;

NAME                                 TYPE        VALUE

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

sec_case_sensitive_logon             boolean     FALSE参考文献: http://blog.itpub.net/519536/viewspace-621998

在Oracle的11g之前的版本中密码是不区分大小写的(使用双引号强制除外)。在Oracle的11g版本中对此有所增强。从此密码有了大小写的区分,这个大小写敏感特性是通过SEC_CASE_SENSITIVE_LOGON参数来控制的。简单探索一下。

1.创建Secooler用户,注意它的密码同时包含大写字母和小写字母。

sys@ora11gR2> create user Secooler identified by Secooler;

User created.

sys@ora11gR2> grant connect to secooler;

Grant succeeded.

从这个授权成功上可见,用户名仍然不区分大小写。

2.尝试使用全小写的密码登陆

sys@ora11gR2> conn secooler/secooler

ERROR:

ORA-01017: invalid username/password; logon denied

Warning: You are no longer connected to ORACLE.

报错,显然不行,此时大小写敏感性检查已经启用。

3.使用“正确”的密码“Secooler”进行登陆,成功。

sys@ora11gR2> conn secooler/Secooler

Connected.

secooler@ora11gR2> show user;

USER is "SECOOLER"

4.看一下“幕后黑手”SEC_CASE_SENSITIVE_LOGON参数的描述

sys@secooler> show parameter sec_case_sensitive_logon

NAME                       TYPE       VALUE

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

sec_case_sensitive_logon   boolean    TRUE

sys@ora11gR2> select a.ksppinm name,b.ksppstvl value,a.ksppdesc description

2    from x$ksppi a,x$ksppcv b

3   where a.indx = b.indx

4     and a.ksppinm = 'sec_case_sensitive_logon'

5  /

NAME                      VALUE  DESCRIPTION

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

sec_case_sensitive_logon  TRUE   case sensitive password enabled for logon

该参数默认值是“TRUE”,因此,默认情况下密码大小写是敏感的。

5.将SEC_CASE_SENSITIVE_LOGON参数修改为“FALSE”

sys@ora11gR2> alter system set sec_case_sensitive_logon = FALSE;

System altered.

6.此时系统将不对密码做大小写敏感验证

sys@ora11gR2> conn secooler/secooler

Connected.

7.即使修改SEC_CASE_SENSITIVE_LOGON参数为“FALSE”,在系统中记录的也是区分大小写的形式,只是不进行验证而已。

1)创建另外一个用户sec,并授权

sys@ora11gR2> create user sec identified by SeC;

User created.

sys@ora11gR2> grant connect to sec;

Grant succeeded.

2)在SEC_CASE_SENSITIVE_LOGON参数为“FALSE”时尝试连接,成功,因为此时不进行校验。

sys@ora11gR2> conn sec/sec

Connected.

3)恢复SEC_CASE_SENSITIVE_LOGON参数为“TRUE”,再次尝试连接将会失败。

sec@ora11gR2> conn / as sysdba

Connected.

sys@ora11gR2> alter system set sec_case_sensitive_logon = TRUE;

System altered.

sys@ora11gR2> conn sec/sec

ERROR:

ORA-01017: invalid username/password; logon denied

Warning: You are no longer connected to ORACLE.

4)使用“正确”的密码进行尝试,成功。

sys@ora11gR2> conn sec/SeC

Connected.

5)结论

11g环境中密码是以区分大小写的形式进行存储的。

8.Oracle 11g文档参考(11gR1和11gR2内容相同)

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值