设置oracle用户密码有效期/宽限期 [英] Set oracle user password expiry/grace period

查看:195
本文介绍了设置oracle用户密码有效期/宽限期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序,将其数据存储在Oracle 11g Express Edition数据库中.当Oracle用户密码开始过期(进入宽限期)时,该应用程序将引发异常(ORA-28002),并且仅停止工作.我需要找到一种在此期间保持应用程序运行并通知管理员的方法,以便可以在密码到期之前对其进行更改.

I have an application storing it's data in an Oracle 11g Express Edition database. When the Oracle user password is starting to expire (entering grace period), the application is throwing an exception (ORA-28002) and just stops working. I need to find a way to keep the application running during that period and inform an administrator, so the password can be changed before it expires.

但是,真正的问题是,我需要在那个宽限期内设置数据库用户,以便可以对应用程序进行编程和测试,并查看我的代码是否有效.我试图更改dba_users中的到期日期,但是我没有执行此操作所需的特权.我什至不知道这是正确的方法.

However my real problem is, I need to set my database user in that grace period so I can program and test my application and see if my code works. I tried to change the expiry date in dba_users, but I do not have the required privileges to do so. I'm not even sure this is the correct approach.

我该怎么做才能使数据库服务器认为我的用户帐户即将过期,以便我可以编写代码来处理该事件?

What could I do to make the database server think my user account will expire soon so I can write code to handle that event?

推荐答案

您将需要特权才能在数据库级别执行此操作.普通用户甚至无法明确锁定或终止自己的帐户. (如果您设置了个人资料,则可以使用错误的密码有意地锁定它)

You'll need privileges to do so at the database level. A normal user cannot even explicitly lock or expire his own account. (You can lock it by purposely using the wrong password if your profile is setup so)

我知道使用户过期(没有数据库级别的命令)的另一种方法是通过设置正向时钟来欺骗数据库.

The only other way I know to expire your user (without a database level command) is to fool the database by setting the clock forward.

如果没有DBA特权,则不太可能拥有特权来更改系统时钟.

If you don't have DBA privs, it is unlikely that you have privs to change the system clock.

我试图更改dba_users中的到期日期,但是我没有 这样做所需的特权.我什至不确定这是正确的 方法.

I tried to change the expiry date in dba_users, but I do not have the required privileges to do so. I'm not even sure this is the correct approach.

否,请勿更改DBA_USERS.您需要使用"ALTER PROFILE"命令更改DEFAULT配置文件的PASSWORD_GRACE_TIME.所有相关的更改都需要ALTER PROFILE系统特权.因此,没有DBA特权,您将无法做到.

No, don't make changes to DBA_USERS. You would need to alter the PASSWORD_GRACE_TIME for the DEFAULT profile using "ALTER PROFILE" command. All associated changes require ALTER PROFILE system priv to do so. So, without DBA privs, you can't do it.

这篇关于设置oracle用户密码有效期/宽限期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