patternMinor
What do the columns in SYS.USER$ represent?
Viewed 0 times
thecolumnswhatrepresentusersys
Problem
In the
Where can I find Oracle's documentation for this and other system views?
SYS.USER$ view, what do the CTIME, PTIME, and LTIME columns represent? Where can I find Oracle's documentation for this and other system views?
Solution
Test cases below show:
Here's the test code:
This isn't documented in the Oracle docs, as it's an internal data dictionary view. However, the
I often find that doing a
CTIMEis the date the user was created.
LTIMEis the date the user was last locked. (Note that it doesn't getNULLed when you unlock the user).
PTIMEis the date the password was last changed.
LCOUNTis the number of failed logins.
Here's the test code:
SQL> create user philtest identified by philtest;
User created.
SQL> alter session set nls_date_format='HH24:MI:SS DD/MM/YYYY';
Session altered.
SQL> select ctime,ltime,ptime from user$ where name = 'PHILTEST';
CTIME LTIME PTIME
------------------- ------------------- -------------------
14:21:51 26/04/2012 14:21:51 26/04/2012
SQL> alter user philtest account lock;
User altered.
SQL> select ctime,ltime,ptime from user$ where name = 'PHILTEST';
CTIME LTIME PTIME
------------------- ------------------- -------------------
14:21:51 26/04/2012 14:23:15 26/04/2012 14:21:51 26/04/2012
SQL> alter user philtest identified by foofoo;
User altered.
SQL> select ctime,ltime,ptime from user$ where name = 'PHILTEST';
CTIME LTIME PTIME
------------------- ------------------- -------------------
14:21:51 26/04/2012 14:23:15 26/04/2012 14:27:47 26/04/2012
SQL>This isn't documented in the Oracle docs, as it's an internal data dictionary view. However, the
DBA_%/ALL_%/USER_% views that sit on top of the SYS.% views are documented here.I often find that doing a
DESCribe on one of the DBA_% views gives a good indication of what the underlying columns represent. The DBA_% views are often commented too.Code Snippets
SQL> create user philtest identified by philtest;
User created.
SQL> alter session set nls_date_format='HH24:MI:SS DD/MM/YYYY';
Session altered.
SQL> select ctime,ltime,ptime from user$ where name = 'PHILTEST';
CTIME LTIME PTIME
------------------- ------------------- -------------------
14:21:51 26/04/2012 14:21:51 26/04/2012
SQL> alter user philtest account lock;
User altered.
SQL> select ctime,ltime,ptime from user$ where name = 'PHILTEST';
CTIME LTIME PTIME
------------------- ------------------- -------------------
14:21:51 26/04/2012 14:23:15 26/04/2012 14:21:51 26/04/2012
SQL> alter user philtest identified by foofoo;
User altered.
SQL> select ctime,ltime,ptime from user$ where name = 'PHILTEST';
CTIME LTIME PTIME
------------------- ------------------- -------------------
14:21:51 26/04/2012 14:23:15 26/04/2012 14:27:47 26/04/2012
SQL>Context
StackExchange Database Administrators Q#17513, answer score: 7
Revisions (0)
No revisions yet.