• Please help support our sponsors by considering their products and services.
    Our sponsors enable us to serve you with this high-speed Internet connection and fast webservers you are currently using at ADSM.ORG.
    They support this free flow of information and knowledge exchange service at no cost to you.

    Please welcome our latest sponsor Tectrade . We can show our appreciation by learning more about Tectrade Solutions
  • Community Tip: Please Give Thanks to Those Sharing Their Knowledge.

    If you receive helpful answer on this forum, please show thanks to the poster by clicking "LIKE" link for the answer that you found helpful.

  • Community Tip: Forum Rules (PLEASE CLICK HERE TO READ BEFORE POSTING)

    Click the link above to access ADSM.ORG Acceptable Use Policy and forum rules which should be observed when using this website. Violators may be banned from this website. This notice will disappear after you have made at least 3 posts.

Attempting to join 3 tables Status,Events and Summary

darkhorse

ADSM.ORG Member
#1
I have been trying to configure a query to pull data from 3 Tables but unsure if its even possible and what is the required format?
I am after:
TSM server Name
Domain
Nodename
schedule name
schedule start
schedule finish
Backup status
Size of backup
Number of Objects

I can get most out of Events Table or Summary but not all. Any suggestions?
 

chad_small

ADSM.ORG Moderator
#2
select -
VARCHAR(b.server_name,10) as SERVER_NAME, -
VARCHAR(c.domain_name,16) as DOMAIN_NAME, -
VARCHAR(a.SCHEDULE_NAME,20) as SCHEDULE_NAME, -
VARCHAR(a.ENTITY,45) as STGPOOL, -
TRANSLATE('abcde fg:hi:jk', a.start_time, '_____abcde_fg_hi_jk_____',' ') AS start_time, -
TRANSLATE('abcde fg:hi:jk', a.end_time, '_____abcde_fg_hi_jk_____',' ') AS end_time, -
TRANSLATE('ab cd:ef:gh', DIGITS(a.end_time-a.start_time), '______abcdefghi_____',' ') AS duration, -
CASE -
WHEN a.bytes>1099511627776 THEN CAST(DEC(bytes)/1024/1024/1024/1024 AS DEC(5,1))||'TB' -
WHEN a.bytes>1073741824 THEN CAST(DEC(bytes)/1024/1024/1024 AS DEC(5,1))||' GB' -
WHEN a.bytes>1048576 THEN CAST(DEC(bytes)/1024/1024 AS DEC(5,1))||' MB' -
WHEN a.bytes>1024 THEN CAST(DEC(bytes)/1024 AS DEC(5,1))||' KB' -
ELSE -
CAST(a.bytes AS DEC(5,0))||' B' -
END AS bytes, -
CAST(CAST((a.bytes/1024/1024)/TIMESTAMPDIFF(2,CHAR(a.end_time-a.start_time)) -
AS DEC(6,2))AS VARCHAR(6))||' MB/s' AS THROUGHPUT, -
a.AFFECTED as FILES_BACKED_UP, -
a.SUCCESSFUL -
FROM summary a, status b, nodes c -
where a.entity in (select node_name from associations) -
and -
a.entity=c.node_name -
and -
a.activity='BACKUP' -
and -
a.start_time>=(current_timestamp - 3 days) -
order by a.start_time asc
 

darkhorse

ADSM.ORG Member
#4
Your reply helped a lot Thanks

But I have run into snag. So I am after these 2 queries to join into one. I am missing something.
If I run this:
select entity as Client,BYTES_WRITTEN as "SIZE", affected as "Objects",schedule_name,activity from summary where activity='BACKUP' and start_time>=current_timestamp - 1 hours

I get this:

CLIENT SIZE Objects SCHEDULE_NAME ACTIVITY
AIXAU2004CP2101 28,134,769 319 DAILY_INCR_1500 BACKUP


And this query:

select VARCHAR(a.server_name,10) as SERVER_NAME,NODE_NAME as Client,DOMAIN_NAME as Domain,SCHEDULE_NAME as Schedule, ACTUAL_START as "Start Time",COMPLETED as "Finish Time",Status as Status,Result as "Return Code" from status a,events where actual_start>=current_timestamp - 1 hours

this:

SERVER_NAME CLIENT DOMAIN SCHEDULE Start Time Finish Time STATUS RC
RCCPRD01 AIXAU2004CP2100 PRD_UNX DAILY_INCR_1500 2019-01-15, 15:00:19 2019-01-15, 15:00:51 Completed 4


So in this last query have joined status and events tables fine. But when attempting to join summary table details it fails. I feel I am missing something. I need to use the events table as some details are not available in summary.

In short I would like the data above to be one output: Include
SERVER_NAME CLIENT DOMAIN SCHEDULE Start Time Finish Time STATUS RC SIZE Objects Activity

Thanks
 

darkhorse

ADSM.ORG Member
#5
I have gone a bit further now. I am now getting extra records. :(

select VARCHAR(b.server_name,10) as SERVER_NAME,a.NODE_NAME as Client,a.SCHEDULE_NAME as Schedule,a.ACTUAL_START as "Start Time",a.COMPLETED as "Finish Time",c.BYTES_WRITTEN as "SIZE(GB)", c.activity from events a, status b ,summary c where a.NODE_NAME in (select node_name from associations) and c.entity=a.node_name and c.activity='BACKUP' and a.actual_start>=current_timestamp - 1 hours

results in :

SERVER_NAME CLIENT SCHEDULE Start Time Finish Time SIZE(GB) ACTIVITY
PRD01 NIM01 DAILY_INCR_1800 2019-01-15, 18:00:09 2019-01-15, 18:00:44 12,056,767 BACKUP
PRD01 NIM01 DAILY_INCR_1800 2019-01-15, 18:00:09 2019-01-15, 18:00:44 13,751,361 BACKUP


With many more rows for this one Node. NIM01

There should be only 1.

select * from events where actual_start>=current_timestamp - 1 hours

SCHEDULED_START ACTUAL_START DOMAIN_NAME SCHEDULE_NAME NODE_NAME STATUS RESULT COMPLETED
2019-01-15, 18:00:00 2019-01-15, 18:00:09 PRD DAILY_INCR_1800 NIM01 Completed 0 2019-01-15, 18:00:44



Where are these extra rows coming from?
 

chad_small

ADSM.ORG Moderator
#6
The problem is that event records and summary table records don't always match when it comes to start and end times. I've dealt with this before and it means matching the records off of the node_name/entity, the schedule_name, and then matching by the start/end hour and not the full time.
 

darkhorse

ADSM.ORG Member
#7
Thanks Chad,
I think I understand. I need to somehow match part of some data for data time fields.. I will need to investigate how to achieve this. I can prove this is the case by removing the Start/End data from my query, this should result in the expected rows in the result. then somehow work out how to include it.
Thanks for your assistance.
 

Advertise at ADSM.ORG

If you are reading this, so are your potential customer. Advertise at ADSM.ORG right now.

UpCloud high performance VPS at $5/month

Get started with $25 in credits on Cloud Servers. You must use link below to receive the credit. Use the promo to get upto 5 month of FREE Linux VPS.

The Spectrum Protect TLA (Three-Letter Acronym): ISP or something else?

  • Every product needs a TLA, Let's call it ISP (IBM Spectrum Protect).

    Votes: 17 19.5%
  • Keep using TSM for Spectrum Protect.

    Votes: 53 60.9%
  • Let's be formal and just say Spectrum Protect

    Votes: 10 11.5%
  • Other (please comement)

    Votes: 7 8.0%

Forum statistics

Threads
31,471
Messages
134,133
Members
21,569
Latest member
srinathkodela
Top