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