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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question (pulling data out of the media database)

Status
Not open for further replies.

Chapter11

Technical User
Apr 15, 2002
791
US
I'm trying to write a script that will pull out all related savesets (of the same series) for a given ssid, or more accurately, all tapes that are potentially touched by a given tape.

For example, for a given tape, I can pull the ssid list for it. With that ssid list, I can determine what other tapes are related to those ssids (in particular for headers, middles, and tails of individual savesets).

I can also acquire the pssid (previous ssid) for savesets that are part of a series, and using that, follow the series all the way back to the beginning.

What I need to figure out, if there's an easy way, how to find the *following* savesets of a series assuming I know the ssid of the first (or middle).

Has anyone scripted out a solution to this?
 
Try the following:

# mminfo -ono -av -q 'ssid=<ssid> -r 'ssid,volume(20),ssflags(8),fragflags(5),mediafile(11),mediarec(11)'

This will query the media database for the saveset id ssid, and will produce a report for saveset id, volume name,saveset flags, fragment flags, file number, and record number. It will be ordered by saveset id, then file and record number.

This should tell you the what order the tapes were used when backing up a saveset.

Your post was a bit confusing, but I hope this gives you a hint for what you want to do.
 
(your command didn't meet my goal)

Well, more clearly stating my goal:

I want to clear off a tape.

It's easy to get the list of savesets on the tape, and for savesets that are not wholly on that tape, it's easy to find what other tapes the other parts of the saveset are on.

The problem comes when the tape contains part of a save set *series* - which is how Networker dealt with data sets greater than 2G in size before version 6.

If the tape in question has the &lt;8&gt; slice of a 20-slice saveset series, I need to find all of the other slices in order to migrate that one slice off that tape.

Now, give the ssid of slice 8, I can track back to the first slice, using the pssid field in the media database. I was hoping there was an equivalent &quot;nssid&quot; (next-ssid) but there isn't.

I did have a brainfart over the weekend, and figured out that given a particular ssid X, I can search and find a saveset that has pssid X, and continue walking that until I get no reasons from mminfo. The ugliness is that it appears that pssid isn't an indexed field, so walking through finding all slices of a 20-slice saveset takes a goodly amount of time.
 
Going off on a bit of a tangent - but how are you 'clearing' the tape ?
nsrstage does all this for you - I use it regularly to clear down mostly expired media
 
Yes, I use nsrstage to clear the data off the tape.

The problem is that with tapes that have partial savesets (such as head, middle, or tails) and not all of the slices of a saveset series (>2G pre 6.x), I need to know what other tapes to recall and load in my silo for the nsrstage to be successful.

For example, if I'm clearing off N00005, that tape contains savesets that have continuations on several other tapes. I need to find out what those other tapes are. You can't nsrstage a saveset (successfully) unless you have all of its pieces available. That's easy enough for most situations, but when the tape contains one (or more, but not all) slice of a saveset series, it becomes trickier.

I've got a script that does it now, and I would consider posting it, but it's actually a series of scripts with some dependencies somewhat unique to my environment.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top