How can I check if user is locked using query?

Database
Enthusiast

How can I check if user is locked using query?

Hi.

How can I check if user is locked using query?

I tried that query:

SELECT * 
FROM DBC.USERS
WHERE lockedCount>1;

Is this ok? I do not have access to other users so I cannot check if the query is okay. 

Thanks:-)

Tags (2)
1 REPLY
Teradata Employee

Re: How can I check if user is locked using query?

No. Treat lockedCount as number of consecutive unsuccessful attempts.

To determine if user is currently locked you start by checking Locked Date & Locked Time. If those have values, then you have to look at Locked User Expire (in profile or SysSecDefaults) to see if lock will not happen after all (0), remains until manually unlocked (-1), or is automatically unlocked after some number of minutes (without resetting Locked Date & Locked Time).