/
list.sql
40 lines (36 loc) · 1.26 KB
/
list.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
-- Copyright 2018 Tanel Poder. All rights reserved. More info at http://tanelpoder.com
-- Licensed under the Apache License, Version 2.0. See LICENSE.txt for terms & conditions.
--------------------------------------------------------------------------------
--
-- Author: Tanel Poder
-- Copyright: (c) http://www.tanelpoder.com
--
-- Notes: This software is provided AS IS and doesn't guarantee anything
-- Proofread before you execute it!
--
--------------------------------------------------------------------------------
set lines 156
column sawr_list_takenby heading "Taken By" format a20
column sawr_list_snapid heading "Snap ID" format 9999999
column sawr_list_snaptime heading "Snapshot Time" format a20
column sawr_session_count heading "Snapped|Sessions" format 9999999
column sawr_snap_mode heading "Snapshot|Mode" format a40
select
snap.snapid sawr_list_snapid,
to_char(snap.snaptime, 'YYYY-MM-DD HH24:MI:SS') sawr_list_snaptime,
snap.takenby sawr_list_takenby,
snap.snap_mode sawr_snap_mode,
count(*) sawr_session_count
from
sawr$snapshots snap,
sawr$sessions sess
where
snap.snapid = sess.snapid
group by
snap.snapid,
to_char(snap.snaptime, 'YYYY-MM-DD HH24:MI:SS'),
snap.snap_mode,
snap.takenby
order by
to_char(snap.snaptime, 'YYYY-MM-DD HH24:MI:SS')
/