none
Single Tape Drive Backups RRS feed

  • Question

  • We have an 8 tape library with 1 drive, and we would like to do monthly backups to tape on the 1st of each month, however even with a simple Long-Term goal of only 'Every 1 month, retain for 36 months' (for 3 years worth of monthlies), the PG configuration wizard states we need to have two or more tape drives. This is with copies set to 1. I read a few other posts that said this should not be the case:

    http://social.technet.microsoft.com/Forums/en-NZ/dpmtapebackuprecovery/thread/0b9e052c-d8da-4a3f-9076-00ac6de4a0d9

    Says that the warning should show up when you have multiple tape retention ranges... we just have the "once a month for 36 months". Also, the tape backups don't 'fail' under this configuration, they appear to just never be attempted. I'm not sure if this is the intended failure mode if you 'need' two tape drives and only have one, but I don't see any scheduled jobs for tape backups if I set them for today (or do they just say 'Recovery Point' like the other jobs)?

    In addition, this post has a script that is meant to 'trigger' a tape backup, but it just returns an error for us. "Invoke-Sqlcmd : Supply either @job_id or @job_name to identify the job." which is actually a SQL error, not DPM error.

    http://social.technet.microsoft.com/Forums/en-US/dpmtapebackuprecovery/thread/92e2bd66-d9cb-454b-83e2-455dd077c8b3

    Tuesday, March 6, 2012 6:07 PM

Answers

  • Hi,

    This DPM powershell script will prompt for the protection group name, then prompt for shorterm or longterm tape job. Once selected, it will backup all datasources in that PG to tape using the goal selected.

    # prompts for protection group name and Shortterm ot longterm backup type
    # Will backup PG to tape and if verify is set on the PG the verify will run.
    disconnect-dpmserver (&hostname)
    connect-dpmserver (&hostname)
    param([string] $pgname, [string] $protectiontype) 
    cls
    if(!$pgname)
    {
        $pgname =  read-host "Protection Group Name"
    }
    if(!$protectiontype)
    {
        $protectiontype =  read-host "Select Tape Protection type to run (Longterm or Shortterm)"
    }
    	write-host "`nGetting protection group $pgname in $(&hostname)..." 
    		$clipg = Get-ProtectionGroup (&hostname) | where { $_.FriendlyName -eq $pgname}
    	
    		if($clipg -eq $abc)
    		{
    			Throw "No PG found"
    		}
    	
    		write-Output "Getting DS from PG $pgname..." 
    		$backupds = @(Get-Datasource $clipg)
    		foreach ($ds in $backupds)
    		{  
    			write-host
    			write-host "Creating Recovery point for $ds" -foreground yellow  
    			$j = New-RecoveryPoint -Datasource $ds -Tape -ProtectionType $protectiontype
    			$jobtype = $j.jobtype
    			Write-Output "$jobtype Job has been triggerred..." 
    			write-host "Waiting for $jobtype job to complete" -nonewline
    			while (! $j.hascompleted ){ write-host "." -nonewline; start-sleep 5}
    			write-host
    			if ($j.status -eq "Succeeded") 
    			{
    				Write-host "Job $Jobtype completed successfully..."
    				$rp  = @(get-recoverypoint $ds | ? { $_.datalocation -eq 'Media'})
    				$rpl = get-recoverypointlocation $rp[$rp.count-1]
    				$gt  = get-tape -recoverypointlocation $rpl
    	  			$gtt += $gt
    				
    			}
    		
    }


    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.

    • Marked as answer by ITJM1 Thursday, March 8, 2012 12:00 AM
    Wednesday, March 7, 2012 11:49 PM
    Moderator

