Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

LOAD DATA LOCAL INFILE 'c:\\MSR\\lambdaLambda\\2017-08-01_event-export.csv' REPLACE INTO TABLE reports.infinera_dna_outages FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"' LINES TERMINATED BY '\n' IGNORE 10 LINES;

...

update reports.infinera_outage_ci
set time_diff = (UNIX_TIMESTAMP(end_time) - UNIX_TIMESTAMP(start_time))
where end_time is not null;

 

SELECT CONCAT('UPDATE reports.report_service_availability SET outage = \'',TIME_FORMAT(SEC_TO_TIME(sum(a.time_diff)),'%H:%i:%s'),'\', number_of_failures = ',count(*),' WHERE base_absid = ',b.circuit_absid,' AND year = ',year(a.start_time),' AND month = ',month(a.start_time),';') as 'SQL Commands'

FROM reports.infinera_outage_ci a
LEFT JOIN reports.opsdb_circuit b ON (b.name = a.circuit_id)
WHERE year(a.start_time) = 2017
AND month(a.start_time) = 7
AND b.status = 'Operational'
AND b.new_service_type = 'Geant Lambda'
AND a.circuit_id NOT LIKE '%_EEX_ESNET_14%'
GROUP BY a.circuit_id;

...