So the previous select is not compatible with TSM 6.1 so I was searching through the IBM Redbooks for TSM and found changes to make TSM conform to SQL standards. There are changes to the TSM supported time functions. Here is the link, it's under Appendix B.
def script event-check desc="Events - Exceptions"
upd script event-check "/* ---------------------------------------------*/"
upd script event-check "/* Script Name: event-check */"
upd script event-check "/* ---------------------------------------------*/"
upd script event-check ' select -'
upd script event-check ' schedule_name, -'
upd script event-check ' cast(SUBSTR(CHAR(actual_start),12,8) as char(8)) AS START, - '
upd script event-check ' node_name, -'
upd script event-check ' cast(status as char(10)) as "STATUS", -'
upd script event-check ' case -'
upd script event-check " when result=0 then ' 0-Succ' -"
upd script event-check " when result=4 then ' 4-SkFi' -"
upd script event-check " when result=8 then ' 8-Warn' -"
upd script event-check " when result=12 then '12-Errs' -"
upd script event-check " else cast(result as char(7)) -"
upd script event-check ' end -'
upd script event-check ' as "RESULT" -'
upd script event-check ' from events -'
upd script event-check ' where timestampdiff(8, char(current_timestamp-scheduled_start))<=24 -'
upd script event-check ' and result<>0 and node_name is not NULL'
Showing posts with label SQL. Show all posts
Showing posts with label SQL. Show all posts
Monday, November 29, 2010
Friday, November 26, 2010
Previously Unknown TSM SQL Feature
So while doing some script maintenance on a TSM server I came across this select statement and was shocked to see the CASE option in a select. I've used it in shell scripts but didn't think TSM allowed for it. Well it does and it works. Go figure! (Runs on a TSM 5.3.5.2 server).
/* ---------------------------------------------*/
/* Script Name: eventx */
/* ---------------------------------------------*/
select -
schedule_name as "Schedule Name ", -
cast(substring(cast(scheduled_start as character(26)) from 12 for 8) as char(8)) as "Sched", -
node_name, -
cast(status as char(10)) as "Status", -
case -
when result=0 then ' 0-Succ' -
when result=4 then ' 4-SkFi' -
when result=8 then ' 8-Warn' -
when result=12 then '12-Errs' -
else cast(result as char(7)) -
end -
as "Result" -
from events -
where current_timestamp-scheduled_start<interval '24' hours -
and result<>0
/* Script Name: eventx */
/* ---------------------------------------------*/
select -
schedule_name as "Schedule Name ", -
cast(substring(cast(scheduled_start as character(26)) from 12 for 8) as char(8)) as "Sched", -
node_name, -
cast(status as char(10)) as "Status", -
case -
when result=0 then ' 0-Succ' -
when result=4 then ' 4-SkFi' -
when result=8 then ' 8-Warn' -
when result=12 then '12-Errs' -
else cast(result as char(7)) -
end -
as "Result" -
from events -
where current_timestamp-scheduled_start<interval '24' hours -
and result<>0
I saw this and a whole new world opened up before my eyes! The possibilities!
Friday, June 20, 2008
Useful SQL statements
Here is a grand list of TSM SQL statements that you can use in your daily report. Excellent work by Thobias, thank you very much.
Thursday, November 22, 2007
TSM Sharepoint TDP
Has anyone used the Sharepoint TDP for TSM yet? I have a number of Sharepoint servers at work and would like to know what users thoughts are on its capabilities. Is it easy to use or a nightmare to implement? Does it backup well or is it slow? Does it adversely affect the systems performance? If anyone can give me some feedback I'd appreciate it.
Tuesday, July 31, 2007
TSM Summary Table Question
So here is a question I hope someone can answer, does the SUMMARY table in the TSM DB track all backups whether they are scheduled or client initiated (cron or manually) or does it just track scheduled backups? Also does it track LAN-Free backups with data amounts? I figure it only tracks scheduled backups, but I haven't taken the time to look. If anyone cares to wager a guess or has the definitive answer please let me know.
Tuesday, April 10, 2007
TSM SQL Tutorials
If you are like many admins out there you might not be very versed in the SQL side of TSM. Luckily, PJ from ADSM.org posted some great TSM SQL tutorial links that I think everyone could benefit from. There is a beginner and an advanced lesson, so there is something for everyone. Check them out.
Subscribe to:
Posts (Atom)