On Thursday 11 March 2004 01:35, PAC Brion Arnaud wrote: > Hi Juraj, > > Thanks for the tip, I could probably use it, case I would not succeed in > building a proper SQL statement. But so far, I really need that precise > info to build a sub-query in my main query ... Cheers.
I don't think the "copied=" parameter is exposed for the purposes of SQL queries. You need to remember the TSM database isn't really a relation database. The software only presents us with a "releational view" of the data, which does not always contain every attribute of the original. But, you can probably make do with something like the query below, which instead compares the "occupancy" table for primary and copy storage pool contents: select (select sum(num_files) from occupancy where stgpool_name like '%PRI%') - (select sum(num_files) from occupancy where stgpool_name like '%COPY%') as "UNCOPIED_FILES", (select sum(physical_mb) from occupancy where stgpool_name like '%PRI%') - sum(physical_mb) as "UNCOPIED_MB" from occupancy where stgpool_name like '%COPY%' The output should look something like the following: UNCOPIED_FILES UNCOPIED_MB -------------- --------------------------------- 2 0.12 Note, the query assumes certain naming conventions for primary and copy storage pools, but you could make it more generic easily enough. Regards, Steven P. -- Steven Pemberton Senior Enterprise Management Consultant IBK, Senetas Group Mobile: +61/0 418 335 136 | Phone: +61/3 9820 5811 | Fax: +61/3 9820 9907 Level 1, 11 Queens Road, Melbourne, Victoria, 3004, Australia http://www.senetas.com.au | http://www.ibk.com.au | http://www.datum.com.au