Change Oracle User Password Expiration Date

I have a user password expiration date,

Select Expiry_date from USER_USERS;

I want to send a warning message when the password expires.

My password is not expiring anytime soon. I want to change the expiration date to the previous date so that I can verify my code.

My user account password must expire. that is, I want to get ORA-28002ERROR.

I tried to use alter user XYZ password expire;

This sets my user state ACCOUNT_STATUSto EXPIRED, but I want it to be in state EXPIRED(GRACE).

Please suggest any possible method.

+4
source share
1

( ) :

CREATE PROFILE SHORT_LIFE_PROFILE LIMIT
    PASSWORD_LIFE_TIME 1/24/60/60 --> = 1 second
    PASSWORD_GRACE_TIME 1/24; --> = 1 hour

ALTER USER rdj7 PROFILE SHORT_LIFE_PROFILE;

ACCOUNT_STATUS = EXPIRED(GRACE), , .

C:\>sqlplus rdj7/*****@yourDB

SQL*Plus: Release 11.2.0.1.0 Production on Fri Mar 10 10:09:29 2017

Copyright (c) 1982, 2010, Oracle.  All rights reserved.

ERROR:
ORA-28002: the password will expire within 0 days

Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
With the Partitioning option

SQL>

:

SELECT ACCOUNT_STATUS 
FROM DBA_USERS 
WHERE USERNAME = 'RDJ7';

ACCOUNT_STATUS                  
--------------------------------
EXPIRED(GRACE)     

1 row selected.
+2

Source: https://habr.com/ru/post/1671683/


All Articles