Hello All,
I am trying to report sessions connection to the database withing the last 24 hours to include all of the following columns AND LOG_OFF_TIME:
Here is sample output:
CPM clarit 1 410 RTP001 PDXWCLRTP001 13-NOV-2016 12:04:20 1394125
CPM clarit 70 190 LRTP001 PDXWCLRTP001 13-NOV-2016 12:11:41 1393681
CPM clarit 194 970 LRTP001 PDXWCLRTP001 14-NOV-2016 07:03:07 1325798
How can I modify the code to generate the report for the last 24 hours, and include LOG_OFF_TIME in the columns?
Thanks
I am trying to report sessions connection to the database withing the last 24 hours to include all of the following columns AND LOG_OFF_TIME:
SQL:
SELECT NVL(s.username, '(oracle)') AS username,
s.osuser,
s.sid,
s.serial#,
--p.spid,
--s.lockwait,
--s.status,
--s.service_name,
--s.module,
s.machine,
s.terminal,
--s.program,
TO_CHAR(s.logon_Time,'DD-MON-YYYY HH24:MI:SS') AS logon_time,
s.last_call_et AS last_call_et_secs
FROM v$session s,
v$process p
WHERE s.paddr = p.addr
ORDER BY s.username, s.osuser;
Here is sample output:
CPM clarit 1 410 RTP001 PDXWCLRTP001 13-NOV-2016 12:04:20 1394125
CPM clarit 70 190 LRTP001 PDXWCLRTP001 13-NOV-2016 12:11:41 1393681
CPM clarit 194 970 LRTP001 PDXWCLRTP001 14-NOV-2016 07:03:07 1325798
How can I modify the code to generate the report for the last 24 hours, and include LOG_OFF_TIME in the columns?
Thanks