Wednesday, December 21, 2016

When the last time the password has been changed ?

Do you want to know what is the last time the DBA or developers change the password ?

Using the below table :-

Name
Null
Type
USER#       
NOT NULL
NUMBER
NAME        
NOT NULL
NUMBER        
TYPE#       
NOT NULL
VARCHAR2(30)  
PASSWORD    
        
NUMBER        
DATATS#     
NOT NULL
NUMBER        
TEMPTS#     
NOT NULL
DATE          
CTIME       
NOT NULL
DATE          
PTIME       
        
DATE          
EXPTIME     
        
DATE          
LTIME       
        
NUMBER        
RESOURCE$   
NOT NULL
VARCHAR2(38)  
AUDIT$      
        
NUMBER        
DEFROLE     
NOT NULL
NUMBER        
DEFGRP#     
        
NUMBER        
DEFGRP_SEQ# 
        
NUMBER        
ASTATUS     
NOT NULL
NUMBER        
LCOUNT      
NOT NULL
VARCHAR2(30)  
DEFSCHCLASS 
        
VARCHAR2(4000)
EXT_USERNAME
        
NUMBER        
SPARE1      
        
NUMBER        
SPARE2      
        
NUMBER        
SPARE3      
        
VARCHAR2(1000)
SPARE4      
        
VARCHAR2(1000)
SPARE5      
        
DATE
SPARE6      
        
NUMBER        
USER#       
NOT NULL
VARCHAR2(30)  
NAME        
NOT NULL
NUMBER        
TYPE#       
NOT NULL
NUMBER        
PASSWORD    
        
DATE          
DATATS#     
NOT NULL
DATE          
TEMPTS#     
NOT NULL
DATE          
CTIME       
NOT NULL
DATE          
PTIME       
        
NUMBER        
EXPTIME     
        
VARCHAR2(38)  
LTIME       
        
NUMBER        
RESOURCE$   
NOT NULL
NUMBER        
AUDIT$      
        
NUMBER        
DEFROLE     
NOT NULL
NUMBER        
DEFGRP#     
        
NUMBER        
DEFGRP_SEQ# 
        
VARCHAR2(30)  
ASTATUS     
NOT NULL
VARCHAR2(4000)

Referring to Oracle Documentation :-

     
NAME – name for user or role
TYPE# – 0 for role or 1 for user
CTIME – the date of creation
PTIME – the date the password was last changed
EXPTIME – the date the password has last expired
LTIME – the date the resource was last locked
LCOUNT – number of failed logon

You Can use this query :-

SELECT name, ctime, ptime FROM sys.user$ WHERE name = 'USER-NAME';

Thank you
Osama 

No comments:

Post a Comment