Thursday, March 24, 2016

NEW feature Last login timestamp in 12c Database

*********************************   **********************************

         12c Database now shows the last login time stamp.

*********************************   **********************************

[oracle@Linux03 pdborcl3]$ sqlplus pdborcl1_usr2/XXXXXXX@pdborcl1

SQL*Plus: Release 12.1.0.2.0 Production on Mon Mar 7 14:39:21 2016

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

Last Successful login time: Mon Mar 07 2016 11:46:08 -06:00

SQL> show user

USER is "PDBORCL1_USR2"

SQL> select table_name from tabs;

TABLE_NAME
--------------------------------------------------------------------------------

TEST


SQL> col last_login FOR a25
SQL> col username FOR a15
SQL> SELECT username,last_login FROM dba_users WHERE username='PDBORCL1_USR2';

USERNAME LAST_LOGIN
--------------- -------------------------
PDBORCL1_USR2 07.03.2016 14:39:21



  *********************** NOTE ******************************

NON DBA USERS CAN'T QUERY DBA_USERS TABLE. TRY THIS AS DBA USER


SQL> SELECT username,last_login FROM dba_users WHERE username='PDBORCL1_USR2';
SELECT username,last_login FROM dba_users WHERE username='PDBORCL1_USR2'
                                *
ERROR at line 1:
ORA-00942: table or view does not exit

*********************************   **********************************

You can disable times tamp at run time as below

[oracle@Linux03 pdborcl3]$ sqlplus -nologintime pdborcl1_usr2/pdborcl1_usr2@pdborcl1

SQL*Plus: Release 12.1.0.2.0 Production on Mon Mar 7 14:51:40 2016

Copyright (c) 1982, 2014, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

However even if you can disable times tamp at run time , it will be audit in dba_user table:

SQL> SELECT username,last_login FROM dba_users WHERE username='PDBORCL1_USR2';

USERNAME                      LAST_LOGIN
---------------                      -------------------------
PDBORCL1_USR2        07.03.2016 14:51:40



Points to remember:


  • However even if you can disable times tamp at run time , it will be audit in dba_user table.
  • This Time stamp wont be recorded for SYS user.
  • This Time stamp wont be recorded for OS authenticated users.
  • No login time recording for administrative users respectively password file users


No comments:

Post a Comment