What tape(s) is my file stored on

chalkd

ADSM.ORG Member
Joined
Nov 22, 2006
Messages
63
Reaction score
0
Points
0
Hello

I am looking for a script or some command to find out which tape or tapes a particular file is stored on.

Can anyone help?
 
A command like that would would bog your server down to it's knees and not complete and you'd likely have to restart TSM to clear it. When you restore, TSM asks for the tapes it needs, or loads them automatically in an automated library.

Having said that, you can see which a node has data on, with....

q nodedata <nodename> stg=<stgpool_name>
 
Hello

I am looking for a script or some command to find out which tape or tapes a particular file is stored on. QUOTE]

q nodedata will show us what tapes contain data for a specific node.

Since we want to know what tape or tapes that contain a specific file, there is not a command would have to run a select statment.


If we know the file name:

select * from backups where node_name='NODE_NAME' and ll_name='FILE_NAME'

If we do not know the file name:

select * from backups where node_name='NODE_NAME'

If there are lots of files, there is a good chance that the above will slow or crash the TSM Server.

Here is another variation of the above select -

select * from backups where node_name='NODE_NAME and filespace_name='/filespace/name' and hl_name='/sub/directory' and ll_name='filename'



Good Luck,
Sias
 
You could avoid long backup table queries by using,

q nodedata to find the volumes used by a node

list the contents of each volume with q content and filter the output for the filename you are interested in.


Remeber though, you may have multiple copies of a singe client file. How do you identify which copy is the one you are looking for?
 
select volume_name,node_name,filespace_name,file_name -
from contents -
where node_name='nodename' -
and filespace_name='filespace' -
and file_name='filename'
 
First find out what is object_id (limit to date range)

select OBJECT_ID,NODE_NAME,FILESPACE_NAME,HL_NAME,LL_NAME,BACKUP_DATE,TYPE from backups where Node_name='NODE_NAME' and date(BACKUP_DATE)>='2017-01-31' and date(BACKUP_DATE)<='2017-02-01'

List object_id volume_name

select * from CONTENTS where OBJECT_ID='685524687' and Node_name='NODE_NAME'
 
Back
Top