View the Contents of a Backup Tape or File (SQL Server)
This topic describes how to view the content of a backup tape or file in SQL Server 2012 by using SQL Server Management Studio or Transact-SQL.
[!UWAGA]
Support for tape backup devices will be removed in a future version of SQL 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:
Security
To view the content of a backup tape or file, using:
SQL Server Management Studio
Transact-SQL
Before You Begin
Security
For information about security, see RESTORE HEADERONLY (Transact-SQL).
Permissions
In SQL Server 2008 and later versions, obtaining information about a backup set or backup device requires CREATE DATABASE permission. For more information, see GRANT Database Permissions (Transact-SQL).
[Top]
Using SQL Server Management Studio
To view the content of a backup tape or file
After connecting to the appropriate instance of the Microsoft SQL Server Database Engine, in Object Explorer, click the server name to expand the server tree.
Expand Databases, and, depending on the database, either select a user database or expand System Databases and select a system database.
Right-click the database you want to backup, point to Tasks, and then click Back Up. The Back Up Database dialog box appears.
In the Destination section of the General page, click either Disk or Tape. In the Back up to list box, look for the disk file or tape you want.
If the disk file or tape is not displayed in the list-box, click Add. Select a file name or tape drive. To add it to the Back up to list-box, click OK.
In the Back up to list-box, select the path of the disk or tape drive you want to view, and click Contents. This opens the Device Contents dialog box.
The right-hand pane displays information about the media set and backup sets on the selected tape or file.
[Top]
Using Transact-SQL
To view the content of a backup tape or file
Connect to the Database Engine.
From the Standard bar, click New Query.
Use the RESTORE HEADERONLY statement. This example returns information about the file named AdventureWorks2012-FullBackup.bak.
USE AdventureWorks2012;
RESTORE HEADERONLY
FROM DISK = N'C:\AdventureWorks2012-FullBackup.bak' ;
GO
[Top]
Zobacz także
Zadania
Define a Logical Backup Device for a Disk File (SQL Server)
Define a Logical Backup Device for a Tape Drive (SQL Server)
Odwołanie
backupfilegroup (Transact-SQL)
backupmediafamily (Transact-SQL)