Deletion of Old ID's

General
Enthusiast

Deletion of Old ID's

Hi All,

Please let me know that how can i find old user id's in Teradata which have not been accessed more than a year.

Any script for that will be helpful.

Thanks.

1 REPLY
Enthusiast

Re: Deletion of Old ID's

Mohammad,

you might need to access pdcrdata for older logdates but this should work ok:

SELECT USERNAME FROM dbc.users
MINUS
SEL U FROM
(
SEL USERNAME,MAX(logdate) M FROM dbc.logonoff
GROUP BY 1 HAVING M > DATE - INTERVAL '1' YEAR)DT(U,M);

Rglass