Gill, Geoffrey L. wrote:
select volume_name, cast(last_write_date as date) as "Last Write Date", cast(last_read_date as date) as "Last Read Date" from volumes where stgpool_name='$1' and cast(last_write_date as date)<(current_date-180 days) and cast(last_read_date as date)<(current_date-180 days) order by $2
$1 will be the storage pool name, remember all caps $2 will be the column you want to sort by
Good luck I hope this works for you.
Mark, Thanks for the reply. There is a very interesting problem I see with the return data. I can see there are 233 tapes in that pool, all of which are in the library at the moment.
StgPool Name Status # Tapes ------------------ ------------------ ----------- ARCHIVE_TPOOL FILLING 5 ARCHIVE_TPOOL FULL 228
The statement only returns 90 tapes though. What am I missing as to why those other tapes don't show up??
Geoff Gill TSM Administrator NT Systems Support Engineer SAIC E-Mail: [EMAIL PROTECTED] Phone: (858) 826-4062 Pager: (877) 854-0975
Geoff,
The reason the select statement only returns 90 tapes is that you asked for only those tapes that have not been accessed for more than 6 months (actually I used 180 days). I defined accessed as read or written in that time period. If you wanted to make the script more flexible you could replace the 180 with a positional parameter as well and pass to it the number of days you want to look for.
I hope that clears it up for you.
-- Regards, Mark D. Rodriguez President MDR Consulting, Inc.
=============================================================================== MDR Consulting The very best in Technical Training and Consulting. IBM Advanced Business Partner SAIR Linux and GNU Authorized Center for Education IBM Certified Advanced Technical Expert, CATE AIX Support and Performance Tuning, RS6000 SP, TSM/ADSM and Linux Red Hat Certified Engineer, RHCE ===============================================================================
