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
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
 

trieck

ADSM.ORG Member
Joined
Oct 23, 2002
Messages
3
Reaction score
0
Points
0
<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'
 

gsavy

ADSM.ORG Member
Joined
Feb 18, 2004
Messages
123
Reaction score
0
Points
0
Location
Annecy / France
Website
Visit site
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.
 

p007393

ADSM.ORG Member
Joined
Jan 22, 2004
Messages
90
Reaction score
0
Points
0
Hi,



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



Cheers Michael
 

p007393

ADSM.ORG Member
Joined
Jan 22, 2004
Messages
90
Reaction score
0
Points
0
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
 

cruz_g

ADSM.ORG Member
Joined
Aug 14, 2003
Messages
9
Reaction score
0
Points
0
Website
Visit site
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'
 

gsavy

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



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



Guillaume
 

Trident

TSM/Storge dude
ADSM.ORG Moderator
Joined
Apr 2, 2007
Messages
570
Reaction score
65
Points
0
Location
Oslo, Norway
Website
www.basefarm.no
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
 

morganjk

ADSM.ORG Member
Joined
Jan 9, 2006
Messages
10
Reaction score
1
Points
0
Location
Springdale Ar
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
 

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: 22 19.3%
  • Keep using TSM for Spectrum Protect.

    Votes: 68 59.6%
  • Let's be formal and just say Spectrum Protect

    Votes: 15 13.2%
  • Other (please comement)

    Votes: 9 7.9%

Forum statistics

Threads
31,884
Messages
135,023
Members
21,873
Latest member
ydakir
Top