You have to create a new user profile (or alter an existing one) like this: 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;
In order to get ACCOUNT_STATUS = EXPIRED(GRACE) you have to logon with this user, otherwise the status does not change. 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>
Then you should see it: SELECT ACCOUNT_STATUS FROM DBA_USERS WHERE USERNAME = 'RDJ7'; ACCOUNT_STATUS -------------------------------- EXPIRED(GRACE) 1 row selected.