none
tape inventories run against nonexistent tape libraries RRS feed

  • Question

  • I accidentally left my DPM server on while working on the fibre channel zoning to let my DPM server see my tape library; as a result, it sees some bogus tape libraries.  I disabled them in the GUI and they don't show up any more, but DPM still tries to inventory the library (which I subsequently named "GhostLibraryThatDoesntExist").

    Device Manager shows exactly one medium changer and exactly one tape drive.


    Here's what PowerShell tells me is there:

    PS C:\sys> Get-DPMLibrary -DPMServerName avamarproxy | select-object UserFriendlyName,IsOffline,IsEnabled | Format-List


    UserFriendlyName : IBM ULTRIUM-TD4 SCSI Sequential Device
    IsOffline        : True
    IsEnabled        : True

    UserFriendlyName : IBM ULTRIUM-TD4 SCSI Sequential Device-3
    IsOffline        : True
    IsEnabled        : False

    UserFriendlyName : GhostLibraryThatDoesntExist
    IsOffline        : True
    IsEnabled        : False

    UserFriendlyName : IBM ULTRIUM-TD4 SCSI Sequential Device-2
    IsOffline        : True
    IsEnabled        : True

    UserFriendlyName : Adic01
    IsOffline        : False
    IsEnabled        : True

    UserFriendlyName : IBM ULTRIUM-TD4 SCSI Sequential Device-4
    IsOffline        : True
    IsEnabled        : True

     

    Adic01 is the only valid device of the bunch.

    I found a similar forum post with a third-party SQL query solution (http://social.technet.microsoft.com/Forums/en-US/dpmtapebackuprecovery/thread/3a2905f1-eefc-4d29-b5ed-2ddeb7c30100) and before I run that I'd like to know whether or not this has been fixed in the year since the post was active.

    Thanks,

    Tom

     

     


    -------- Ask why.
    Monday, July 25, 2011 6:50 PM

Answers

  • Hi,

    You can use this procedure to disable the bogus library and scheduled tape inventory job.

    MAKE A BACKUP OF THE DPMDB BEFORE PROCEEDING:  Run DPMBACKUP -DB

    IN THIS EXAMPLE, WE HAVE ONE LIBRARY WITH FIVE TAPE DRIVES.

    1) Copy the  "SQL script to modify"  found below into notepad.
    2) Open sql management studio.
    3) Open The DPMDB and expand the tables.
    4) Create a NEW QUERY and execute the following Query:


    Select libraryid, GlobalLibraryID from dbo.tbl_MM_Library where isoffline='true'and description = 'TapeLibrary'

    It should return a single row:

     LibraryID                              GlobalLibraryID
     139859e0-f6ab-471a-9dad-f9c13c68f22d   0e867b9c-9f23-4317-88b4-6b437fa0e222


    In the notepad that has the sample sql script:

    - Find, Replace tbl_MM_Library_TAPELIBRARY-ID with LibraryID GUID returned 139859e0-f6ab-471a-9dad-f9c13c68f22d.
    - Find, Replace the tbl_MM_Library_GLOBALLIBRARY-ID with the GlobalLibraryID GUID Returned 0e867b9c-9f23-4317-88b4-6b437fa0e222

     

    5)  Run the following QUERY:   Substituting the LibraryID GUID with the LibraryID GUID returned from the above Query.


    select Driveid from dbo.tbl_MM_drive where libraryid = '139859e0-f6ab-471a-9dad-f9c13c68f22d'

     
      DrIveID
      f634984f-9f3b-48af-87af-1f37c516e9f9
      277e2a0e-2c70-432b-b7dc-2e1a5ff3f218
      6148fdba-1a5e-401a-bac1-484934638408
      61c8c1cf-eb07-4635-bcf3-49b7c3d02f43
      8826ef5a-1f1a-4495-a677-50215e0962b6


    In the notepad that has the sample sql script:

    - Find, replace the dbo.tbl_MM_TapeDrive_DRIVEID-1 with f634984f-9f3b-48af-87af-1f37c516e9f9
    - Find, replace the dbo.tbl_MM_TapeDrive_DRIVEID-2 with 277e2a0e-2c70-432b-b7dc-2e1a5ff3f218
    - Find, replace the dbo.tbl_MM_TapeDrive_DRIVEID-3 with 6148fdba-1a5e-401a-bac1-484934638408
    - Find, replace the dbo.tbl_MM_TapeDrive_DRIVEID-4 with 61c8c1cf-eb07-4635-bcf3-49b7c3d02f43
    - Find, replace the dbo.tbl_MM_TapeDrive_DRIVEID-5 with 8826ef5a-1f1a-4495-a677-50215e0962b6

     

    6) In the notepad that has the sample sql script. REMOVE ANY LINES FOR DRIVES THAT ARE NOT USED and also delete the comments  " <<<remove if not used".


    IE: In a Single drive library, Remove EXTRA values for the following, and remember to remove the "," in the last entry, other wise you will get error "Incorrect syntax near ',' when the script is executed.


        'dbo.tbl_MM_TapeDrive_DRIVEI-DX'


    7) Now copy and paste the resulting script into the query window and execute it.   This should prevent any future inventory jobs from running.


    ============== SCRIPT TO MODIFY =============================

    update dbo.tbl_MM_Library

    Set

    IsEnabled='False',
    IsOffline='True',
    NeedsFastInventory='False'

    where GlobalLibraryId in
    (
    'tbl_MM_Library_GLOBALLIBRARY-ID'

    )

    update dbo.tbl_MM_Drive

    Set

    IsOffline='True'

    where LibraryId in
    (
    'tbl_MM_Library_TAPELIBRARY-ID'
    )

    update dbo.tbl_MM_Slot

    Set

    IsPresent='False'

    where LibraryId in
    (
    'tbl_MM_Library_TAPELIBRARY-ID'
    )

    update dbo.tbl_MM_TapeDrive

    Set

    IsEnabled='False'

    where DriveId in
    (
    'dbo.tbl_MM_TapeDrive_DRIVEID-1', <<<remove comma if only entry.
    'dbo.tbl_MM_TapeDrive_DRIVEID-2', <<<remove if not used or comma if the last entry
    'dbo.tbl_MM_TapeDrive_DRIVEID-3', <<<remove if not used or comma if the last entry
    'dbo.tbl_MM_TapeDrive_DRIVEID-4', <<<remove if not used or comma if the last entry
    'dbo.tbl_MM_TapeDrive_DRIVEID-5' <<<remove if not used or comma if the last entry

    )


    Update tbl_SCH_ScheduleDefinition
    SET IsDeleted = 'True'
    Where jobDefinitionId in
    (
    Select JobDefinitionId from dbo.tbl_JM_JobDefinition
    WHERE (Type = 'bfa93eb9-5bfc-4942-b263-c48f84ee6717')
    AND (IsDeleted = 'False')
    AND (Xml LIKE '%LibraryId="tbl_MM_Library_TAPELIBRARY-ID"%')
    )
    AND isDeleted <> 0

     

    Update dbo.tbl_JM_JobDefinition

    Set

    IsDeleted = 'True'

    WHERE (Type = 'bfa93eb9-5bfc-4942-b263-c48f84ee6717')
    AND (IsDeleted = 'False')
    AND (Xml LIKE '%LibraryId="tbl_MM_Library_TAPELIBRARY-ID"%')


    ================== END OF SCRIPT ============================


    Regards, Mike J. [MSFT] This posting is provided "AS IS" with no warranties, and confers no rights.

    Wednesday, August 3, 2011 2:18 AM
    Moderator

