OnDemand User Group

Support Forums => MP Server => Topic started by: rstockton on January 20, 2015, 09:24:21 AM

Title: How to Count the Number of Files on A Tape
Post by: rstockton on January 20, 2015, 09:24:21 AM
TSM - 6.3, LT04 tapes

Is there any way to count the number of files on a TSM LT04 tape?  We are trying to develop some metrics by estimating how many files we store on a LT04 tape and I cannot find any way to get a count from a tape.

Thanks,
Russell
Title: Re: How to Count the Number of Files on A Tape
Post by: Justin Derrick on January 21, 2015, 04:46:22 AM
Ah, the murky world of database queries in TSM.  :)

Even in old versions of TSM, where the database engine was some proprietary thing, you could still issue select statements.  Now that DB2 runs under the hood in TSM, you have all the power and flexibility that DB2 provides for getting the information you want from DB2.

Log in as your TSM admin, connect to DB2, connect to the TSMDB1 database, and start looking around.  I haven't taken the time to dig through the innards of newer versions of TSM, but you'll likely find tables that contain what you're looking for.  (You can get information on the fields in tables with 'describe table <owner>.<tablename>.)

Report back and let us know what you find!

-JD.
Title: Re: How to Count the Number of Files on A Tape
Post by: rstockton on February 10, 2015, 10:03:31 AM
I have found that auditing a tape will give the number of files it contains.  It is a slow process to get the number of files.

AUDIT VOLUME XXXXXXXXXX

q proc

Process     Process Description      Process Status
  Number
--------     --------------------     -------------------------------------------------
      99     Audit Volume             Volume XXXXXXX (storage pool TIER3POOL), Files
              (Inspect Only)           Processed: 53976, Damaged Files Found: 0,
                                       Partial Files Skipped: 0. Current Physical File
                                       (bytes): 3,072 Current input volume: XXXXXXX.
Title: Re: How to Count the Number of Files on A Tape
Post by: Justin Derrick on February 11, 2015, 04:50:44 AM
There should be a better way to get this info from the database -- a simple SQL select statement.  Although, an audit is never a bad idea.  :)

I'll get back to you when I've had a chance to do some more digging.

-JD.
Title: Re: How to Count the Number of Files on A Tape
Post by: Alessandro Perucchi on March 18, 2015, 09:34:08 AM
q content <volume>

if you run it in batch mode, then you can use the unix power to do what you want with it :-)