none
DPM 2010: How to remove damaged tapes from rotation?

    Question

  • DPM 2010, 2008R2- We have identified 4 damaged tapes in our used tapes.  They all are in our weekly rotations so will end up getting called up again.  How do you mark a tape as damaged/remove a tape from rotation?

    The tapes come up as overdue when it was simply not used. Free tapes were available.
    vendredi 19 avril 2013 18:40

Réponses

  • To remove a tape media from the over due tape report, you can run a SQL script to remove the media from the DPM database.

    To run the script, perform the following steps:

    1)  Open the DPM console and under the reporting tab, double-click the "tape management" report and select the number of weeks you want a report for (up to 4 weeks).
    2)  Once the report opens- go to the page that list Over Due Tapes.
    3)  Make a note of the "Tape labels"  for the tapes you want to remove from the DPM database so they will no longer show up on the report.

    4) Make a backup of the DPMDB Sql database before proceeding using the following command:

         DPMBACKUP -db (The database will be saved in the C:\Program Files\Microsoft DPM\DPM\Volumes\ShadowCopy\Database Backups folder.

    5) Open SQL Enterprise manager and connect to the Server_name\$MS$DPM2007 instance. (For DPMM 2010 connect to MSDPM2010 instance)
    6) Under DATABASES - Highlight the DPMDB entry - then click on "NEW QUERY" button.
    7)  Copy / paste the following SQL script into the new query window.

    ---------- START COPY HERE -------------

    -- overdue tapes
    -- for clarity, set up the parameter as a variable
    declare @paramTapeLabel as nvarchar(256)
    set @paramTapeLabel = N'SAMPLE_TAPE_LABEL_NAME'

    -- keys
    declare @vMediaId as guid
    declare @vGlobalMediaId as guid

    -- if the delete gives trouble, add keyset after cursor
    declare cur_label cursor
    for select MediaId, GlobalMediaId
    from tbl_MM_Media
    where label = @paramTapeLabel;

    open cur_label
    while (0 = 0)
    begin
    fetch next from cur_label into @vMediaId, @vGlobalMediaId
    -- test for being done
    if @@fetch_status <> 0 break;

    print 'Deleting MediaId = ' + cast(@vMediaId as varchar(36))
    -- do a set of deletes atomically
    begin transaction;
    delete from tbl_MM_TapeArchiveMedia
      where MediaId = @vMediaId;

    delete from tbl_MM_MediaMap
      where MediaId = @vMediaId;

    delete from tbl_MM_ArchiveMedia
      where MediaId = @vMediaId;

    delete from tbl_MM_Global_ArchiveMedia
      where MediaId = @vGlobalMediaId;

    delete from tbl_MM_Global_Media
      where MediaId = @vGlobalMediaId;

    delete from tbl_MM_Media
      where current of cur_label;

    commit transaction;

    end
    close cur_label
    deallocate cur_label

    -------------- END COPY HERE ----------------------

    8)  replace the tape label name parameter in the script with the name of the tape label from the over due tape report that you want to delete.
            set @paramTapeLabel = N'SAMPLE_TAPE_LABEL_NAME'      <--- replace tape label between the single quotes ' '

    9) Execute the SQL script.

    10)  Repeat steps 8. and 9. for each tape label that you want to delete.


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Regards, Mike J. [MSFT] This posting is provided "AS IS" with no warranties, and confers no rights.

    vendredi 19 avril 2013 22:50
    Modérateur

Toutes les réponses

  • To remove a tape media from the over due tape report, you can run a SQL script to remove the media from the DPM database.

    To run the script, perform the following steps:

    1)  Open the DPM console and under the reporting tab, double-click the "tape management" report and select the number of weeks you want a report for (up to 4 weeks).
    2)  Once the report opens- go to the page that list Over Due Tapes.
    3)  Make a note of the "Tape labels"  for the tapes you want to remove from the DPM database so they will no longer show up on the report.

    4) Make a backup of the DPMDB Sql database before proceeding using the following command:

         DPMBACKUP -db (The database will be saved in the C:\Program Files\Microsoft DPM\DPM\Volumes\ShadowCopy\Database Backups folder.

    5) Open SQL Enterprise manager and connect to the Server_name\$MS$DPM2007 instance. (For DPMM 2010 connect to MSDPM2010 instance)
    6) Under DATABASES - Highlight the DPMDB entry - then click on "NEW QUERY" button.
    7)  Copy / paste the following SQL script into the new query window.

    ---------- START COPY HERE -------------

    -- overdue tapes
    -- for clarity, set up the parameter as a variable
    declare @paramTapeLabel as nvarchar(256)
    set @paramTapeLabel = N'SAMPLE_TAPE_LABEL_NAME'

    -- keys
    declare @vMediaId as guid
    declare @vGlobalMediaId as guid

    -- if the delete gives trouble, add keyset after cursor
    declare cur_label cursor
    for select MediaId, GlobalMediaId
    from tbl_MM_Media
    where label = @paramTapeLabel;

    open cur_label
    while (0 = 0)
    begin
    fetch next from cur_label into @vMediaId, @vGlobalMediaId
    -- test for being done
    if @@fetch_status <> 0 break;

    print 'Deleting MediaId = ' + cast(@vMediaId as varchar(36))
    -- do a set of deletes atomically
    begin transaction;
    delete from tbl_MM_TapeArchiveMedia
      where MediaId = @vMediaId;

    delete from tbl_MM_MediaMap
      where MediaId = @vMediaId;

    delete from tbl_MM_ArchiveMedia
      where MediaId = @vMediaId;

    delete from tbl_MM_Global_ArchiveMedia
      where MediaId = @vGlobalMediaId;

    delete from tbl_MM_Global_Media
      where MediaId = @vGlobalMediaId;

    delete from tbl_MM_Media
      where current of cur_label;

    commit transaction;

    end
    close cur_label
    deallocate cur_label

    -------------- END COPY HERE ----------------------

    8)  replace the tape label name parameter in the script with the name of the tape label from the over due tape report that you want to delete.
            set @paramTapeLabel = N'SAMPLE_TAPE_LABEL_NAME'      <--- replace tape label between the single quotes ' '

    9) Execute the SQL script.

    10)  Repeat steps 8. and 9. for each tape label that you want to delete.


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Regards, Mike J. [MSFT] This posting is provided "AS IS" with no warranties, and confers no rights.

    vendredi 19 avril 2013 22:50
    Modérateur
  • Thank you Mike.  That did the job perfectly.

    -T

    lundi 22 avril 2013 20:19