Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
Windows Server

SQL Server 2008 : Managing Backups - Logical Backup Devices

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
7/9/2011 11:35:36 AM
You can create a logical backup device that points to a physical backup device, which enables you to back up and restore using the logical name instead of the actual physical device. This is useful for providing an abstraction layer between backup scripts and the actual physical backup devices. For example, if you need to change the location for your backups, instead of changing every script, all you need to do is delete the old logical backup device and create a new one that points to the appropriate location.

To create a logical backup device, you can use the sp_addumpdevice system stored procedure. The code in Listing 1 creates a logical backup device named AdventureWorks BackupDevice that points to the physical backup device C:\Backup\AdventureWorks2008.bak. To drop a logical backup device, you can execute the sp_dropdevice system stored procedure followed by the name of the device (also shown in Listing 1).

Example 1. Code to Add and Remove a Logical Backup Device Using T-SQL
USE master
GO
--Add logical backup device
EXEC sp_addumpdevice
@devtype ='disk',
@logicalname ='AdventureWorksBackupDevice' ,
@physicalname ='C:\Backup\AdventureWorks2008.bak'
GO

--Remove logical backup device
EXEC sp_dropdevice 'AdventureWorksBackupDevice'
GO

You can also add a logical backup device using the SQL Server Management Studio GUI. Expand the Server Objects node in the Object Explorer, right-click on the Backup Devices folder, and select New Backup Device from the context menu. This will bring you to the Backup Device dialog box, as shown in Figure 1. Enter the logical device name, device type, and physical location, and then select OK to create the device.

Figure 1. Backup Device dialog General section

Once you create the backup device, the next time you open the Backup Device dialog box, you will see a Media Contents page. You can open the Backup Device dialog box again by double-clicking the appropriate device in the Backup Devices folder. The Media Contents page displays all of the backup sets that are contained in the logical backup device, as shown in Figure 2. We have taken two full backups before opening the dialog box again for demonstration purposes.

Figure 2. Backup Device dialog Media Contents section

You can query the sys.backup_devices catalog view to display a list all of the current logical backup devices, along with the physical device type and location. Figure 3 shows the results for the backup device we created in this section.

Figure 3. Results returned from the sys.backup_devices catalog view
Other -----------------
- SQL Server 2008 : Managing Backups - Backup Compression
- BizTalk 2009 : BizTalk Endpoint Management (part 2) - Endpoint Virtualization & Operation Versioning
- BizTalk 2009 : BizTalk Endpoint Management (part 1) - The Problem with WSDL
- SharePoint 2010 : Farm and Application Configuration (part 2) - Creating Search Applications & Configuring the Search Application
- SharePoint 2010 : Farm and Application Configuration (part 1) - Farm-Wide Search Settings & Managing Crawler Impact Rules
- SharePoint 2010 : Search Server 2010 and FAST Search - Search Architecture
- Microsoft Dynamics AX 2009 : Application Model Elements (part 3) - Presentation Model Elements
- Microsoft Dynamics AX 2009 : Application Model Elements (part 2) - Value Type, Database, and Data Association Model Elements
- Microsoft Dynamics AX 2009 : Application Model Elements (part 1) - Operational and Programming Model Elements
- Microsoft Dynamics AX 2009 : The MorphX Development Environment - Developing with MorphX
 
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
 
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server