为磁带机定义逻辑备份设备 (SQL Server)Define a Logical Backup Device for a Tape Drive (SQL Server)

适用对象:是SQL Server 否Azure SQL 数据库 否Azure Synapse Analytics (SQL DW) 否并行数据仓库 APPLIES TO: yesSQL Server noAzure SQL Database noAzure Synapse Analytics (SQL DW) noParallel Data Warehouse

本主题说明如何使用 SQL Server 2019 (15.x)SQL Server 2019 (15.x)SQL Server Management StudioSQL Server Management StudioTransact-SQLTransact-SQL中为磁带机定义逻辑备份设备。This topic describes how to define a logical backup device for a tape drive in SQL Server 2019 (15.x)SQL Server 2019 (15.x) by using SQL Server Management StudioSQL Server Management Studio or Transact-SQLTransact-SQL. 逻辑设备是指向特定物理备份设备(磁盘文件或磁带机)的用户定义名称。A logical device is a user-defined name that points to a specific physical backup device (a disk file or tape drive). 将备份写入备份设备后,便会初始化物理设备。The initialization of the physical device occurs later, when a backup is written to the backup device.

备注

SQL ServerSQL Server的未来版本中将不再支持磁带备份设备。Support for tape backup devices will be removed in a future version of SQL ServerSQL Server. 请避免在新的开发工作中使用该功能,并着手修改当前还在使用该功能的应用程序。Avoid using this feature in new development work, and plan to modify applications that currently use this feature.

本主题内容In This Topic

开始之前Before You Begin

限制和局限Limitations and Restrictions

  • Microsoft Windows 操作系统必须支持磁带机。The tape drive or drives must be supported by the Microsoft Windows operating system.

  • 磁带设备必须物理连接到运行 SQL ServerSQL Server实例的计算机上。The tape device must be connected physically to the computer that is running an instance of SQL ServerSQL Server. 不支持备份到远程磁带设备上。Backing up to remote tape devices is not supported.

SecuritySecurity

权限Permissions

要求具有 diskadmin 固定服务器角色中的成员身份。Requires membership in the diskadmin fixed server role.

要求拥有写入磁盘的权限。Requires permission to write to the disk.

使用 SQL Server Management StudioUsing SQL Server Management Studio

为磁带机定义逻辑备份设备To define a logical backup device for a tape drive

  1. 连接到相应的 MicrosoftMicrosoft SQL Server 数据库引擎SQL Server Database Engine 实例之后,在“对象资源管理器”中,单击服务器名称以展开服务器树。After connecting to the appropriate instance of the MicrosoftMicrosoft SQL Server 数据库引擎SQL Server Database Engine, in Object Explorer, click the server name to expand the server tree.

  2. 展开“服务器对象” ,然后右键单击“备份设备” 。Expand Server Objects, and then right-click Backup Devices.

  3. 单击 “新建备份设备” 打开 “备份设备” 对话框。Click New Backup Device, which opens the Backup Device dialog box.

  4. 输入设备名称。Enter a device name.

  5. 为了确定要使用的备份设备,请单击 “磁带” ,然后选择一个未与其他备份设备相关联的磁带设备。For the destination, click Tape and select a tape drive that is not already associated with another backup device. 如果没有这种磁带机,则 “磁带” 选项处于非活动状态。If no such tape drives are available, the Tape option is inactive.

  6. 若要定义新设备,请单击 “确定”To define the new device, click OK.

若要备份至此新设备,请将该设备添加到“备份数据库” (“常规” )对话框中的“备份到:” 字段。To back up to this new device, add it to the Back up to: field in the Back up Database (General) dialog box. 有关详细信息,请参阅 创建完整数据库备份 (SQL Server)中创建差异数据库备份。For more information, see Create a Full Database Backup (SQL Server).

使用 Transact-SQLUsing Transact-SQL

为磁带机定义逻辑备份设备To define a logical backup device for a tape drive

  1. 连接到 数据库引擎Database EngineConnect to the 数据库引擎Database Engine.

  2. 在标准菜单栏上,单击 “新建查询”From the Standard bar, click New Query.

  3. 将以下示例复制并粘贴到查询窗口中,然后单击“执行” 。Copy and paste the following example into the query window and click Execute. 此示例说明如何使用 sp_addumpdevice 为磁带定义逻辑备份设备。This example shows how to use sp_addumpdevice to define a logical backup device for a tape. 下面的示例以物理名称 tapedump1添加名为 \\.\tape0的磁带备份设备。The example adds the tape backup device named tapedump1, with the physical name \\.\tape0.

USE AdventureWorks2012 ;  
GO  
EXEC sp_addumpdevice 'tape', 'tapedump1', '\\.\tape0' ;  
GO  

另请参阅See Also

BACKUP (Transact-SQL) BACKUP (Transact-SQL)
sys.backup_devices (Transact-SQL) sys.backup_devices (Transact-SQL)
sp_addumpdevice (Transact-SQL) sp_addumpdevice (Transact-SQL)
sp_dropdevice (Transact-SQL) sp_dropdevice (Transact-SQL)
备份设备 (SQL Server) Backup Devices (SQL Server)
为磁盘文件定义逻辑备份设备 (SQL Server) Define a Logical Backup Device for a Disk File (SQL Server)
查看逻辑备份设备的属性和内容 (SQL Server)View the Properties and Contents of a Logical Backup Device (SQL Server)