ADSM-L

Re: changeing bytes to gigabytes

2002-05-21 15:55:59
Subject: Re: changeing bytes to gigabytes
From: "Coats, Jack" <Jack.Coats AT BANKSTERLING DOT COM>
Date: Tue, 21 May 2002 14:53:20 -0500
You can suck what you need out of this. ... It is one
I found on the list ... But use the logic and
you can roll your own ... JC

/************************************************/
/* Script that reports all the objects that are */
/* backed up for each node                      */
/************************************************/
set sqlmathmode round
set sqldatetimeformat eur
select entity as "Node", -
   substr(cast(avg(end_time-start_time) -
    as varchar(17)),3,8) as "Elapsed", -
    cast(avg(affected) as decimal(7,0)) as -
        "Avg Obj", -
  case -
    when avg(bytes) > 1073741824 then -
         cast(cast(avg(bytes)/1073741824 as -
         decimal(7,3)) as varchar(24))||' Gb' -
    when avg(bytes) > 1048576 then -
         cast(cast(avg(bytes)/1048576 as -
         decimal(7,3)) as varchar(24))||' Mb' -
    when avg(bytes) > 1024 then -
         cast(cast(avg(bytes)/1024 as -
         decimal(7,3)) as varchar(24))||' Kb' -
    else cast(cast(avg(bytes) as -
         decimal(7,3)) as varchar(24)) -
  end as "Avg Bytes" -
  from summary -
  where activity='BACKUP' and -
     successful='YES' -
  group by entity

<Prev in Thread] Current Thread [Next in Thread>