Adds a backup device to Microsoft® SQL Server™.
sp_addumpdevice [@devtype =] 'device_type',
[@logicalname =] 'logical_name',
[@physicalname =] 'physical_name'
[, {
[@cntrltype =] controller_type
|
[@devstatus =] 'device_status'
}
]
Value | Description |
---|---|
disk | Hard disk file as a backup device. |
pipe | Named pipe. |
tape | Any tape devices supported by Microsoft Windows NT®. If device is tape, noskip is the default. |
When creating a backup device on a remote network location, be sure that the name under which SQL Server was started has appropriate write capabilities on the remote computer.
If you are adding a tape device, this parameter must be the physical name assigned to the local tape device by Windows NT, for example, \\.\TAPE0 for the first tape device on the computer. The tape device must be attached to the server computer; it cannot be used remotely. Enclose names containing nonalphanumeric characters in quotation marks.
Value | Description |
---|---|
2 | Use when device_type is disk. |
5 | Use when device_type is tape. |
6 | Use when device_type is pipe. |
Note Either specify controller_type or device_status, but not both.
0 (success) or 1 (failure)
None
sp_addumpdevice adds a backup device to the master.dbo.sysdevices table. It can then be referred to logically in BACKUP and RESTORE statements.
Ownership and permissions problems can interfere with the use of disk or file backup devices. Make sure that appropriate file permissions are given to the account under which SQL Server was started.
SQL Server supports tape backups to tape devices that are supported by Windows NT. For information about Windows NT - supported tape devices, see the hardware compatibility list for Windows NT. To view the tape devices available on the computer, use SQL Server Enterprise Manager.
Use only the recommended tapes for the specific tape drive (as suggested by the drive manufacturer). If you are using DAT drives, use computer-grade DAT tapes (Digital Data Storage-DDS).
sp_addumpdevice cannot be executed inside a transaction.
Execute permissions default to members of the diskadmin fixed server role.
This example adds a disk backup device named MYDISKDUMP, with the physical name C:\Dump\Dump1.bak.
USE master
EXEC sp_addumpdevice 'disk', 'mydiskdump', 'c:\dump\dump1.bak'
This example shows a remote disk backup device. The name under which SQL Server was started must have permissions to that remote file.
USE master
EXEC sp_addumpdevice 'disk', 'networkdevice',
'\\servername\sharename\path\filename.ext'
This example adds the TAPEDUMP1 device with the physical name \\.\Tape0.
USE master
EXEC sp_addumpdevice 'tape', 'tapedump1',
'\\.\tape0'
BACKUP | sp_helpdevice |
RESTORE | System Stored Procedures |
sp_dropdevice |