Re: List all tapes, highlighting those in library.
2004-01-05 18:47:16
Hot Diggety! Deon George was rumored to have written:
> Has anybody got an SQL, that can list all VOLUMES, and highlight (either
> showing the element number or something) those that are in the library?
>
> This report would be useful to see quickly if a list of tapes are already
> in the library - or which tapes in the list are not and need to be checked
> in.
I got a list of tables by doing:
tsm> select tabnames,remarks from tables
Then I decided to look at the table called LIBVOLUMES because your request
is essentially the SQL equivalent of 'query libvolume'.
So then I decided to see what fields (columns) were present in the table
called 'LIBVOLUMES' with:
tsm: MYSERVER>select colname from columns where tabname='LIBVOLUMES'
COLNAME
------------------
LIBRARY_NAME
VOLUME_NAME
STATUS
OWNER
LAST_USE
HOME_ELEMENT
CLEANINGS_LEFT
Based on that, I figured only three columns might be useful. So:
tsm> select library_name,volume_name,home_element from libvolumes
...which would produce an output like:
tsm: MYSERVER>select library_name,volume_name,home_element from libvolumes
LIBRARY_NAME VOLUME_NAME HOME_ELEMENT
------------------ ------------------ ------------
3584LIB1 MYS000 1026
3584LIB1 MYS001 1027
3584LIB1 MYS002 1028
3584LIB1 MYS003 1029
3584LIB1 MYS004 1030
3584LIB1 MYS005 1031
[...snip...]
If you have only one library, you are free to leave the library_name off
the select query.
Parse the results as you like, regardless of if it's called via an internal
TSM server-side script or if it's called via a script that parses the
output of calling dsmadmc in batch mode. It is trivial in either case.
-Dan
|
|
|