Huander
Huander

Reputation: 71

IBM TSM - Select command to view size of Daily Backup

I am working with IBM Tivoli Management Storage and I have to run a a daily report of how much data have been backed-up.

The command below give me the result in Megabytes which is OK, But to save time I would like to have have the result in Gigabytes as my backups are on average bigger than 0ne Gigabyte.

I have tried few variation, but it didn't work, I know very little of SQL and TSM use similar command could someone help me with it.

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

The Result is:

Node                           MB Bkp
---------------------     -----------
SRWLON0xxxx                 510298.00
SRWLON0xxxx                  18999.00
SRWLON0xxxx                  18960.00
SRWLON0xxxx                   9023.00
SVWLON0xxxx                   7581.00
SRWLON0xxxx                   6436.00

Thank you in advance.

Upvotes: 0

Views: 7262

Answers (2)

Emrah Saglam
Emrah Saglam

Reputation: 145

It brings daily backed up size report depending on a TSM Schedule:

SELECT VARCHAR_FORMAT(START_TIME, 'YYYYMMDD') AS START_TIME, CAST(SUM(BYTES/1024/1024/1024) AS DECIMAL(8,2)) AS "SIZE(GB)" FROM **TSM_DB_NAME**.SUMMARY WHERE ACTIVITY='BACKUP' AND SCHEDULE_NAME='**TSM_SCHEDULE_NAME**' GROUP BY VARCHAR_FORMAT(START_TIME, 'YYYYMMDD') ORDER BY START_TIME DESC

Upvotes: 1

Fabio
Fabio

Reputation: 26

You have to add another /1024 and modify the name in "GB Bkp"

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

Hope this will help you

Upvotes: 1

Related Questions