Results 1 to 3 of 3
  1. #1
    Member
    Join Date
    Jan 2008
    Posts
    99
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Command to check Filespace in a particular volume

    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. #2
    Moderator chad_small's Avatar
    Join Date
    Dec 2002
    Location
    Gilbert, AZ
    Posts
    2,194
    Thanks
    1
    Thanked 25 Times in 24 Posts

    Default

    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 by chad_small; 12-12-2008 at 10:52 AM.
    Chad Small
    IBM Certified Deployment Professional
    chadsmal@gmail.com
    http://www.tsmadmin.com

  3. #3
    Member
    Join Date
    Sep 2008
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I found an example here: http://www.lascon.co.uk/d005104.htm#sqlfvol
    But be warned, I ran it on a test server and it was slow to return.

Similar Threads

  1. Replies: 3
    Last Post: 11-18-2008, 08:22 AM
  2. volume expiration/check out/check in
    By td3201 in forum Tape / Media Library
    Replies: 13
    Last Post: 06-01-2007, 10:22 AM
  3. Q Filespace command
    By rpask in forum TSM Reporting & Monitoring
    Replies: 3
    Last Post: 01-14-2004, 07:25 PM
  4. Can't check volume in
    By jmcallis in forum Backup / Archive Discussion
    Replies: 1
    Last Post: 09-30-2003, 02:49 PM
  5. Need Select command to check on db2 data
    By bcollins in forum TDP/Application Layer Backup
    Replies: 0
    Last Post: 05-29-2003, 08:41 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •