none
How can I export a tape for use in another DPM 2010 instance RRS feed

  • Question

  • I have some expired OVERDUE tapes. I want to remove them from one DPM server and use them in another one. Is there a way to tell one instance of DPM that the tape has been taken away so that it no longer needs to keep track of it whatsoever. Thanks for any help on this. HP at VSB


    Herb Peters
    • Moved by MarcReynolds Thursday, May 5, 2011 12:10 PM (From:Data Protection Manager)
    Wednesday, May 4, 2011 11:19 PM

Answers

  • 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 or MSDPM2010 instance depending on the version of DPM you are running.
    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.

    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'

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


    9) Execute the SQL script, and it should return something like the following, the GUIDS will vary.

         Deleting MediaId = F159166D-6B59-4BC6-8E0D-D0EE1EB5085A

         (1 row(s) affected)

         (1 row(s) affected)

         (1 row(s) affected)
         Deleting GlobalMediaId = 2F78C188-508E-4F44-BBEA-1660357F6ADD

         (1 row(s) affected)

         (1 row(s) affected)

         (1 row(s) affected)

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


    Regards, Mike J. [MSFT] This posting is provided "AS IS" with no warranties, and confers no rights.
    Thursday, May 5, 2011 12:22 AM
    Moderator

All replies

  • 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 or MSDPM2010 instance depending on the version of DPM you are running.
    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.

    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'

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


    9) Execute the SQL script, and it should return something like the following, the GUIDS will vary.

         Deleting MediaId = F159166D-6B59-4BC6-8E0D-D0EE1EB5085A

         (1 row(s) affected)

         (1 row(s) affected)

         (1 row(s) affected)
         Deleting GlobalMediaId = 2F78C188-508E-4F44-BBEA-1660357F6ADD

         (1 row(s) affected)

         (1 row(s) affected)

         (1 row(s) affected)

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


    Regards, Mike J. [MSFT] This posting is provided "AS IS" with no warranties, and confers no rights.
    Thursday, May 5, 2011 12:22 AM
    Moderator
  • Hi Mike:

    Thanks very much for posting that information.

    HP


    Herb Peters
    Thursday, May 5, 2011 4:56 PM
  • Warning!!!

    thrue this Script your DPMDB will be not consistent while there is othes connections from tbl_MM_ArchiveMedia to tbl_ARM_Dataset. As result you cannot Recovery anything (GUI crashed).

    Part from Crash-Log:

    WARNING No Media Map found for the given dataset

    WARNING    at Microsoft.Internal.EnterpriseStorage.Dls.UI.ObjectModel.OMCommon.ARMDataset.GetMediaMapForDataset

    WARNING Caught unhandled exception :

    System.Management.Automation.CmdletInvocationException: Exception has been thrown by the target of an invocation

    Only DPMDB-Recovery will help - with consequences..

    Max

    Friday, March 2, 2012 11:57 AM