Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Is my understanding of v$session.logon_time wrong ?

York35Jan 15 2018 — edited Jan 15 2018

DB version: 11.2.0.4

OS : Oracle Linux 6.8

I am logged into the below mentioned DB server as sys. This DB is a rarely used test DB.

I want to list all sessions sorted by when the sessions were spawned in this DB instance. I believe v$session.logon_time should be used for this very basic info.

But, I can see that the logon_time just reflects the time I run the query on v$session.

Oracle's 11.2 documentation on v$session.logon_time says "Time of logon" . But this is not "Time of logon" ! I actually logged in at 18:35 PM

https://docs.oracle.com/cd/E18283_01/server.112/e17110/dynviews_3016.htm

SQL> select sysdate from dual;

SYSDATE

-----------------

15-JAN-2018 19:02

SQL> select logon_Time, machine from v$session where type = 'USER' order by logon_time desc;

LOGON_TIME        MACHINE

----------------- ----------------------------------------------------------------

15-JAN-2018 19:02 brcstgdbv7301

15-JAN-2018 19:02 brcstgdbv7301

15-JAN-2018 19:00 brcsoaappv7301

15-JAN-2018 19:00 brcstgdbv7301

15-JAN-2018 18:16 brcstgdbv7301

20-NOV-2017 13:51 brcosbappv7301

25-OCT-2017 21:12 brcstgdbv7301

16-OCT-2017 00:51 brcstgdbv7301

8 rows selected.

-- 1 minute later

SQL> select sysdate from dual;

SYSDATE

-----------------

15-JAN-2018 19:03

SQL> select logon_Time, machine from v$session where type = 'USER' order by logon_time desc;

LOGON_TIME        MACHINE

----------------- ----------------------------------------------------------------

15-JAN-2018 19:03 brcstgdbv7301

15-JAN-2018 19:03 brcstgdbv7301

15-JAN-2018 19:03 brcstgdbv7301

15-JAN-2018 19:00 brcsoaappv7301

15-JAN-2018 18:16 brcstgdbv7301

20-NOV-2017 13:51 brcosbappv7301

25-OCT-2017 21:12 brcstgdbv7301

16-OCT-2017 00:51 brcstgdbv7301

8 rows selected.

--- Eight minutes later

SQL> select sysdate from dual;

SYSDATE

-----------------

15-JAN-2018 19:11

SQL> select logon_Time, machine from v$session where type = 'USER' order by logon_time desc;

LOGON_TIME        MACHINE

----------------- ----------------------------------------------------------------

15-JAN-2018 19:11 brcstgdbv7301

15-JAN-2018 19:11 brcstgdbv7301

15-JAN-2018 19:10 brcstgdbv7301

15-JAN-2018 19:00 brcsoaappv7301

15-JAN-2018 18:16 brcstgdbv7301

20-NOV-2017 13:51 brcosbappv7301

25-OCT-2017 21:12 brcstgdbv7301

16-OCT-2017 00:51 brcstgdbv7301

8 rows selected.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 12 2018
Added on Jan 15 2018
4 comments
3,145 views