ADSM-L

[ADSM-L] Help on Tsm 6 script

2011-10-20 07:33:56
Subject: [ADSM-L] Help on Tsm 6 script
From: Robert Ouzen <rouzen AT UNIV.HAIFA.AC DOT IL>
To: ADSM-L AT VM.MARIST DOT EDU
Date: Thu, 20 Oct 2011 11:32:29 +0000
Hi to all

This week I upgrade one  my Tsm server from V5.5.4.0 to V6.2.3.0 in Windows 
platform 2008R2, everything work fine ….

Now trying to update some scripts by example this one (Report of backup / 
archive in specific period).

set sqlmathmode round
set sqldatetimeformat eur
select entity as nodename, -
    date(start_time) as "Date (Y/M/D)", -
    time(start_time) as "Begin time", -
    time(end_time) as "End time", -
    cast(sum(affected) as varchar(10)) as "Num Obj", -
cast(sum(failed) as varchar(10)) as "Num Obj Failed", -
  case -
    when sum(bytes)>1073741824 then cast(sum(bytes)/1073741824 as varchar(10)) 
|| ' Gb' -
    when sum(bytes)>1048576 then cast(sum(bytes)/1048576 as varchar(10)) || ' 
Mb' -
    when sum(bytes)>1024 then cast(sum(bytes)/1024 as varchar(10)) || ' Kb' -
    else cast(sum(bytes) as varchar(10)) -
end as "Bytes" -
  from summary -
  where (activity='BACKUP' or activity='ARCHIVE') and -
     start_time>=timestamp(current_date-$1 day,'10:00:00') and -
     start_time<=timestamp(current_date,'09:00:00') and -
     successful='YES' -
     and entity  like upper('%%$2%%') -
   group by entity,start_time,end_time

How can I calculate the elapsed time between the begin and end time this line 
in my previous version work fine but here I got:  ELAPSED: 7.000000

Here the line I used:
substr(cast(end_time-start_time as varchar(17)),3,8) as elapsed, -

By the way it is a possibility to got the output as a table now I got the 
output in few lines ?

Regards  Robert

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