1. Community Tip: Please Give Thanks to Those Sharing Their Knowledge.
    If you receive helpful answer on this forum, please show thanks to the poster by clicking "LIKE" link for the answer that you found helpful.
  2. Community Tip: Forum Rules (PLEASE CLICK HERE TO READ BEFORE POSTING)
    Click the link above 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 notice will disappear after you have made at least 3 posts.

Command to check Filespace in a particular volume

Discussion in 'Restore / Recovery Discussion' started by nikhil_1707, Dec 12, 2008.

  1. nikhil_1707

    nikhil_1707 ADSM.ORG Member

    Joined:
    Jan 10, 2008
    Messages:
    157
    Likes Received:
    0
    Hi Team,

    I am looking for a select command which can tell the name of the volume in which a particular file(filespace) is stored.
     
  2.  
  3. chad_small

    chad_small ADSM.ORG Moderator

    Joined:
    Dec 17, 2002
    Messages:
    2,210
    Likes Received:
    46
    Occupation:
    AIX/SAN/TSM
    Location:
    Gilbert, AZ
    The easiest way to do this is to query the contents table.

    SELECT NODE_NAME, VOLUME_NAME, FILESPACE_NAME, FILE_NAME, FILE_SIZE FROM CONTENTS WHERE NODE_NAME='<NAME HERE>' AND FILESPACE_NAME='<NAME HERE>' and FILE_NAME='<NAME_HERE>'

    You can play with this and use different filters, but this is going to take awhile to return data if you don't narrow it down as much as possible. You can narrow it down even more if you know which node you are querying, then you can run a SELECT VOLUMEUSAGE sub-query on it and get the volume names the client uses and filter the select even more.

    SELECT NODE_NAME, VOLUME_NAME, FILESPACE_NAME, FILE_NAME, FILE_SIZE FROM CONTENTS WHERE VOLUME_NAME IN (SELECT VOLUME_NAME FROM VOLUMEUSAGE WHERE NODE_NAME='<NAME HERE>') and NODE_NAME='<NAME HERE>' AND FILESPACE_NAME='<NAME HERE>' and FILE_NAME='<NAME_HERE>'

    Now if all you need is the volumes with specific filespaces stored on them you can easily get that from the VOLUMEUSAGE table. (Note: I always identify filespaces using the FSID, it's just a lot easier.)

    SELECT * FROM VOLUMEUSAGE WHERE NODE_NAME='<NAME HERE>' AND FILESPACE_ID=<NUMBER HERE NO QUOTES>
     
    Last edited: Dec 12, 2008
  4. Justin

    Justin ADSM.ORG Member

    Joined:
    Sep 5, 2008
    Messages:
    21
    Likes Received:
    1

Share This Page