Is there any SQL command for 'q mount'

gsavy

ADSM.ORG Member
Joined
Feb 18, 2004
Messages
123
Reaction score
0
Points
0
Location
Annecy / France
Website
Visit site
PREDATAR Control23

Hello



I'm looking for an SQL select to find out which tape is in drive. I didn't find any table containing this information



Thanks for your help

Guillaume
 
PREDATAR Control23

<TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class="pn-sub">Quote:</font><HR></TD></TR><TR><TD><FONT class="pn-sub"><BLOCKQUOTE>Hello



I'm looking for an SQL select to find out which tape is in drive. I didn't find any table containing this information



Thanks for your help

Guillaume</BLOCKQUOTE></FONT></TD></TR><TR><TD><HR></TD></TR></TABLE>



Try : select * from summary where activity like 'TAPE MOUNT'
 
PREDATAR Control23

Thanks but it' s not what I really wanted, but I think it's because my question was wrong.





I'm just looking for which tape are in drive 'in real time'. Under TSM, I'm doing a Q MOUNT, and I saw if somes tapes are in drive.



with SQL, I found a DRIVE table, but I only see drive state (empty, full..) but not which tape is in.
 
PREDATAR Control23

Hi,



may be "select * from mount" is what you are looking for.



Cheers Michael
 
PREDATAR Control23

Hello,



select from mount works fine with our TSM server V5R1M8 on z/OS. Actually I do not know if this is special on z/OS because in this environment TSM does not need its own routines for tape management like in Windows or Unix. Instead DFSMSrmm and OAM are used. Consider using operating system services to look up cartridge use, e.g. the tctl or mt programme.



Cheers Michael
 
PREDATAR Control23

Hello, I don't know if this helps, but I use this sql command to see if there are any tapes in the drives:





select drive_state from drives where drive_state='LOADED'
 
PREDATAR Control23

Thanks you



I've already found this command, but the only information I got is LOADED, or EMPTY, but never the tape label



Guillaume
 
PREDATAR Control23

Hi,

select * from drives will show everything

I prefer something like this:

Protect: TSM>select cast(DRIVE_NAME as char (10)),cast(volume_name as char(15)) from drives

Unnamed[1] Unnamed[2]
----------- ----------------
F2C1R1 611165L6
F2C1R2 612566L6
F2C1R3 100194L6
F2C1R4 610259L6
F2C2R1 610835L6
 
PREDATAR Control23

I use these two
Just add lines changing the "BC*" to whatever your tape series start with

/* -------------------------------------------------------------*/
/* Script Name: MOUNT */
/* Description: Find out how many drives are in use and then */
/* detailed mount listing */
/* Parameter #1: N/A */
/* Example: RUN MOUNT */
/* -------------------------------------------------------------*/
SELECT count(*) as "USBNTDPSTL01 DRIVES AVAILABLE (22)" from PATHS -
where ONLINE='YES' and LIBRARY_NAME='USBNTDPSTL01'

SELECT count(*) as "USBNTDPSTL01 DRIVES IN USE" -
from DRIVES where DRIVE_STATE='LOADED' -
and LIBRARY_NAME='USBNTDPSTL01'

SELECT count(*) as "USBNTDPSTL01 DRIVES RESERVED" -
from DRIVES where DRIVE_STATE='RESERVED' -
and LIBRARY_NAME='USBNTDPSTL01'
*
ISSUE MESSAGE I "LOOKING FOR MOUNTED VOLUMES STARTING WITH BC"
Q MO BC* F=D




/* -------------------------------------------------------------*/
/* Script Name: MOUNT2 */
/* Description: Find out how many drives are in use and/or */
/* reserved and then show a short mount listing */
/* (RUN MOUNT2) */
/* Parameter #1: N/A */
/* Example: RUN MOUNT2 */
/* -------------------------------------------------------------*/
SELECT count(*) as "USBNTDPSTL01 DRIVES AVAILABLE (22)" from PATHS -
where ONLINE='YES' and LIBRARY_NAME='USBNTDPSTL01'

SELECT count(*) as "USBNTDPSTL01 DRIVES IN USE" -
from DRIVES where DRIVE_STATE='LOADED' -
and LIBRARY_NAME='USBNTDPSTL01'

SELECT count(*) as "USBNTDPSTL01 DRIVES RESERVED" -
from DRIVES where DRIVE_STATE='RESERVED' -
and LIBRARY_NAME='USBNTDPSTL01'
*
ISSUE MESSAGE I "LOOKING FOR MOUNTED VOLUMES STARTING WITH BC"
Select cast((LIBRARY_NAME) as CHAR(12)) AS "LIBRARY NAME", -
cast((DRIVE_NAME) AS CHAR(9)) AS "DRIVE NAME", -
cast((DRIVE_STATE) AS CHAR(12)) AS "STATE", -
cast((VOLUME_NAME) AS CHAR(6)) AS "VOLUME NAME" -
FROM DRIVES -
WHERE LIBRARY_NAME='USBNTDPSTL01' AND -
VOLUME_NAME LIKE 'BC%' -
ORDER BY VOLUME_NAME
 
Top