All replies

  • Hi,

    You should not need more than a single drive for a single long term recovery goal.  If you scheduled the monthly backup goal today, it may not run until next month.  This is covered in the following technet article.  For DPM 2010, I would schedule it > 48hrs to be sure.

    Modify Long-Term Backup Schedule
    http://technet.microsoft.com/en-us/library/bb809001.aspx

    If you schedule a monthly backup within 24 hours from the current time and date, then the first backup will happen the next month on the specified day.

    • Example:

      • If on Jan 10 3:00 P.M. you schedule a monthly backup to run on the 11th day of the month at 10:00 A.M., then the first backup will happen on Feb 11 10:00 A.M. and then every month thereafter.

     


    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.

    Wednesday, March 7, 2012 2:49 AM
    Moderator
  • Sorry, I didn't mention it in my previous post, but I did try something more than 48 hours away. It was March 2nd (Friday) and I set it to run on the first Monday of every month (which would be March 5th), but it still did not run, nor present any errors.

    If it does not require more than one tape drive, why does it say "Ensure you have two or more tape drives"? Or does it always display that message? Other posts gave me the impression that the message only shows up depending on backup configuration.

    EDIT: Just to be clear, here are the long-term settings that are resulting in the "Need two drives" warning on the wizard.


    • Edited by ITJM1 Wednesday, March 7, 2012 7:57 PM
    Wednesday, March 7, 2012 7:51 PM
  • Hi,

    The warning is displayed anytime you only have a single tape drive in the library.   If you right-click the data source and choose Create recovery point, long term tape protection, that should kick off a tape backup.  also, if the tape backup is scheduled to run within the next 7 days, you can create a custom job filter and slect only "tape backup" job and it should be listed.


    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.

    Wednesday, March 7, 2012 10:01 PM
    Moderator
  • I wasn't aware you could 'force' tape backups that way. Thanks for that info. Is there a way to do that for a whole Protection Group, though? I need to make the first archive backup of this protection group soon, and I can't wait 48+ hours between each attempt at getting DPM to back up to tape.

    I set the tape backup to run on the 12th of each month (5 days from this), and made the custom filter to look at all tape backups for the next 7 days (From 'Today' to '7 days from today') and it has not scheduled the tape backup job. All I see is the job I forced using the method you mentioned with 'Create recovery point'.

    • Edited by ITJM1 Wednesday, March 7, 2012 11:27 PM
    Wednesday, March 7, 2012 11:10 PM
  • Hi,

    This DPM powershell script will prompt for the protection group name, then prompt for shorterm or longterm tape job. Once selected, it will backup all datasources in that PG to tape using the goal selected.

    # prompts for protection group name and Shortterm ot longterm backup type
    # Will backup PG to tape and if verify is set on the PG the verify will run.
    disconnect-dpmserver (&hostname)
    connect-dpmserver (&hostname)
    param([string] $pgname, [string] $protectiontype) 
    cls
    if(!$pgname)
    {
        $pgname =  read-host "Protection Group Name"
    }
    if(!$protectiontype)
    {
        $protectiontype =  read-host "Select Tape Protection type to run (Longterm or Shortterm)"
    }
    	write-host "`nGetting protection group $pgname in $(&hostname)..." 
    		$clipg = Get-ProtectionGroup (&hostname) | where { $_.FriendlyName -eq $pgname}
    	
    		if($clipg -eq $abc)
    		{
    			Throw "No PG found"
    		}
    	
    		write-Output "Getting DS from PG $pgname..." 
    		$backupds = @(Get-Datasource $clipg)
    		foreach ($ds in $backupds)
    		{  
    			write-host
    			write-host "Creating Recovery point for $ds" -foreground yellow  
    			$j = New-RecoveryPoint -Datasource $ds -Tape -ProtectionType $protectiontype
    			$jobtype = $j.jobtype
    			Write-Output "$jobtype Job has been triggerred..." 
    			write-host "Waiting for $jobtype job to complete" -nonewline
    			while (! $j.hascompleted ){ write-host "." -nonewline; start-sleep 5}
    			write-host
    			if ($j.status -eq "Succeeded") 
    			{
    				Write-host "Job $Jobtype completed successfully..."
    				$rp  = @(get-recoverypoint $ds | ? { $_.datalocation -eq 'Media'})
    				$rpl = get-recoverypointlocation $rp[$rp.count-1]
    				$gt  = get-tape -recoverypointlocation $rpl
    	  			$gtt += $gt
    				
    			}
    		
    }


    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.

    • Marked as answer by ITJM1 Thursday, March 8, 2012 12:00 AM
    Wednesday, March 7, 2012 11:49 PM
    Moderator
  • Went ahead and marked that as the answer, because it's a viable workaround.

    It still does not schedule tapes in DPM though. I have set the tape backup to occur in 5 days, and the only thing a filter from now until the 14th shows is several inventory jobs on the 8th and 9th. No jobs of any kind after that (not even inventory on 10th, 11th, etc).

    Thursday, March 8, 2012 12:01 AM
  • # This script will list all currently scheduled backup to tape jobs
    # It will list scheduled, last run and next run dates.

    For optimun output, set PoweShell Width for screen buffer size to at least 200

    # This version of the script was only tested on DPM 2010                                       #
    #                                                                                              #
    ################################################################################################
    param([string] $verbose)
    add-pssnapin sqlservercmdletsnapin100
    Add-PSSnapin -Name Microsoft.DataProtectionManager.PowerShell
    $ConfirmPreference = 'None'
    cls
    $instance = '.\msdpm2010'  # <---- If DPM Database is on a different location, edit this line accordinly
    $query = "use DPMDB
    go
    CREATE FUNCTION label (@GUID varchar(36), @kindred varchar(4), @vault varchar(8))
    returns varchar (1024)
    as
    Begin
       declare @result varchar (1024)
       select @result = vaUltlabel from tbl_mm_vaultlabel where mediapoolid = @GUID and generation = 
          case  @kindred
              when 'Fath' Then '2'
              when 'Gran' then '1'
              when 'grea' Then '0'
          end and
          vault =
          case @vault
    		  when 'Offsite1' then '3'
    		  when 'Offsite2' then '4'
    		  when 'Offsite3' then '5'
    		  when 'Offsite4' then '6'
    		  when 'Offsite5' then '7'
    		  when 'Offsite6' then '8'
    		  when 'Offsite7' then '9'
    	  else
    	      '1'
    	  end
       RETURN @result
    END
    go
     
    use DPMDB
    select ScheduleId as name
           ,def.JobDefinitionId as JD
           ,FriendlyName as PG
           ,SUBSTRING (CONVERT(VARCHAR(10),active_start_date),5,2) + '-' + SUBSTRING (CONVERT(VARCHAR(10),active_start_date),7,2) + '-' + SUBSTRING (CONVERT(VARCHAR(10),active_start_date),1,4) as SD
           ,jobs.date_created as SCD
           ,SUBSTRING (CONVERT(VARCHAR(10),last_run_date),5,2) + '-' + SUBSTRING (CONVERT(VARCHAR(10),last_run_date),7,2) + '-' + SUBSTRING (CONVERT(VARCHAR(10),last_run_date),1,4) + '  ' +
            SUBSTRING (CONVERT(VARCHAR(6),last_run_time),1,2) + ':' + SUBSTRING (CONVERT(VARCHAR(6),last_run_time),3,2) + ':' + SUBSTRING (CONVERT(VARCHAR(6),last_run_time),5,2) as LRD
           ,SUBSTRING (CONVERT(VARCHAR(10),next_run_date),5,2) + '-' + SUBSTRING (CONVERT(VARCHAR(10),next_run_date),7,2) + '-' + SUBSTRING (CONVERT(VARCHAR(10),next_run_date),1,4) + '  ' +
            SUBSTRING (CONVERT(VARCHAR(6),next_run_time),1,2) + ':' + SUBSTRING (CONVERT(VARCHAR(6),next_run_time),3,2) + ':' + SUBSTRING (CONVERT(VARCHAR(6),next_run_time),5,2) as NRD
           ,dbo.label ((substring(xml,(patindex('%MediaPoolId%',Xml))+13,36)), (substring(xml,(patindex('%generation%',Xml))+12,4)), (substring(xml,(patindex('%vault%',Xml))+7,8))) as TL
           ,case 
    			when substring(xml,(patindex('%vault%',Xml))+7,3) = 'off'  then 'Long-Term' 
    			else 'Short-term'
           end as STLT
           ,case
    		when substring(xml,(patindex('%generation%',Xml))+12,4) = 'Fath' then 'Recovery Goal 1'
    		when substring(xml,(patindex('%generation%',Xml))+12,4) = 'Gran' then 'Recovery Goal 2'
    		when substring(xml,(patindex('%generation%',Xml))+12,4) = 'Grea' then 'Recovery Goal 3'
    	end as RG
    from    tbl_SCH_ScheduleDefinition sch 
           ,msdb.dbo.sysjobs jobs
           ,tbl_JM_JobDefinition def
           ,DPMDB.dbo.tbl_IM_ProtectedGroup prot
           ,msdb.dbo.sysjobschedules jobsch
           ,msdb.dbo.sysjobsteps jobsteps
           ,msdb.dbo.sysschedules syssch
    where CAST(sch.ScheduleId as NCHAR (128)) = jobs.name
    and def.JobDefinitionId = sch.JobDefinitionId
    and def.ProtectedGroupId = prot.ProtectedGroupId
    and jobs.job_id = jobsch.job_id
    and jobs.job_id = jobsteps.job_id
    and jobsch.schedule_id = syssch.schedule_id
    and (def.Type = '913afd2d-ed74-47bd-b7ea-d42055e5c2f1' or def.Type = 'B5A3D25C-8EB2-4032-9428-C852DA5CE2C5')
    and sch.IsDeleted = '0' and def.ProtectedGroupId is not null
    order by FriendlyName, next_run_date, next_run_time
    go
     
    drop function label
    go"
    $result = Invoke-Sqlcmd -ServerInstance $instance -Query $query
    $count = 1
    write-host " The list below shows all scheduled backup to tape jobs (short term and long term)" -f green
    write-host
    if ($verbose.ToLower() -eq '')
    {
    	write-host " For optimun output, set PoweShell Width for screen buffer size to at least 200" -f yellow; write-host
    	write-host
    	write-host "     Protection Group name          Creation Date [Schedule Creation Date] [Last Run Date / time]   [Next Sched Run Date/time]  Goal type  Recovery Goal # Custom Tape Label"
    	write-host "     ------------------------------ ------------- ------------------------ ----------------------   --------------------------  ---------- --------------- -----------------" 
    	foreach ($result1 in $result)
    	{
    		if ($color -eq 'white') {$color = 'cyan'} else {$color = 'white'}
    		write-host ("{0,2}"-f $count) -foreground green -nonewline
    		write-host ( " - {0,-30} {1,-13} {2,-24} {3,-24} {4,-27} {5,-10} {6,15} " -f $result1.PG, $result1.SD, $result1.SCD, $result1.LRD, $result1.NRD, $result1.STLT, $result1.RG) -nonewline -f $color
    		write-host $result1.TL -f yellow
    		$count++
    	}
    }
    else
    {
    	write-host " For optimun output, set PoweShell Width for screen buffer size  to at least 110" -f yellow; write-host
    	write-host "     Protection Group               Term       Goal            Tape Label"
    	write-host "     ------------------------------ ---------- --------------- --------------" 
    	foreach ($result1 in $result)
    	{
    		if ($color -eq 'white') {$color = 'cyan'} else {$color = 'white'}
    		write-host ("{0,2}"-f $count) -foreground green -nonewline
    		write-host ( " - {0,-30} {1,-10} {2,15} " -f $result1.PG, $result1.STLT, $result1.RG) -nonewline -f $color
    		write-host $result1.TL -f yellow
    		$count++
    	}
    }


    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.

    Thursday, March 8, 2012 12:31 AM
    Moderator
  • That does show it as scheduled, even though the in-GUI filter does not. Thank you for all your help!
    Thursday, March 8, 2012 3:33 PM
  • Hi,

    You are welcome.

    Please share your thoughts on what you woud like to see improved for tape management:

    How can Tape management be improved?
    http://social.technet.microsoft.com/Forums/en-US/dpmtapebackuprecovery/thread/21491981-53e7-4538-817c-891a82836045


    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.

    Thursday, March 8, 2012 4:26 PM
    Moderator