Friday, August 29, 2014

TKLM - Things To Know Part 3

Identifying and Releasing Empty Volumes Back To Scratch

Due to the TKLM server being unable to issue keys TSM will assign tapes to a storage pool and then fail to write to the tape. To release the tapes back to scratch, after performing the resync you should check the TSM servers to see if any volumes are assigned to a storage pool but contain no data.  Use the following select statement to list the volumes with that 0 percent utilized. You will notice it creates a command within the results allowing you to quickly release the tapes with a simple cut and paste in the TSM admin command line.
select varchar(a.server_name,10) ||':'|| 'del vol', varchar(b.volume_name,8) as volname, b.pct_utilized, varchar(b.stgpool_name,15) as stgpool_name from status a, volumes b where b.pct_utilized=0 and b.devclass_name<>'DISK' order by b.stgpool_name, b.pct_utilized

You should see the following if TSM shows tape(s) with 0% utilized:

Unnamed[1]              VOLNAME        PCT_UTILIZED     STGPOOL_NAME
-------------------     ---------     -------------     ----------------
TSM01:del vol           J02579                  0.0     COPYTAPE
TSM01:del vol           J00243                  0.0     DBTAPE
TSM01:del vol           K00700                  0.0     DBTAPE_B_NC
TSM01:del vol           J00039                  0.0     LOGTAPE
TSM01:del vol           H70341                  0.0     LOGTAPE
TSM01:del vol           J00186                  0.0     LOGTAPE
TSM01:del vol           J00115                  0.0     LOGTAPE
TSM01:del vol           J00528                  0.0     LOGTAPE
TSM01:del vol           J01224                  0.0     LOGTAPE
TSM01:del vol           J01255                  0.0     LOGTAPE
You can use a portion of the results to execute against the server to release the tapes. If you’d rather not see the PCT_UTILIZED or STGPOOL_NAME then remove them from the script:
select varchar(a.server_name,10) ||':'|| 'del vol', varchar(b.volume_name,8) as volname from status a, volumes b where b.pct_utilized=0 and b.devclass_name<>'DISK' order by b.stgpool_name, b.pct_utilized

Unnamed[1]              VOLNAME
-------------------     ---------
TSM01:del vol           J02579
TSM01:del vol           J00243
TSM01:del vol           K00700
TSM01:del vol           H70341
TSM01:del vol           J00039
TSM01:del vol           J00115
TSM01:del vol           J00186
TSM01:del vol           J00528
TSM01:del vol           J01173
TSM01:del vol           J01224
TSM01:del vol           J01255

Run this select against all the TSM servers that have libraries that use the TKLM server and run the results through the TSM admin command line to release the tapes back to scratch. You will notice we are NOT using the DISCARD=YES flag for a reason. Without the discard flag TSM will not delete a volume that has some data but the amount is so low it still reports as 0% utilized.

Note: When deleting volumes DO NOT USE THE DISCARD FLAG! This will keep you from deleting a valid storage pool volume.

No comments:

Post a Comment