When I use SQL*Plus, connecting to a user whose password has expired and entered the grace period (11g), I get an error message but the connect is
still successful:
SQL> connect lob_demo
Enter password:
ERROR:
ORA-28002: the password will expire within 7 days
Connected.
SQL> select SYS_CONTEXT('USERENV', 'SESSION_USER') whoami from dual;
WHOAMI
---------------------------------------------------------------------
LOB_DEMO
On the other hand, in my OCI code doing a OCILogon2, if I connect to this same user, I get an OCI_SUCCESS_WITH_INFO with the same error, but if I continue, the OCISvcCtx* I got seems to be invalid (even though it's not null), since trying to do a OCIAttrGet on it gives me an OCI_INVALID_HANDLE error.
So how come SQL*Plus can connect OK, when I get a bad handle? Shall I be attempting to connect a different way?
A related question would be to know if it's possible to prompt the user to enter a new password if it has expired, and how to send that to the server?
Thanks, --DD