12c新特性:Last Successful login time
[20150920]12c新特性:Last Successful login time.txt
--12c有一個新特性,就是使用sqlplus登入時,會提示最後成功的登入時間。Last Successful login time。
--起始這個不算什麼特性,我個人想了解這個時間是從那裡得來的。
sqlplus scott/xxxxxx@test01p
SQL*Plus: Release 12.1.0.1.0 Production on Sun Sep 20 17:54:37 2015
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Last Successful login time: Fri Sep 04 2015 22:27:25 +08:00
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
select * from sys.user$ where name='SCOTT';
Record View
As of: 2015/9/20 18:01:12
USER#: 109
NAME: SCOTT
TYPE#: 1
PASSWORD: 57964D8CE8DC6EB2
DATATS#: 3
TEMPTS#: 2
CTIME: 2013/6/28 11:35:40
PTIME: 2015/5/16 22:42:57
EXPTIME: 2015/1/23 21:43:35
LTIME: 2015/4/25 20:30:08
RESOURCE$: 1
AUDIT$:
DEFROLE: 1
DEFGRP#:
DEFGRP_SEQ#:
ASTATUS: 0
LCOUNT: 0
DEFSCHCLASS: DEFAULT_CONSUMER_GROUP
EXT_USERNAME:
SPARE1: 0
SPARE2:
SPARE3:
SPARE4: S:11492E95A3786A4EF1D415619AA186C2F560E811EF0D5FF99256EC6038E9;H:AFB3A8C4DBB1F9C3271E68E986F0772B
SPARE5:
SPARE6: 2015/9/20 9:57:56
SPARE7:
SPARE8:
SPARE9:
SPARE10:
SPARE11:
SCOTT@test01p> select sysdate from dual ;
SYSDATE
-------------------
2015-09-20 18:01:50
--猜測資訊來源SPARE6:2015/9/20 9:57:56。重新登入看看:
sqlplus scott/xxxxxx@test01p
SQL*Plus: Release 12.1.0.1.0 Production on Sun Sep 20 18:02:56 2015
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Last Successful login time: Sun Sep 20 2015 17:57:56 +08:00
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
--相差8個時區,正好對上。
--如果檢查共享池,可以發現類似的語句:
--sql_id='395829wtbubru
SELECT exptime,
ltime,
astatus,
lcount,
spare6
FROM user$
WHERE user# = :1;
--sql_id='d0dwv6jcszbqj'
UPDATE user$
SET exptime =
DECODE (TO_CHAR (:2, 'YYYY-MM-DD'),
'0000-00-00', TO_DATE (NULL),
:2),
ltime =
DECODE (TO_CHAR (:3, 'YYYY-MM-DD'),
'0000-00-00', TO_DATE (NULL),
:3),
astatus = :4,
lcount = :5,
spare6 =
DECODE (TO_CHAR (:6, 'YYYY-MM-DD'),
'0000-00-00', TO_DATE (NULL),
:6)
WHERE user# = :1;
SCOTT@test01p> select sql_id,executions from v$sql where sql_id in ('395829wtbubru','d0dwv6jcszbqj');
SQL_ID EXECUTIONS
------------- ----------
395829wtbubru 3
d0dwv6jcszbqj 3
--退出sqlplus再進入:
SCOTT@test01p> select sql_id,executions from v$sql where sql_id in ('395829wtbubru','d0dwv6jcszbqj');
SQL_ID EXECUTIONS
------------- ----------
395829wtbubru 4
d0dwv6jcszbqj 4
--另外這種方式不僅僅sqlplus有效,對其它像toad一樣有效。使用toad登入:
SCOTT@test01p> select sql_id,executions from v$sql where sql_id in ('395829wtbubru','d0dwv6jcszbqj');
SQL_ID EXECUTIONS
------------- ----------
395829wtbubru 5
d0dwv6jcszbqj 5
--但是對於OS認證的登入方式不會記錄。
D:\tools\rlwrap>sqlplus sys/xxxx@test01p as sysdba
sqlplus sys/xxxxxx@test01p as sysdba
SQL*Plus: Release 12.1.0.1.0 Production on Sun Sep 20 19:16:30 2015
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SYS@test01p> select sql_id,executions from v$sql where sql_id in ('395829wtbubru','d0dwv6jcszbqj');
SQL_ID EXECUTIONS
------------- ----------
395829wtbubru 5
d0dwv6jcszbqj 5
--如果禁止限制這個顯示,sqlplus可以加入引數-nologintime:
d:\tools\rlrwap>sqlplus -nologintime scott/btbtms@test01p
SQL*Plus: Release 12.1.0.1.0 Production on Mon Sep 21 15:43:48 2015
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SCOTT@test01p> select sql_id,executions from v$sql where sql_id in ('395829wtbubru','d0dwv6jcszbqj');
SQL_ID EXECUTIONS
------------- ----------
395829wtbubru 6
d0dwv6jcszbqj 6
--但是還是要修改表sys.user$. 可以想象一下如果應用是2層,出來大量的連線,可能會在這裡出現爭用.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-1805291/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [20211013]19C 關於LAST SUCCESSFUL LOGIN TIME.txtAST
- [20211115]12c以上版本Last Login Time 引發的故障.txtAST
- Oracle 12C新特性-資料泵新引數(LOGTIME)Oracle
- Oracle 12c新特性Oracle
- Oracle 12c 新特性(四)Oracle
- Oracle 12c 新特性(三)Oracle
- Oracle 12c 新特性(二)Oracle
- Oracle 12c 新特性(一)Oracle
- Oracle 12c新特性--ASMFD(ASM Filter Driver)特性OracleASMFilter
- Oracle 12c新特性之Sequence的Session特性OracleSession
- Oracle 12C新特性-History命令Oracle
- Oracle 12c 兩個新特性Oracle
- Oracle 12C新特性In-MemoryOracle
- Oracle GoldenGate 12c 新特性OracleGo
- 12c RMAN新特性之Recover Table
- Oracle 12c DG新特性Far SyncOracle
- Oracle 12c 新特性之 temp undoOracle
- ORACLE 12C新特性——CDB與PDBOracle
- 12C SQL方面新特性小結SQL
- Oracle 12C新特性-RMAN恢復表Oracle
- Oracle 12C 新特性之級聯truncateOracle
- 12c新特性-Oracle Sharding簡介Oracle
- Oracle 12C 新特性之 恢復表Oracle
- Oracle 12c新特性 - Hybrid histogram 3OracleHistogram
- Oracle 12c新特性 - Hybrid histogram 2OracleHistogram
- Oracle 12c新特性 - Hybrid histogram 1OracleHistogram
- Oracle 12c新特性 - Top frequency histogram 3OracleHistogram
- Oracle 12c新特性 - Top frequency histogram 2OracleHistogram
- Oracle 12c新特性 - Top frequency histogram 1OracleHistogram
- goldengate 12c 12.2 新特性(updated)Go
- 11g 新特性 real time apply +real time queryAPP
- 12c新特性,線上move資料檔案
- Oracle 12c 新特性 Active Data Guard Far SyncOracle
- oracle 12c 新特性之不可見欄位Oracle
- oracle 12C 新特性之臨時undo控制Oracle
- Oracle 12C 資料泵新特性測試Oracle
- 【12c】12c RMAN新特性之recover table(表級別恢復)
- 【12C】Oracle 12C 新特性“可插拔資料庫”功能體驗Oracle資料庫