Finally I have found solution to my problem. Here are the points for everyones information:
1) Is the expiry grace period over and above exiry date?
Answer: Yes its over and above.
2) When the user is in grace period can the user change his/her password using query "ALTER USER XYZ IDENTIFIED BY SOMEPWD" or he still need to contact DBA.
Answer: No user cannot run this query because it would first require to be connected to database. With expired password you cannot connect.
3) How can I handle oracle warning ORA-28002(when the user is in grace period) in c# client. does it at all gets transmitted to c# client. Would it still be handled as exception (try-catch).
Answer: ORA-28002 error can be handled in c# client as OracleClientInfoMessage. Here is the sample code.
try
{
OracleConnection conn = new OracleConnection("User ID=" + uid + ";Password=" + pwd + ";SERVER=" + server);
conn.InfoMessage += new OracleInfoMessageEventHandler(GetOracleWarningInfoMessage);
conn.Open();
return ConnectionStatus.OK;
}
catch (System.Data.OracleClient.OracleException ex)
{
Logger.Error(ex);
switch (ex.Code)
{
case 1005: //null password given
errmsg = "Invalid password";
return ConnectionStatus.InvalidUserPwd;
case 1017: //invalid username/password
errmsg = "Invalid username/password";
return ConnectionStatus.InvalidUserPwd;
case 1040: //invalid character in password
errmsg = "Invalid password";
return ConnectionStatus.InvalidUserPwd;
case 28000://account locked
errmsg = "Account locked. Contact DBA or wait for PASSWORD_LOCK_TIME";
return ConnectionStatus.Locked;
case 28001://password expired
errmsg = "Password expired. Contact DBA";
return ConnectionStatus.Expired;
default:
errmsg = ex.Message;
return ConnectionStatus.Failed;
}
}
4) When the password has already expired, is it that only DBA can change your password.
Answer: The user can change the password himself. If you are using SQLPlus or ODP.net driver you will get a prompt. However if you are using OracleClient (Microsoft) driver you will not be able to since it lacks the OpenWithNewPassword function(which allows to change password before established connection). Probably becuase of non co-operation movement between Mircosoft and Oracle.
OpenWithNewPassword support is only available in Driver ODP(OracleDataProvider) and native OCL. For details refer to link : MSDN or Oracle.
5) does the account gets locked also when expiry date has exceeded beyond grace period.
Answer: No it gets Expired not Locked.