sql >> Base de Datos >  >> RDS >> Oracle

Cambiar la fecha de caducidad de la contraseña de usuario de Oracle

Tienes que crear un nuevo perfil de usuario (o modificar uno existente) como este:

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;

Para obtener ACCOUNT_STATUS = EXPIRED(GRACE) debe iniciar sesión con este usuario; de lo contrario, el estado no cambia.

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>

Entonces deberías verlo:

SELECT ACCOUNT_STATUS 
FROM DBA_USERS 
WHERE USERNAME = 'RDJ7';

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

1 row selected.