Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

You cannot eject a tape by using a tape device button after you run a SQL Server 2008-based maintenance plan that backs up databases onto the tape device


View products that this article applies to.

Symptoms

After you run a Microsoft SQL Server 2008-based maintenance plan that backs up databases onto a tape, you cannot eject the tape by using a button on the tape device. However, the tape ejects if you follow these steps: 
  1. You create a backup device that links to the tape device by using SQL Server Management Studio.
  2. In the Back Up Database - <Database Name> dialog box, you click Contents for the backup device.

↑ Back to the top


Cause

This issue occurs because the maintenance plan uses the NOREWIND option in the backup command. When the NOREWIND option is used in the command, the instance of SQL Server keeps ownership of the tape device until one of the following conditions is true:
  • You run a BACKUP or RESTORE statement that is running in the same process and that uses either the REWIND or UNLOAD option.
  • The instance of SQL Server shuts down.
The following is an example of the BACKUP command in the maintenance plan:
BACKUP DATABASE <Database Name> TO TAPE = N'\\.\Tape0' WITH NOFORMAT, INIT, NAME = N'<Backup Set Name>', SKIP, NOREWIND, NOUNLOAD, STATS = 10

↑ Back to the top


Resolution

To resolve this issue, add a task that runs a RESTORE LABELONLY statement to the maintenance plan so that the task runs after the database backup task. For example, add a task that runs the following statements in the maintenance plan:
RESTORE LABELONLY FROM TAPE = '\\.\Tape0' WITH NOUNLOAD GO

↑ Back to the top


Status

This behavior is by design.

The maintenance plan assumes that the job is fully automated and that you do not want to eject the tape when the tape is not full.  


↑ Back to the top


Keywords: kb, kbexpertiseadvanced, kbsurveynew, kbtshoot, kbprb

↑ Back to the top

Article Info
Article ID : 2494271
Revision : 3
Created on : 11/20/2019
Published on : 11/20/2019
Exists online : False
Views : 210