All replies

  • Hi,

    You can use this procedure to disable the bogus library and scheduled tape inventory job.

    MAKE A BACKUP OF THE DPMDB BEFORE PROCEEDING:  Run DPMBACKUP -DB

    IN THIS EXAMPLE, WE HAVE ONE LIBRARY WITH FIVE TAPE DRIVES.

    1) Copy the  "SQL script to modify"  found below into notepad.
    2) Open sql management studio.
    3) Open The DPMDB and expand the tables.
    4) Create a NEW QUERY and execute the following Query:


    Select libraryid, GlobalLibraryID from dbo.tbl_MM_Library where isoffline='true'and description = 'TapeLibrary'

    It should return a single row:

     LibraryID                              GlobalLibraryID
     139859e0-f6ab-471a-9dad-f9c13c68f22d   0e867b9c-9f23-4317-88b4-6b437fa0e222


    In the notepad that has the sample sql script:

    - Find, Replace tbl_MM_Library_TAPELIBRARY-ID with LibraryID GUID returned 139859e0-f6ab-471a-9dad-f9c13c68f22d.
    - Find, Replace the tbl_MM_Library_GLOBALLIBRARY-ID with the GlobalLibraryID GUID Returned 0e867b9c-9f23-4317-88b4-6b437fa0e222

     

    5)  Run the following QUERY:   Substituting the LibraryID GUID with the LibraryID GUID returned from the above Query.


    select Driveid from dbo.tbl_MM_drive where libraryid = '139859e0-f6ab-471a-9dad-f9c13c68f22d'

     
      DrIveID
      f634984f-9f3b-48af-87af-1f37c516e9f9
      277e2a0e-2c70-432b-b7dc-2e1a5ff3f218
      6148fdba-1a5e-401a-bac1-484934638408
      61c8c1cf-eb07-4635-bcf3-49b7c3d02f43
      8826ef5a-1f1a-4495-a677-50215e0962b6


    In the notepad that has the sample sql script:

    - Find, replace the dbo.tbl_MM_TapeDrive_DRIVEID-1 with f634984f-9f3b-48af-87af-1f37c516e9f9
    - Find, replace the dbo.tbl_MM_TapeDrive_DRIVEID-2 with 277e2a0e-2c70-432b-b7dc-2e1a5ff3f218
    - Find, replace the dbo.tbl_MM_TapeDrive_DRIVEID-3 with 6148fdba-1a5e-401a-bac1-484934638408
    - Find, replace the dbo.tbl_MM_TapeDrive_DRIVEID-4 with 61c8c1cf-eb07-4635-bcf3-49b7c3d02f43
    - Find, replace the dbo.tbl_MM_TapeDrive_DRIVEID-5 with 8826ef5a-1f1a-4495-a677-50215e0962b6

     

    6) In the notepad that has the sample sql script. REMOVE ANY LINES FOR DRIVES THAT ARE NOT USED and also delete the comments  " <<<remove if not used".


    IE: In a Single drive library, Remove EXTRA values for the following, and remember to remove the "," in the last entry, other wise you will get error "Incorrect syntax near ',' when the script is executed.


        'dbo.tbl_MM_TapeDrive_DRIVEI-DX'


    7) Now copy and paste the resulting script into the query window and execute it.   This should prevent any future inventory jobs from running.


    ============== SCRIPT TO MODIFY =============================

    update dbo.tbl_MM_Library

    Set

    IsEnabled='False',
    IsOffline='True',
    NeedsFastInventory='False'

    where GlobalLibraryId in
    (
    'tbl_MM_Library_GLOBALLIBRARY-ID'

    )

    update dbo.tbl_MM_Drive

    Set

    IsOffline='True'

    where LibraryId in
    (
    'tbl_MM_Library_TAPELIBRARY-ID'
    )

    update dbo.tbl_MM_Slot

    Set

    IsPresent='False'

    where LibraryId in
    (
    'tbl_MM_Library_TAPELIBRARY-ID'
    )

    update dbo.tbl_MM_TapeDrive

    Set

    IsEnabled='False'

    where DriveId in
    (
    'dbo.tbl_MM_TapeDrive_DRIVEID-1', <<<remove comma if only entry.
    'dbo.tbl_MM_TapeDrive_DRIVEID-2', <<<remove if not used or comma if the last entry
    'dbo.tbl_MM_TapeDrive_DRIVEID-3', <<<remove if not used or comma if the last entry
    'dbo.tbl_MM_TapeDrive_DRIVEID-4', <<<remove if not used or comma if the last entry
    'dbo.tbl_MM_TapeDrive_DRIVEID-5' <<<remove if not used or comma if the last entry

    )


    Update tbl_SCH_ScheduleDefinition
    SET IsDeleted = 'True'
    Where jobDefinitionId in
    (
    Select JobDefinitionId from dbo.tbl_JM_JobDefinition
    WHERE (Type = 'bfa93eb9-5bfc-4942-b263-c48f84ee6717')
    AND (IsDeleted = 'False')
    AND (Xml LIKE '%LibraryId="tbl_MM_Library_TAPELIBRARY-ID"%')
    )
    AND isDeleted <> 0

     

    Update dbo.tbl_JM_JobDefinition

    Set

    IsDeleted = 'True'

    WHERE (Type = 'bfa93eb9-5bfc-4942-b263-c48f84ee6717')
    AND (IsDeleted = 'False')
    AND (Xml LIKE '%LibraryId="tbl_MM_Library_TAPELIBRARY-ID"%')


    ================== END OF SCRIPT ============================


    Regards, Mike J. [MSFT] This posting is provided "AS IS" with no warranties, and confers no rights.

    Wednesday, August 3, 2011 2:18 AM
    Moderator

  • Update tbl_SCH_ScheduleDefinition
    SET IsDeleted = 'True'
    Where jobDefinitionId in
    (
    Select JobDefinitionId from dbo.tbl_JM_JobDefinition
    WHERE (Type = 'bfa93eb9-5bfc-4942-b263-c48f84ee6717')
    AND (IsDeleted = 'False')
    AND (Xml LIKE '%LibraryId="tbl_MM_Library_TAPELIBRARY-ID"%')
    )
    AND isDeleted <> 0

    Update dbo.tbl_JM_JobDefinition

    Set

    IsDeleted = 'True'

    WHERE (Type = 'bfa93eb9-5bfc-4942-b263-c48f84ee6717')
    AND (IsDeleted = 'False')
    AND (Xml LIKE '%LibraryId="tbl_MM_Library_TAPELIBRARY-ID"%')



    Hi Mike,

    I am also experiencing issues after I removed a library from DPM 2012 SP1. I am getting failed inventory jobs every morning.

    I would like to use your script for removing old tape library devices, but I am confused with two lines in your script. Those lines are quoted and marked with bold. Whre do I get this info about Type?

    Thank you for your answer.

    Friday, March 15, 2013 11:34 AM
  • Hi,

    The value 'bfa93eb9-5bfc-4942-b263-c48f84ee6717' is a constant and that is the tape inventory job verb.


    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.

    • Proposed as answer by supaFlaj Monday, March 18, 2013 7:32 AM
    Friday, March 15, 2013 2:31 PM
    Moderator
  • Thank you very much. The script worked and I don't have any inventory failes since.

    Monday, March 18, 2013 7:33 AM
  •  I was looking for a powershell command or script, but this did the job. Thank you very much! This is an annoying problem. It should be easier to clear out old libraries.
    Friday, May 23, 2014 4:59 PM