Headers for SQl queries

illllm

ADSM.ORG Member
Joined
Jan 9, 2018
Messages
153
Reaction score
2
Points
0
Is there a way to add headers/headings for SQL queries in TSM ?
 
It depends. How do you run your query? Batch mode or interactive? What type of output, default, table or comma?
 
I add the queries to the reports menu in TSM ops center
 
Oh, that's different. Can you give an example of a query?
 
Any SQl query...

as an example

SELECT activity, TO_CHAR(CHAR(start_time),'YYYY-MM-DD HH24:MI:SS') as START_TIME, TO_CHAR(CHAR(end_time),'YYYY-MM-DD HH24:MI:SS') as END_TIME, TRANSLATE('a bc:de:fg', DIGITS(end_time-start_time), '_______abcdefgh_____',' ') as "ELAPTIME (D HHMMSS)", bytes, successful FROM summary WHERE activity='FULL_DBBACKUP' and end_time >=current_timestamp-24 hours

I want it to have a heading "DATABASE BACKUP STATUS"

Or another script that shows "Failure" or "Successful" must show in red or green and its description of what constitutes a successful or failure.

Or lets say I want to add a custom message "Hello Good Morning" :)
 
I want it to have a heading "DATABASE BACKUP STATUS"
Ah, a section header, not a column header. You just name your query the heading you want:
1537978836314.png

Or another script that shows "Failure" or "Successful" must show in red or green and its description of what constitutes a successful or failure.
Can't do that, but good idea.

The .html file included in the General Operations report does show you clients at risks with a red X, which includes failed backups if the "at-risk" criteria is set to your liking. It doesn't show success, but it's not really important, no action items are required on success.

At-risk is better than failure anyway because it reports failures, but also new nodes not yet configured for backups, as well as nodes not scheduled by Spectrum Protect like using Cron.

Or lets say I want to add a custom message "Hello Good Morning" :)
Can't do that either.
 
TSM 'success' status is not always an actual successful backup. Been burned multiple times. If TSM calls a third party tool, or mmbackup, then the success means that the backup started and stopped. If mmbackup fails, TSM does not know about it. In another scenario, If a backup is sitting with an open session for a week and 0kb processed, its not reported anywhere.
 
If TSM calls a third party tool, or mmbackup, then the success means that the backup started and stopped.
True, it doesn't work for backup types that don't update the filespace last backup date.
 
Wait, if the last backup date is not updated, it would be at risk.

For 3rd party backups, the scripts should do error checking and exit with the final RC. Example:
Bash:
#!/bin/sh
final_rc=0
mmbackup ....
if [ "$?" -ne "0" ]; then
    final_rc=$?
fi

..

exit $final_rc

That way, the script will exit with the return code of mmbackup and not the return code of the last command in the script.
 
Back
Top