Blame
|
1 | ## Archivelog_Объем_сгенерированных_логов |
||||||
| 2 | ||||||||
|
3 | ```ora= |
||||||
|
4 | select d.type |
||||||
| 5 | , trunc(completion_time) as "DATE" |
|||||||
| 6 | , trunc(sum(blocks*block_size)/1024/1024/1024) as GB |
|||||||
| 7 | , count(1) cnt |
|||||||
| 8 | from v$archived_log l join V$ARCHIVE_DEST_STATUS d on d.DEST_ID = l.DEST_ID and d.status='VALID' |
|||||||
| 9 | where first_time > trunc(sysdate-10) |
|||||||
| 10 | group by d.type, trunc(completion_time) |
|||||||
| 11 | order by 2 desc ,1; |
|||||||
| 12 | ``` |
|||||||
| 13 | #### Разбивка по часам |
|||||||
|
14 | ```ora= |
||||||
|
15 | alter session set nls_date_format='DD MON YYYY'; |
||||||
|
16 | |||||||
| 17 | select thread#, |
|||||||
| 18 | trunc(completion_time) as "date", |
|||||||
| 19 | to_char(completion_time,'Dy') as "Day", |
|||||||
| 20 | count(1) as "total", |
|||||||
| 21 | sum(decode(to_char(completion_time,'HH24'),'00',1,0)) as "h00", |
|||||||
| 22 | sum(decode(to_char(completion_time,'HH24'),'01',1,0)) as "h01", |
|||||||
| 23 | sum(decode(to_char(completion_time,'HH24'),'02',1,0)) as "h02", |
|||||||
| 24 | sum(decode(to_char(completion_time,'HH24'),'03',1,0)) as "h03", |
|||||||
| 25 | sum(decode(to_char(completion_time,'HH24'),'04',1,0)) as "h04", |
|||||||
| 26 | sum(decode(to_char(completion_time,'HH24'),'05',1,0)) as "h05", |
|||||||
| 27 | sum(decode(to_char(completion_time,'HH24'),'06',1,0)) as "h06", |
|||||||
| 28 | sum(decode(to_char(completion_time,'HH24'),'07',1,0)) as "h07", |
|||||||
| 29 | sum(decode(to_char(completion_time,'HH24'),'08',1,0)) as "h08", |
|||||||
| 30 | sum(decode(to_char(completion_time,'HH24'),'09',1,0)) as "h09", |
|||||||
| 31 | sum(decode(to_char(completion_time,'HH24'),'10',1,0)) as "h10", |
|||||||
| 32 | sum(decode(to_char(completion_time,'HH24'),'11',1,0)) as "h11", |
|||||||
| 33 | sum(decode(to_char(completion_time,'HH24'),'12',1,0)) as "h12", |
|||||||
| 34 | sum(decode(to_char(completion_time,'HH24'),'13',1,0)) as "h13", |
|||||||
| 35 | sum(decode(to_char(completion_time,'HH24'),'14',1,0)) as "h14", |
|||||||
| 36 | sum(decode(to_char(completion_time,'HH24'),'15',1,0)) as "h15", |
|||||||
| 37 | sum(decode(to_char(completion_time,'HH24'),'16',1,0)) as "h16", |
|||||||
| 38 | sum(decode(to_char(completion_time,'HH24'),'17',1,0)) as "h17", |
|||||||
| 39 | sum(decode(to_char(completion_time,'HH24'),'18',1,0)) as "h18", |
|||||||
| 40 | sum(decode(to_char(completion_time,'HH24'),'19',1,0)) as "h19", |
|||||||
| 41 | sum(decode(to_char(completion_time,'HH24'),'20',1,0)) as "h20", |
|||||||
| 42 | sum(decode(to_char(completion_time,'HH24'),'21',1,0)) as "h21", |
|||||||
| 43 | sum(decode(to_char(completion_time,'HH24'),'22',1,0)) as "h22", |
|||||||
| 44 | sum(decode(to_char(completion_time,'HH24'),'23',1,0)) as "h23" |
|||||||
| 45 | from v$archived_log |
|||||||
| 46 | where first_time > trunc(sysdate-10) |
|||||||
|
47 | and dest_id = (select dest_id |
||||||
|
48 | from v$archive_dest_status |
||||||
|
49 | where status='VALID' |
||||||
| 50 | and type='LOCAL') |
|||||||
|
51 | group by thread#, trunc(completion_time), to_char(completion_time, 'Dy') |
||||||
| 52 | order by 2,1; |
|||||||
|
53 | ``` |
||||||