/* Create Report of total MBs per each session */
select entity as "Node Name ", cast(bytes/1024/1024 as decimal(10,3))
as "Total MB ", cast(substr(cast(end_time-start_time as char(17)),3,8) as
char(8)) as "Elapsed ", substr(cast(start_time as char(26)),1,19) as
"Date/Time ", case when cast((end_time-start_time) seconds as
decimal) >0 then cast(bytes/cast((end_time-start_time) seconds as
decimal)/1024/1024 as decimal(6,3)) else cast(0 as decimal(6,3)) end as "
MB/Sec" from summary where start_time>=current_timestamp - 1 day and
activity='BACKUP'
/* Create Report of total MBs and length of backup for each node */
select entity as "Node Name ", cast(sum(bytes/1024/1024) as
decimal(10,3)) as "Total MB", substr(cast(min(start_time) as
char(26)),1,19) as "Date/Time ",
cast(substr(cast(max(end_time)-min(start_time) as char(20)),3,8) as
char(8)) as "Length " from summary where start_time>=current_timestamp -
22 hours and activity='BACKUP' group by entity
/* Create Report of total backed up*/
select sum(cast(bytes/1024/1024/1024 as decimal(6,3))) "Total GB Backup"
from summary where start_time>=current_timestamp - 1 day and
activity='BACKUP'
/* Create Report of Storage Pool Copies */
select entity as "Storage Pool ",
cast(bytes/1024/1024 as decimal(10,3)) as " Total MB ", ' ' as " ",
substr(cast(start_time as char(26)),1,19) as "Date/Time ",
cast(substr(cast(end_time-start_time as char(20)),3,8) as char(8)) as
"Length " from summary where start_time>=current_timestamp - 22 hours and
activity='STGPOOL BACKUP' order by 3, entity
/* Create Summary Report for each Storage Pool */
select entity as "Storage Pool ",
cast(sum(bytes/1024/1024) as decimal(10,3)) as " Total MB ", ' ' as " ",
substr(cast(min(start_time) as char(26)),1,19) as "Start Date/Time ",
substr(cast(max(end_time) as char(26)),1,19) as "End Date/Time "
from summary where start_time>=current_timestamp - 22 hours and
activity='STGPOOL BACKUP' group by entity
/* Create Report of Total Storage Pool GB copied */
select sum(cast(bytes/1024/1024/1024 as decimal(6,3))) "Total STG Pool GB
Backup" from summary where start_time>=current_timestamp - 1 day and
activity='STGPOOL BACKUP'
/* Create a report of File Spaces that have been backed up in the last 7
days but missed */
/* being backed up in the last 22 hours. */
select node_name as "Node Name", filespace_name as "File Space Name",
filespace_type as "File Space Type", substr(cast(backup_start as
char(26)),1,16) as "Last Backup Begin", substr(cast(backup_end as
char(26)),1,16) as "Last Backup End" from filespaces where backup_start
>current_timestamp - 7 days and backup_end < current_timestamp - 22 hours
and node_name not in (select node_name from nodes where domain_name in
('DOMAIN_TO_EXCLUDE') or upper(contact) in ('*SUSPENDED*', '*RETIRED*') or
upper(contact) like '%*NO AUDIT*%') order by 3,4,1,2