DPM 2012, ghost tapes in weekly report RRS feed

  • Question

  • Hi, every week i have new weekly report.

    But there are 6 tapes with filled "Label" and  no barcodes.

    Is it possible to remove them?


    Exported report looks perfect while in PDF. But it dosen't fit to pages! Edges are moved to second page.

    So we print not 5 pages but twice more, 5 of them going to trashbin immidialty. Bug goes through any export format.

    Monday, June 17, 2013 8:16 AM

All replies

  • Hi

    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\MSDPM2012 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.

    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.

     IE:   set @paramTapeLabel = N'SAMPLE_TAPE_LABEL_NAME' <--- replace tape label between the single quotes ' '

    ---------- 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' --- replace tape label between the single quotes ' '

    -- 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)
    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;

    close cur_label
    deallocate cur_label

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

     9) Execute the SQL script.

    10) Repeat for each tape you want removed from the report

    Should something go terribly wrong, you can restore the dpmdb.bak using dpmsync.exe utility.

    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.

    Saturday, June 22, 2013 3:34 PM