Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Locate a file 2

Status
Not open for further replies.

mariocq

MIS
Apr 20, 2001
61
US
Hi all,

Is possible locate in which tape is a file stored?

Regards.
 
Hi!
One way to do it is:

select VOLUME_NAME,FILESPACE_NAME, FILE_NAME from contents where VOLUME_NAME='tape1' and FILESPACE_NAME='\\hostname\c$' and FILE_NAME='\ filename'

pls note that thisis for a windows client and that the space after \ in the file name is intentional.
You will have to run this once for all tapes. Do not try to run it for all tapes at once, this will be very slow.
Good Luck
/regards Daniel

 
Try to restore the file to a temp dir. TSM will mount the volume (or ask for the volume to be mounted) which contains the file.


HTH,

p5wizard
 
That was a neat solution. ;)
I really have to get intouch with reality, to much SQL
is bad for your brain :cool:

/daniel
 
Hi all,

Anyway I prefer the solution of hogmaster01. I need to restoer a lot of files. If I know in which tape are stored the files before launching the restore I can optimize the process selecting files in different tapes.

regards,
oiram.
 
One more thing, is any SQL sentence to locate a specific version of a file in a tape? or to see the dates of the files stored in a tape?
 
Hmm... (thinking)
I don't think there is a mapping like that in the sql
interface. Maybe you can try select * from volumeusage where node_name=node_name this will give a list of all volumes that contain node_name data but not any file information.

If you want to restore all files from a certain date you can use:
export node node_name filedata=backup fromdate=date preview=yes
This will give a list in the actlog containing the volumes that contain your files.


If you want to prepare for a restore adn your data is not collocated you can use move nodedata node_name fromstg=tape_pool tostg=tapepool this will help unless it is a very large server. :)

I really can't think of a way to produce this data in a straight forward way :(

/Regards Daniel



 
I had contacted IBM over this same issue this is the response:


Hello,
you will need a combination of commands. The first part is to
identify the "object id" of the file you want to restore. You can
obtain this object id with the select command. Once you have the
object_id, you can use the "show bfo" command to find out on which
volume(s) it is stored.
For example, assume that I have backed a file named TEST1.TXT from
my C: (filespace=\\rlarivee\c$) and I use node name = LARIVEE,
I would use the following select command :
.
-> select * from backups where node_name='LARIVEE' and -
filespace_name='\\rlarivee\c$' and ll_name='TEST1.TXT'
.
which returns the following output (in my case):
.
ANR2963W This SQL query may produce a very large result table, or may
require a significant amount of time to compute.
.
Do you wish to proceed? (Yes (Y)/No (N)) y
.
NODE_NAME: LARIVEE
FILESPACE_NAME: \\rlarivee\c$
FILESPACE_ID: 112
STATE: ACTIVE_VERSION
TYPE: FILE
HL_NAME: \TEST\
LL_NAME: TEST1.TXT
OBJECT_ID: 248854
BACKUP_DATE: 2005-11-12 20:04:21.000000
DEACTIVATE_DATE:
OWNER:
CLASS_NAME: DEFAULT
.
In the above output, you can see that the object id for file TEST1.TXT
is "248854".
Now that I have this object id, I use the following show command :
-> show bfo 0 248854
.
which returns the following output (in my case):
.
tsm: LARIVEE_SERVER1>show bfo 0 248854
?Bitfile Object: 0.248854?**Sub-bitfile 0.248854 is stored in the
following aggregate(s)
Super-bitfile: 0.248853, Offset: 0.703, Length 0.668
.
The above ouptut shows that my file is stored in aggreate 0.248853
and so I must do an additional show command as follow :
-> show bfo 0 248853 (remove the period)
.
which returns the following output (in my case):
.
tsm: LARIVEE_SERVER1>show bfo 0 248853
?Bitfile Object: 0.248853?**Super-bitfile 0.248853 contains following
aggregated bitfiles
0.248853
0.248854
.
**Sub-bitfile 0.248853 is stored in the following aggregate(s)
Super-bitfile: 0.248853, Offset: 0.0, Length 0.703
.
**Archival Bitfile Entry
Bitfile Type: PRIMARY Storage Format: 5
Bitfile Size: 0.1435 Number of Segments: 1
Storage Pool ID: 14 Volume ID: 705 Volume Name:
C:\TSMDATA\FILE\000002C1.BFS
.
and this output shows that my file TEST1.TXT is actually stored on
volume C:\TSMDATA\FILE\000002C1.BFS.
.
The above example uses FILE type of volumes for example but this is
the same thing for TAPE volumes.
.
Let me know if you have more questions and if there is anything I can
do to make sure you are very satisfied with this issue.
Have a great day. Rejean Larivee.

Hello,
You can refine the select command quite easily by filtering the
backup_date (for backups) or archive_date (for archives). For example:
.
select * from archives where node_name='TESTNODE' and
archive_date between '2005-11-01' and '2005-11-02' and ll_name=...
.
select * from backups where node_name='TESTNODE' and
backup_date between '2005-11-04' and '2005-11-06' and ll_name=...
.
The first command will query the archives for files archived between
'2005-11-01' and '2005-11-02' while the second select command will
query the backups for files backed up between '2005-11-04' and
'2005-11-06'. So depending on if you backing up or archiving the files,
you would use of of the commands, with your own parameters.
.
Let me know if you need further assistance. Regards, Rejean.
========================================================================
action plan : Waiting for customer to update, follow up next week.
 
Thanks Xenocide, this is exactly what I was looking for. Keep contact with Rejean as it seems that he knows what he is talking about.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top