Recently, I ran into an issue with our DPM 2010 shared tape library installation where several tapes added back to the library where reporting that they belonged to another DPM server sharing the library. I did not care about the data on these tapes, rather, they just needed to be marked as Free in order to be re-used. I logged into each of our DPM servers trying to find the server that owned the tape, but all of them reported the same error.
I tried performing erase operations, re-cataloging the tapes, identifying the unknown tapes, using the ForceTapeFree script , and external erase operations but DPM did not want to free it’s grip. Finally, I surmised that it must be something in the DPMDB rather than actual data on the tape.
It turns out that the media had been assoicated with an orphaned Media Pool. To correct this, I used the following DB queries.
First, I needed to locate the proper information about the tape. This query will give you the slot and barcode number which should allow you to find the piece of media you need to correct. You’ll want the GlobalMediaId field from this query:
select media.BarcodeValue, media.SlotNum, media.MediaId, gmedia.MediaPoolId
from tbl_MM_Global_ArchiveMedia gmedia
innerjoin tbl_MM_Media media
on gmedia.MediaId = media.GlobalMediaId
Next, you’ll want to find the appropriate “Free Media Pool” for your library. You can do this with the following query:
select library.ProductId, library.SerialNo, library.LibraryId, mpool.Name, mpool.MediaPoolId, mpool.GlobalMediaPoolId
from tbl_MM_MediaPool mpool
innerjoin tbl_MM_Library library
on mpool.LibraryId = library.LibraryId
where mpool.Name =‘Free Media Pool’
You’ll want the GlobalMediaPoolId GUID from that query. We then need to update the media with the proper MediaPoolId:
declare @GlobalMediaId asvarchar
declare @GlobalMediaPoolId asvarchar
set @GlobalMediaId =‘<GUID from query 1>’
set @GlobalMediaPoolId =‘<GUID from query 2>’
set MediaPoolId = @GlobalMediaPoolId
where MediaId = @GlobalMediaId
Lastly, perform a refresh in the DPM Console. Your tapes should now be marked as Free.