1. Forum Rules (PLEASE CLICK HERE TO READ BEFORE POSTING) Click the link to access ADSM.ORG Acceptable Use Policy and forum rules which should be observed when using this website. Violators may be banned from this website. This message will disappear after you have made at least 12 posts. Thank you for your cooperation.

Number of tape per node

Discussion in 'Scripting' started by chris_magic, Sep 9, 2010.

  1. chris_magic

    chris_magic New Member

    Joined:
    May 17, 2007
    Messages:
    178
    Likes Received:
    0
    Occupation:
    TSM Consultant
    Location:
    Quebec, Qc, Canada
    Hi,

    I wish to have a script that allows me to know the number of tape used by a specific node from a storage pool specific.

    Thanks in advance for your help.
     
  2.  
  3. crazytsm

    crazytsm New Member

    Joined:
    Oct 18, 2009
    Messages:
    53
    Likes Received:
    0
    select distinct(volume_name) from volumeusage where node_name='NODENAME' and stgpool_name='STGPOOLNAME'
     
  4. chris_magic

    chris_magic New Member

    Joined:
    May 17, 2007
    Messages:
    178
    Likes Received:
    0
    Occupation:
    TSM Consultant
    Location:
    Quebec, Qc, Canada
    Unfortunately this doesn't work.
     
  5. crazytsm

    crazytsm New Member

    Joined:
    Oct 18, 2009
    Messages:
    53
    Likes Received:
    0
    It should work ...This is the output from one of the tsm servers which we are handling.Please try once again

    tsm: *****>select distinct(volume_name) from volumeusage where node_name='VAL89709' and stgpool_name='WIN_PRI'

    VOLUME_NAME
    ------------------
    TN40756
    TN41120
     
  6. chris_magic

    chris_magic New Member

    Joined:
    May 17, 2007
    Messages:
    178
    Likes Received:
    0
    Occupation:
    TSM Consultant
    Location:
    Quebec, Qc, Canada
    tsm : *********>select distinct(volume_name) from volumeusage where node_name='DMZ00DMZQC00055' and stgpool_name='lto3_pool'
    ANR2034E SELECT: No match found using this criteria.
    ANS8001I Code de retour 11.

    OR

    tsm : TCN00QUBC00076>Select distinct node_name,volume_name,stgpool_name from volumeusage where node_name='DMZ00DMZQC00055' and stgpool_name='LTO3_POOL'

    HTML:
    NODE_NAME              VOLUME_NAME            STGPOOL_NAME
    ------------------     ------------------     ------------------
    DMZ00DMZQC00055        300011                 LTO3_POOL
    DMZ00DMZQC00055        300016                 LTO3_POOL
    DMZ00DMZQC00055        300021                 LTO3_POOL
    DMZ00DMZQC00055        300028                 LTO3_POOL
    DMZ00DMZQC00055        300038                 LTO3_POOL
    I would like a script that makes me the total number of tapes.
     
  7. chris_magic

    chris_magic New Member

    Joined:
    May 17, 2007
    Messages:
    178
    Likes Received:
    0
    Occupation:
    TSM Consultant
    Location:
    Quebec, Qc, Canada
    The solution:

    select count(distinct volume_name) as "Number of tapes" FROM volumeusage where stgpool_name='STGPOOL_NAME' and node_name='NODE_NAME'

    or

    select stgpool_name, count(distinct volume_name) as "Number of tapes" FROM volumeusage where node_name='NODE_NAME' GROUP BY stgpool_name
     
    Last edited: Sep 9, 2010

Share This Page