0

有人可以向我提供 TSM 命令以获取过去 30 天以 GB 为单位的备份计数吗?

我们可以在 TSM 上执行以获取过去 24 小时的数据大小的 SQL 命令示例:

SELECT substr(entity,1,20) AS "Node", CAST(sum(bytes/1024/1024) AS decimal(8,2)) AS "MB Bkp"
FROM summary
WHERE activity = 'BACKUP' AND start_time>=current_timestamp - 24 hours
GROUP BY entity
order by 2 desc
4

2 回答 2

0

我已经多年没有在 TSM 上工作了,但是你能不能不简单地将 WHERE 子句中的小时数更改为 24 小时 * 30 天?

SELECT substr(entity,1,20) AS "Node", CAST(sum(bytes/1024/1024) AS decimal(8,2)) AS "MB Bkp"
FROM summary
WHERE activity = 'BACKUP' AND start_time>=current_timestamp - 720 hours
GROUP BY entity
order by 2 desc

要获得 GB,请在 SELECT 子句中再次将字节除以 1024。

于 2016-11-10T11:57:13.310 回答
0

您可以尝试使用此 SQL 查询;只需将 7 天更改为 30 天。希望这有效。这是一个包含许多 SQL 查询的有用链接。 https://github.com/thobiast/tsm_sql

12.3. 过去 7 天内每个节点的归档、备份、还原和检索操作统计 (GB)

TSM 版本 6

SELECT entity, activity, CAST(FLOAT(SUM(bytes)) / 1024 / 1024 / 1024 AS DECIMAL(8,2)) -
FROM summary 
WHERE DAYS(current_timestamp)-DAYS(end_time)<=7 and ( activity='ARCHIVE' OR -
  activity='BACKUP' OR activity='RESTORE' OR activity='RETRIEVE' ) 
GROUP BY entity, activity

TSM 版本 5

SELECT entity, activity, CAST(FLOAT(SUM(bytes)) / 1024 / 1024 / 1024 AS DECIMAL(8,2)) -
FROM summary 
WHERE end_time>current_timestamp-(7)DAY and ( activity='ARCHIVE' OR -
  activity='BACKUP' OR activity='RESTORE' OR activity='RETRIEVE' ) 
GROUP BY entity, activity
于 2021-09-20T18:10:50.287 回答